HydroFlux 0.0.8

This commit is contained in:
2026-02-10 08:57:03 +11:00
parent 3c8efbacdd
commit c0d23153ca
3 changed files with 15 additions and 9 deletions

View File

@@ -44,7 +44,7 @@ export class SleepView {
<div>
<div class="flex justify-between text-sm mb-1">
<span class="text-purple-500 font-medium">REM</span>
<span class="font-bold text-gray-700">1h 45m</span>
<span class="font-bold text-gray-700">${formatTime(remHours)}</span>
</div>
<div class="h-2 w-full bg-gray-100 rounded-full overflow-hidden">
<div class="h-full bg-purple-400" style="width: 25%"></div>
@@ -55,10 +55,10 @@ export class SleepView {
<div>
<div class="flex justify-between text-sm mb-1">
<span class="text-blue-600 font-medium">Deep Sleep</span>
<span class="font-bold text-gray-700">2h 10m</span>
<span class="font-bold text-gray-700">${formatTime(deepHours)}</span>
</div>
<div class="h-2 w-full bg-gray-100 rounded-full overflow-hidden">
<div class="h-full bg-blue-600" style="width: 35%"></div>
<div class="h-full bg-blue-600" style="width: 20%"></div>
</div>
</div>
@@ -66,10 +66,10 @@ export class SleepView {
<div>
<div class="flex justify-between text-sm mb-1">
<span class="text-blue-400 font-medium">Light Sleep</span>
<span class="font-bold text-gray-700">3h 25m</span>
<span class="font-bold text-gray-700">${formatTime(lightHours)}</span>
</div>
<div class="h-2 w-full bg-gray-100 rounded-full overflow-hidden">
<div class="h-full bg-blue-300" style="width: 40%"></div>
<div class="h-full bg-blue-300" style="width: 55%"></div>
</div>
</div>
</div>

View File

@@ -52,9 +52,14 @@ export class WaterView {
<div class="px-6 mt-4">
<h3 class="font-bold text-gray-800 text-lg mb-4">Today's History</h3>
<div class="space-y-3" id="historyList">
${this.history.length === 0 ?
'<div class="text-center text-gray-400 py-4 text-sm">No drinks logged yet today.</div>' :
this.history.slice().reverse().map(entry => `
${(() => {
const todayStart = new Date();
todayStart.setHours(0, 0, 0, 0);
const todaysEntries = this.history.filter(h => h.timestamp >= todayStart.getTime());
return todaysEntries.length === 0 ?
'<div class="text-center text-gray-400 py-4 text-sm">No drinks logged yet today.</div>' :
todaysEntries.slice().reverse().map(entry => `
<div class="flex items-center justify-between p-4 rounded-xl bg-white shadow-sm border border-blue-50">
<div class="flex items-center gap-3">
<div class="w-10 h-10 rounded-full bg-blue-100 flex items-center justify-center text-blue-500">
@@ -67,7 +72,8 @@ export class WaterView {
</div>
<span class="font-bold text-gray-800">+${entry.amount}ml</span>
</div>
`).join('')}
`).join('');
})()}
</div>
</div>
</div>

Binary file not shown.