diff --git a/assets/css/app.css b/assets/css/app.css index f2a0b8a..7425ddd 100644 --- a/assets/css/app.css +++ b/assets/css/app.css @@ -244,6 +244,26 @@ button:disabled { gap: 1rem; } +.site-footer { + display: flex; + justify-content: space-between; + align-items: center; + gap: 0.9rem; + margin-top: auto; + padding: 0.9rem 1.1rem; + border-radius: var(--radius-lg); +} + +.site-footer__link { + color: var(--muted); + font-size: 0.92rem; + transition: color 180ms ease, opacity 180ms ease; +} + +.site-footer__link:hover { + color: var(--text); +} + .topbar { display: flex; justify-content: space-between; @@ -1500,6 +1520,10 @@ input[type="range"] { padding-bottom: calc(6.8rem + env(safe-area-inset-bottom)); } + .site-footer { + margin-bottom: 0.5rem; + } + .bar-chart { overflow-x: auto; padding-bottom: 0.4rem; @@ -1580,4 +1604,10 @@ input[type="range"] { .mobile-nav a span { font-size: 0.72rem; } + + .site-footer { + flex-direction: column; + align-items: flex-start; + gap: 0.4rem; + } } diff --git a/assets/js/app.js b/assets/js/app.js index 87266f8..9927e19 100644 --- a/assets/js/app.js +++ b/assets/js/app.js @@ -394,7 +394,7 @@ } const seriesName = container.dataset.series || ""; - const invertScale = seriesName === "stress"; + const invertScale = seriesName === "stress" || seriesName === "pain"; const values = items.map(item => Number(item.value)); const width = 760; const height = 196; @@ -402,7 +402,7 @@ let minValue = Math.min(...values); let maxValue = Math.max(...values); - if (seriesName === "mood" || seriesName === "stress") { + if (seriesName === "mood" || seriesName === "stress" || seriesName === "pain") { minValue = Math.max(1, minValue - 1.5); maxValue = Math.min(10, maxValue + 1.5); } else { @@ -412,7 +412,7 @@ if ((maxValue - minValue) < 3) { const center = (maxValue + minValue) / 2; - if (seriesName === "mood" || seriesName === "stress") { + if (seriesName === "mood" || seriesName === "stress" || seriesName === "pain") { minValue = Math.max(1, center - 1.5); maxValue = Math.min(10, center + 1.5); } else { diff --git a/src/App.php b/src/App.php index f391725..e8bfdbb 100644 --- a/src/App.php +++ b/src/App.php @@ -234,6 +234,7 @@ final class App 'pageTitle' => 'Dashboard', 'page' => 'dashboard', 'authUser' => $user, + 'settings' => $settings, 'summary' => $summary, 'entries' => array_reverse($evaluatedEntries), 'chartPayload' => encode_payload($chartData), @@ -544,6 +545,12 @@ final class App 'value' => $entry['stress'], ]; }, $recent), + 'pain' => array_map(static function (array $entry): array { + return [ + 'date' => $entry['date'], + 'value' => $entry['pain'], + ]; + }, $recent), 'sport' => array_map(static function (array $entry): array { return [ 'date' => $entry['date'], diff --git a/templates/layout.php b/templates/layout.php index 78c5e3c..8c8de87 100644 --- a/templates/layout.php +++ b/templates/layout.php @@ -112,6 +112,11 @@ $brandSubtitle = match ($page) { + + diff --git a/templates/pages/dashboard.php b/templates/pages/dashboard.php index 9e5449b..9a6e464 100644 --- a/templates/pages/dashboard.php +++ b/templates/pages/dashboard.php @@ -73,6 +73,19 @@
+ +
+
+
+

Körper

+

Schmerzverlauf

+
+ weniger ist besser +
+
+
+ +