Render sleep bar fill directly
This commit is contained in:
@@ -112,6 +112,7 @@ $formatBalanceValue = static function (?array $entry) use ($settings): string {
|
||||
<?php foreach ($dashboardTimeline as $item): ?>
|
||||
<?php $eventType = (string) ($item['type'] ?? 'event'); ?>
|
||||
<?php $eventComment = trim((string) ($item['comment'] ?? '')); ?>
|
||||
<?php if (preg_match('/^\s*-\s*(?:Stimmung|Energie|Stress)\s*:\s*[+-]?\d+\s*$/u', $eventComment) === 1) { $eventComment = ''; } ?>
|
||||
<?php $isImportedHealth = (string) ($item['source'] ?? '') === 'health_auto_export'; ?>
|
||||
<?php $sportType = $eventType === 'sport' ? find_sport_type($settings, (string) ($item['sport_type_id'] ?? '')) : null; ?>
|
||||
<?php $isImportedWalkSport = $isImportedHealth && $eventType === 'sport' && str_contains(strtolower((string) ($sportType['label'] ?? $eventComment)), 'spaziergang'); ?>
|
||||
@@ -220,7 +221,7 @@ $formatBalanceValue = static function (?array $entry) use ($settings): string {
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($eventType === 'sleep' && $sleepActualTotal > 0): ?>
|
||||
<div class="sleep-phase-bar" aria-label="Schlafphasen" style="--sleep-optimal-left: <?= e((string) $sleepOptimalPercent) ?>%; --sleep-actual-width: <?= e((string) $sleepActualPercent) ?>%">
|
||||
<div class="sleep-phase-bar" aria-label="Schlafphasen" style="--sleep-optimal-left: <?= e((string) $sleepOptimalPercent) ?>%; --sleep-actual-width: <?= e((string) $sleepActualPercent) ?>%; background: linear-gradient(90deg, rgba(90, 188, 242, 0.88) 0%, rgba(44, 126, 190, 0.88) <?= e((string) $sleepActualPercent) ?>%, rgba(255, 255, 255, 0.08) <?= e((string) $sleepActualPercent) ?>%, rgba(255, 255, 255, 0.08) 100%)">
|
||||
<div class="sleep-phase-bar__fill" style="width: <?= e((string) $sleepActualPercent) ?>%">
|
||||
<?php if ($sleepPhaseTotal > 0): ?>
|
||||
<?php foreach (['deep' => ['Tief', 'deep'], 'rem' => ['REM', 'rem'], 'core' => ['Kern', 'core']] as $phase => [$label, $class]): ?>
|
||||
|
||||
Reference in New Issue
Block a user