Add dashboard pain chart and version footer
This commit is contained in:
@@ -244,6 +244,26 @@ button:disabled {
|
|||||||
gap: 1rem;
|
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 {
|
.topbar {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
@@ -1500,6 +1520,10 @@ input[type="range"] {
|
|||||||
padding-bottom: calc(6.8rem + env(safe-area-inset-bottom));
|
padding-bottom: calc(6.8rem + env(safe-area-inset-bottom));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.site-footer {
|
||||||
|
margin-bottom: 0.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
.bar-chart {
|
.bar-chart {
|
||||||
overflow-x: auto;
|
overflow-x: auto;
|
||||||
padding-bottom: 0.4rem;
|
padding-bottom: 0.4rem;
|
||||||
@@ -1580,4 +1604,10 @@ input[type="range"] {
|
|||||||
.mobile-nav a span {
|
.mobile-nav a span {
|
||||||
font-size: 0.72rem;
|
font-size: 0.72rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.site-footer {
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: flex-start;
|
||||||
|
gap: 0.4rem;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-3
@@ -394,7 +394,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
const seriesName = container.dataset.series || "";
|
const seriesName = container.dataset.series || "";
|
||||||
const invertScale = seriesName === "stress";
|
const invertScale = seriesName === "stress" || seriesName === "pain";
|
||||||
const values = items.map(item => Number(item.value));
|
const values = items.map(item => Number(item.value));
|
||||||
const width = 760;
|
const width = 760;
|
||||||
const height = 196;
|
const height = 196;
|
||||||
@@ -402,7 +402,7 @@
|
|||||||
let minValue = Math.min(...values);
|
let minValue = Math.min(...values);
|
||||||
let maxValue = Math.max(...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);
|
minValue = Math.max(1, minValue - 1.5);
|
||||||
maxValue = Math.min(10, maxValue + 1.5);
|
maxValue = Math.min(10, maxValue + 1.5);
|
||||||
} else {
|
} else {
|
||||||
@@ -412,7 +412,7 @@
|
|||||||
|
|
||||||
if ((maxValue - minValue) < 3) {
|
if ((maxValue - minValue) < 3) {
|
||||||
const center = (maxValue + minValue) / 2;
|
const center = (maxValue + minValue) / 2;
|
||||||
if (seriesName === "mood" || seriesName === "stress") {
|
if (seriesName === "mood" || seriesName === "stress" || seriesName === "pain") {
|
||||||
minValue = Math.max(1, center - 1.5);
|
minValue = Math.max(1, center - 1.5);
|
||||||
maxValue = Math.min(10, center + 1.5);
|
maxValue = Math.min(10, center + 1.5);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -234,6 +234,7 @@ final class App
|
|||||||
'pageTitle' => 'Dashboard',
|
'pageTitle' => 'Dashboard',
|
||||||
'page' => 'dashboard',
|
'page' => 'dashboard',
|
||||||
'authUser' => $user,
|
'authUser' => $user,
|
||||||
|
'settings' => $settings,
|
||||||
'summary' => $summary,
|
'summary' => $summary,
|
||||||
'entries' => array_reverse($evaluatedEntries),
|
'entries' => array_reverse($evaluatedEntries),
|
||||||
'chartPayload' => encode_payload($chartData),
|
'chartPayload' => encode_payload($chartData),
|
||||||
@@ -544,6 +545,12 @@ final class App
|
|||||||
'value' => $entry['stress'],
|
'value' => $entry['stress'],
|
||||||
];
|
];
|
||||||
}, $recent),
|
}, $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 {
|
'sport' => array_map(static function (array $entry): array {
|
||||||
return [
|
return [
|
||||||
'date' => $entry['date'],
|
'date' => $entry['date'],
|
||||||
|
|||||||
@@ -112,6 +112,11 @@ $brandSubtitle = match ($page) {
|
|||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
|
|
||||||
<?= $content ?>
|
<?= $content ?>
|
||||||
|
|
||||||
|
<footer class="site-footer glass-panel">
|
||||||
|
<a class="site-footer__link" href="https://git.hnz.io/hnzio/mood-tracking/releases" target="_blank" rel="noreferrer">Version 1.2.0</a>
|
||||||
|
<a class="site-footer__link" href="https://hnz.io" target="_blank" rel="noreferrer">(c) 2026 @hnz.io</a>
|
||||||
|
</footer>
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
<?php if ($authUser !== null): ?>
|
<?php if ($authUser !== null): ?>
|
||||||
|
|||||||
@@ -73,6 +73,19 @@
|
|||||||
<div class="line-chart" data-chart-type="line" data-series="stress" data-payload="<?= e($chartPayload) ?>"></div>
|
<div class="line-chart" data-chart-type="line" data-series="stress" data-payload="<?= e($chartPayload) ?>"></div>
|
||||||
</article>
|
</article>
|
||||||
|
|
||||||
|
<?php if (!empty($settings['tracking']['pain_enabled'])): ?>
|
||||||
|
<article class="glass-panel chart-card">
|
||||||
|
<div class="section-head">
|
||||||
|
<div>
|
||||||
|
<p class="eyebrow">Körper</p>
|
||||||
|
<h3>Schmerzverlauf</h3>
|
||||||
|
</div>
|
||||||
|
<span class="chart-chip chart-chip--warm">weniger ist besser</span>
|
||||||
|
</div>
|
||||||
|
<div class="line-chart" data-chart-type="line" data-series="pain" data-payload="<?= e($chartPayload) ?>"></div>
|
||||||
|
</article>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
<article class="glass-panel chart-card chart-card--wide">
|
<article class="glass-panel chart-card chart-card--wide">
|
||||||
<div class="section-head">
|
<div class="section-head">
|
||||||
<div>
|
<div>
|
||||||
|
|||||||
Reference in New Issue
Block a user