when plus tapped there is no action - Follow Up Deployment
Browse files- index.html +36 -9
index.html
CHANGED
@@ -430,7 +430,7 @@
|
|
430 |
<div class="relative">
|
431 |
<svg width="120" height="120" viewBox="0 0 120 120">
|
432 |
<circle cx="60" cy="60" r="54" fill="none" stroke="#e2e8f0" stroke-width="8" />
|
433 |
-
<circle cx="60" cy="60" r="54" fill="none" stroke="#3b82f6" stroke-width="8" stroke-dasharray="339.292" stroke-dashoffset="84.823" stroke-linecap="round" transform="rotate(-90 60 60)" />
|
434 |
</svg>
|
435 |
<div class="absolute inset-0 flex flex-col items-center justify-center">
|
436 |
<span class="text-2xl font-bold">1.8L</span>
|
@@ -440,10 +440,10 @@
|
|
440 |
</div>
|
441 |
|
442 |
<div class="grid grid-cols-4 gap-2">
|
443 |
-
<button class="bg-blue-50 text-blue-500 py-2 rounded-lg hover:bg-blue-100 transition">
|
444 |
<i class="fas fa-plus"></i> 250ml
|
445 |
</button>
|
446 |
-
<button class="bg-blue-50 text-blue-500 py-2 rounded-lg hover:bg-blue-100 transition">
|
447 |
<i class="fas fa-plus"></i> 500ml
|
448 |
</button>
|
449 |
<button class="bg-blue-100 text-blue-700 py-2 rounded-lg font-medium">
|
@@ -682,12 +682,39 @@
|
|
682 |
});
|
683 |
});
|
684 |
|
685 |
-
// Water intake
|
686 |
-
|
687 |
-
|
688 |
-
|
689 |
-
|
690 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
691 |
});
|
692 |
|
693 |
// Sync steps button
|
|
|
430 |
<div class="relative">
|
431 |
<svg width="120" height="120" viewBox="0 0 120 120">
|
432 |
<circle cx="60" cy="60" r="54" fill="none" stroke="#e2e8f0" stroke-width="8" />
|
433 |
+
<circle class="progress-ring__circle" cx="60" cy="60" r="54" fill="none" stroke="#3b82f6" stroke-width="8" stroke-dasharray="339.292" stroke-dashoffset="84.823" stroke-linecap="round" transform="rotate(-90 60 60)" />
|
434 |
</svg>
|
435 |
<div class="absolute inset-0 flex flex-col items-center justify-center">
|
436 |
<span class="text-2xl font-bold">1.8L</span>
|
|
|
440 |
</div>
|
441 |
|
442 |
<div class="grid grid-cols-4 gap-2">
|
443 |
+
<button id="add250ml" class="bg-blue-50 text-blue-500 py-2 rounded-lg hover:bg-blue-100 transition">
|
444 |
<i class="fas fa-plus"></i> 250ml
|
445 |
</button>
|
446 |
+
<button id="add500ml" class="bg-blue-50 text-blue-500 py-2 rounded-lg hover:bg-blue-100 transition">
|
447 |
<i class="fas fa-plus"></i> 500ml
|
448 |
</button>
|
449 |
<button class="bg-blue-100 text-blue-700 py-2 rounded-lg font-medium">
|
|
|
682 |
});
|
683 |
});
|
684 |
|
685 |
+
// Water intake functionality
|
686 |
+
let waterIntake = 1.8;
|
687 |
+
const maxWaterIntake = 2.5;
|
688 |
+
const waterDisplay = document.querySelector('.absolute.inset-0 span.text-2xl');
|
689 |
+
const waterCircle = document.querySelector('.progress-ring__circle');
|
690 |
+
|
691 |
+
// Update water display and progress circle
|
692 |
+
function updateWaterDisplay() {
|
693 |
+
waterDisplay.textContent = `${waterIntake.toFixed(1)}L`;
|
694 |
+
const percentage = (waterIntake / maxWaterIntake) * 100;
|
695 |
+
const circumference = 2 * Math.PI * 54;
|
696 |
+
const offset = circumference - (percentage / 100) * circumference;
|
697 |
+
waterCircle.style.strokeDashoffset = offset;
|
698 |
+
}
|
699 |
+
|
700 |
+
// Add 250ml button
|
701 |
+
document.getElementById('add250ml').addEventListener('click', function() {
|
702 |
+
waterIntake += 0.25;
|
703 |
+
if (waterIntake > maxWaterIntake) waterIntake = maxWaterIntake;
|
704 |
+
updateWaterDisplay();
|
705 |
+
});
|
706 |
+
|
707 |
+
// Add 500ml button
|
708 |
+
document.getElementById('add500ml').addEventListener('click', function() {
|
709 |
+
waterIntake += 0.5;
|
710 |
+
if (waterIntake > maxWaterIntake) waterIntake = maxWaterIntake;
|
711 |
+
updateWaterDisplay();
|
712 |
+
});
|
713 |
+
|
714 |
+
// Reset button
|
715 |
+
document.querySelector('.bg-blue-500').addEventListener('click', function() {
|
716 |
+
waterIntake = 0;
|
717 |
+
updateWaterDisplay();
|
718 |
});
|
719 |
|
720 |
// Sync steps button
|