Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<!doctype html>
<html lang="de">

<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>BMI Web App</title>

<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet" />
<link rel="stylesheet" href="./themes.css?v=20260309" />
<link rel="stylesheet" href="./src/dashboard/dashboard.css?v=20260309" />
<script src="./src/dashboard/dashboard.js?v=20260302" defer></script>
</head>

<body style="padding: 20px; background-color: var(--color-primary-light)">

<div class="row">
<aside class="col-3">
<div class="sidebar" style="background-color: var(--color-bg); border: 2px solid var(--color-primary);">
<div class="sidebar-title"
style="background-color: var(--color-primary); border-bottom: 1px solid var(--color-primary); ">Menü
</div>
<nav id="sidebarNav" class="nav flex-column">
<a class="nav-link active" href="#dashboard" data-page="dashboard">Dashboard</a>
<a class="nav-link" href="#formular" data-page="formular">Forms</a>
<a class="nav-link" href="#tables" data-page="tables">Tables</a>
</nav>
</div>
</aside>

<main class="col-9">
<div id="view"></div>
</main>
</div>

</body>

</html>
177 changes: 113 additions & 64 deletions src/dashboard/dashboard.css
Original file line number Diff line number Diff line change
@@ -1,73 +1,141 @@
/* Base */
/* =========================
Base
========================= */
html,
body {
height: 100%;
}

body {
background: #fdfdfd;
background: var(--bg-page);
color: var(--text-main);
font-family: Arial, sans-serif;
}

/* Layout helpers */
.box {
background: #fff;
border: 2px solid #333;
/* Better outer spacing */
.container-fluid {
padding: var(--space-5);
}

.box-chart {
background: #fff;
border: 2px solid #333;
height: 600px;
/* =========================
Shared card look
========================= */
.box,
.box-chart,
.sidebar {
background: var(--surface);
border: 1px solid var(--border);
border-radius: var(--radius-xl);
box-shadow: var(--shadow-soft);
}

/* =========================
Sidebar
========================= */
.sidebar {
min-height: calc(100vh - 48px);
overflow: hidden;
position: sticky;
top: 24px;
}

.page-title {
padding: 10px 14px;
.sidebar-title {
padding: 18px 20px;
font-size: 1rem;
font-weight: 700;
text-align: center;
font-weight: 600;
color: var(--text-main);
border-bottom: 1px solid var(--border);
background: var(--bg-soft);
}

.box-header {
border-bottom: 2px solid #333;
padding: 8px 12px;
.sidebar .nav-link {
color: var(--text-soft) !important;
text-decoration: none;
padding: 16px 18px;
text-align: center;
font-weight: 600;
border-bottom: 1px solid var(--border-soft);
transition:
background-color 0.2s ease,
color 0.2s ease;
}

/* Sidebar */
.sidebar {
background: #fff;
border: 2px solid #333;
min-height: calc(100vh - 2rem);
.sidebar .nav-link:hover {
background: var(--surface-2);
color: var(--text-main) !important;
}

.sidebar-title {
border-bottom: 2px solid #333;
font-weight: 600;
text-align: center;
padding: 10px;
.sidebar .nav-link.active {
background: var(--color-primary-light);
color: var(--color-primary-dark) !important;
font-weight: 700;
}

.sidebar .nav-link {
color: #000 !important;
text-decoration: none;
padding: 14px 16px;
/* =========================
Dashboard sections
========================= */
.page-title,
.box-header {
padding: 18px 22px;
text-align: center;
border-bottom: 1px solid #333;
font-size: 1.05rem;
font-weight: 700;
color: var(--text-main);
border-bottom: 1px solid var(--border);
background: var(--color-surface-light);
border: 1px solid var(--color-primary);
}

.sidebar .nav-link.active {
.box {
overflow: hidden;
}

.box-chart {
padding: var(--space-4);
min-height: 510px;
}

.embed-title {
margin-bottom: 14px;
text-align: center;
font-size: 1rem;
font-weight: 700;
background: #f2f2f2;
color: var(--text-main);
}

/* Placeholders */
.embed-box {
border: 1px solid var(--border);
border-radius: var(--radius-lg);
background: var(--surface-2);
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

/* iframes */
.dash-frame,
.table-frame {
width: 100%;
border-radius: var(--radius-md);
background: var(--color-surface-light);
}

.dash-frame {
height: 420px;
}

.table-frame {
height: 470px;
}

/* legacy placeholders if still used anywhere */
.ph {
background: #f1f1f1;
border: 2px solid #999;
background: var(--bg-soft);
border: 1px dashed var(--border);
border-radius: var(--radius-md);
display: grid;
place-items: center;
color: #333;
font-weight: 600;
color: var(--text-soft);
font-weight: 700;
user-select: none;
}

Expand All @@ -83,32 +151,13 @@ body {
height: 936px;
}

/* Embedded pages (iframes) */
.embed-title {
/* Optional fallback text inside dashboard */
.embed-fallback {
margin-top: 12px;
padding: 10px 12px;
border-radius: var(--radius-sm);
background: #f4edcf;
color: #7b6d18;
font-weight: 600;
margin-bottom: 10px;
text-align: center;
}

.embed-box {
border: 2px solid #999;
background: #f9f9f9;
height: 320px; /* Controls visible height of embedded page */
}

.embed-frame {
width: 100%;
height: 100%;
border: 0; /* No iframe border */
display: block;
}

.dash-frame {
height: 540px;
width: 100%;
}

.table-frame {
height: 520px;
width: 100%;
}
18 changes: 11 additions & 7 deletions src/dashboard/dashboard.html
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
<!-- src/dashboard/dashboard.html -->

<div class="row g-3">
<div class="col-12">
<div class="box page-title">Dashboard</div>
<div class="box page-title" style="background-color: var(--color-primary);">Dashboard</div>
</div>

<div class="col-12 col-lg-6">
<div class="box-chart p-3">
<div class="box-chart p-3" style="border: 1px solid var(--color-primary);">
<div class="embed-title">Bar Chart</div>

<!-- IMPORTANT: barchart/ is in src/, not in dashboard/ -->
Expand All @@ -16,10 +15,10 @@
</div>

<div class="col-12 col-lg-6">
<div class="box-chart p-3">
<div class="box-chart p-3" style="border: 1px solid var(--color-primary);">
<div class="embed-title">Line Chart</div>

<div class="embed-box embed-box--small">
<div class="embed-box">
<!-- IMPORTANT: line_chart/ is in src/, not in dashboard/ -->
<iframe id="dashLineFrame" class="dash-frame" src="../line_chart/line_chart.html" title="Line chart"
loading="lazy"></iframe>
Expand All @@ -32,8 +31,13 @@
</div>

<div class="col-12">
<div class="box">
<div class="box-header">Tables</div>
<div class="box page-title" style="background-color: var(--color-primary);">Tables</div>
</div>


<div class="col-12">
<div class="box" style="border: 1px solid var(--color-primary);">


<!-- IMPORTANT: tables/ is in src/, not in dashboard/ -->
<iframe class="table-frame" id="tableFrame" src="../tables/tables.html" title="Tables"
Expand Down
10 changes: 5 additions & 5 deletions src/dashboard/dashboard.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// src/dashboard/dashboard.js

const ROUTES = {
dashboard: "./dashboard/dashboard.html",
formular: "./formular/formular.html",
tables: "./tables/tables.html",
// Hash route -> view file
const routes = {
dashboard: "./src/dashboard/dashboard.html",
formular: "./src/formular/formular.html",
tables: "./src/tables/tables.html",
};

const DEFAULT_ROUTE = "dashboard";
Expand Down
Loading