File size: 33,302 Bytes
8f7c56a 861aaf2 8f7c56a 861aaf2 8f7c56a 861aaf2 8f7c56a 861aaf2 8f7c56a | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 | <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Decaf Journey - Quit Caffeine</title>
<script src="https://cdn.tailwindcss.com"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
<style>
:root {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue',
sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.pastel-brown {
background-color: #f5e9e0;
}
.pastel-brown-dark {
background-color: #e8d5c5;
}
.pastel-green {
background-color: #e0f0e8;
}
.pastel-blue {
background-color: #e0e8f0;
}
.pastel-pink {
background-color: #f8e0e8;
}
.tab-content {
display: none;
}
.tab-content.active {
display: block;
animation: fadeIn 0.5s;
}
h1, h2, h3 {
font-weight: 600;
letter-spacing: -0.025em;
line-height: 1.2;
}
p, li {
line-height: 1.5;
}
@keyframes fadeIn {
from { opacity: 0; }
to { opacity: 1; }
}
.text-4xl {
letter-spacing: -0.05em;
}
.progress-ring__circle {
transition: stroke-dashoffset 0.35s;
transform: rotate(-90deg);
transform-origin: 50% 50%;
}
</style>
</head>
<body class="pastel-brown min-h-screen">
<div class="container mx-auto px-4 py-8 max-w-4xl">
<!-- How to Use Dropdown -->
<details class="mb-8 bg-white rounded-lg shadow-md overflow-hidden">
<summary class="px-6 py-4 font-bold text-amber-900 cursor-pointer flex items-center justify-between">
<span><i class="fas fa-question-circle mr-2"></i>How to Use This Tool</span>
<i class="fas fa-chevron-down transition-transform duration-200"></i>
</summary>
<div class="px-6 pb-4 pt-2 text-amber-800">
<p class="mb-4">This tool helps you track your caffeine-free journey and understand what to expect during withdrawal.</p>
<ul class="list-disc pl-5 space-y-2">
<li><strong>Timer tab:</strong> Start when you quit caffeine to track your progress</li>
<li><strong>Symptoms tab:</strong> Learn about common withdrawal effects</li>
<li><strong>Timeline tab:</strong> See what to expect at each stage</li>
<li><strong>Tips tab:</strong> Get advice for quitting successfully</li>
</ul>
</div>
</details>
<!-- Header -->
<header class="flex flex-col items-center mb-8">
<div class="w-24 h-24 rounded-full pastel-brown-dark flex items-center justify-center mb-4 shadow-md">
<i class="fas fa-coffee text-4xl text-amber-800"></i>
</div>
<h1 class="text-4xl font-bold text-amber-900 mb-2">Decaf Journey</h1>
<p class="text-lg text-amber-800">Your path to a caffeine-free life.</p>
</header>
<!-- Navigation Tabs -->
<div class="flex overflow-x-auto mb-8 bg-white rounded-lg shadow-md">
<button class="tab-btn flex-1 py-3 px-4 font-medium text-amber-900 hover:bg-amber-50 transition" data-tab="timer">
<i class="fas fa-clock mr-2"></i> Timer
</button>
<button class="tab-btn flex-1 py-3 px-4 font-medium text-amber-900 hover:bg-amber-50 transition" data-tab="symptoms">
<i class="fas fa-heartbeat mr-2"></i> Symptoms
</button>
<button class="tab-btn flex-1 py-3 px-4 font-medium text-amber-900 hover:bg-amber-50 transition" data-tab="timeline">
<i class="fas fa-calendar-alt mr-2"></i> Timeline
</button>
<button class="tab-btn flex-1 py-3 px-4 font-medium text-amber-900 hover:bg-amber-50 transition" data-tab="tips">
<i class="fas fa-lightbulb mr-2"></i> Tips
</button>
</div>
<!-- Tab Contents -->
<div class="tab-contents">
<!-- Timer Tab -->
<div id="timer" class="tab-content active">
<div class="bg-white rounded-lg shadow-md p-6 mb-6">
<h2 class="text-2xl font-bold text-amber-900 mb-4">Your Caffeine-Free Journey</h2>
<div class="flex flex-col items-center">
<div class="relative w-64 h-64 mb-6">
<svg class="w-full h-full" viewBox="0 0 100 100">
<circle class="text-amber-100" stroke-width="8" stroke="currentColor" fill="transparent" r="40" cx="50" cy="50" />
<circle class="progress-ring__circle text-amber-600" stroke-width="8" stroke-linecap="round" stroke="currentColor" fill="transparent" r="40" cx="50" cy="50" />
</svg>
<div class="absolute inset-0 flex flex-col items-center justify-center">
<div id="timer-display" class="text-4xl font-bold text-amber-900">00:00:00</div>
<div id="days-display" class="text-lg text-amber-700">0 days</div>
</div>
</div>
<div class="flex space-x-4 mb-6">
<button id="start-btn" class="bg-amber-600 hover:bg-amber-700 text-white font-bold py-2 px-6 rounded-full transition">
<i class="fas fa-play mr-2"></i> Start
</button>
<button id="reset-btn" class="bg-amber-100 hover:bg-amber-200 text-amber-800 font-bold py-2 px-6 rounded-full transition">
<i class="fas fa-redo mr-2"></i> Reset
</button>
</div>
</div>
<div class="pastel-green rounded-lg p-4">
<h3 class="font-bold text-amber-900 mb-2"><i class="fas fa-check-circle mr-2 text-green-600"></i>Benefits Achieved</h3>
<div id="benefits-list" class="text-sm text-amber-800">
<!-- Benefits will be added dynamically -->
</div>
</div>
</div>
<div class="bg-white rounded-lg shadow-md p-6">
<h2 class="text-2xl font-bold text-amber-900 mb-4">Your Progress</h2>
<div class="grid grid-cols-2 md:grid-cols-4 gap-4">
<div class="pastel-blue rounded-lg p-4 text-center">
<div class="text-3xl font-bold text-amber-900" id="progress-hours">0</div>
<div class="text-sm text-amber-700">Hours</div>
</div>
<div class="pastel-pink rounded-lg p-4 text-center">
<div class="text-3xl font-bold text-amber-900" id="progress-days">0</div>
<div class="text-sm text-amber-700">Days</div>
</div>
<div class="pastel-green rounded-lg p-4 text-center">
<div class="text-3xl font-bold text-amber-900" id="progress-weeks">0</div>
<div class="text-sm text-amber-700">Weeks</div>
</div>
<div class="pastel-brown-dark rounded-lg p-4 text-center">
<div class="text-3xl font-bold text-amber-900" id="progress-months">0</div>
<div class="text-sm text-amber-700">Months</div>
</div>
</div>
</div>
</div>
<!-- Symptoms Tab -->
<div id="symptoms" class="tab-content">
<div class="bg-white rounded-lg shadow-md p-6">
<h2 class="text-2xl font-bold text-amber-900 mb-4">Common Withdrawal Symptoms</h2>
<p class="text-amber-800 mb-6">When you quit caffeine, your body goes through an adjustment period. Here are the most common symptoms people experience:</p>
<div class="space-y-4">
<div class="flex items-start pastel-pink rounded-lg p-4">
<div class="bg-amber-100 text-amber-800 rounded-full w-8 h-8 flex items-center justify-center mr-3 mt-1">
<i class="fas fa-head-side-virus"></i>
</div>
<div>
<h3 class="font-bold text-amber-900">Headaches</h3>
<p class="text-sm text-amber-800">Often described as throbbing and typically worse in the morning. Usually peaks at 24-48 hours after last caffeine dose.</p>
</div>
</div>
<div class="flex items-start pastel-blue rounded-lg p-4">
<div class="bg-amber-100 text-amber-800 rounded-full w-8 h-8 flex items-center justify-center mr-3 mt-1">
<i class="fas fa-tired"></i>
</div>
<div>
<h3 class="font-bold text-amber-900">Fatigue</h3>
<p class="text-sm text-amber-800">Feeling unusually tired or sleepy during the day. This is your body adjusting to not having the stimulant effect of caffeine.</p>
</div>
</div>
<div class="flex items-start pastel-green rounded-lg p-4">
<div class="bg-amber-100 text-amber-800 rounded-full w-8 h-8 flex items-center justify-center mr-3 mt-1">
<i class="fas fa-brain"></i>
</div>
<div>
<h3 class="font-bold text-amber-900">Difficulty Concentrating</h3>
<p class="text-sm text-amber-800">You might feel foggy-headed or have trouble focusing on tasks that normally wouldn't be difficult.</p>
</div>
</div>
<div class="flex items-start pastel-brown-dark rounded-lg p-4">
<div class="bg-amber-100 text-amber-800 rounded-full w-8 h-8 flex items-center justify-center mr-3 mt-1">
<i class="fas fa-angry"></i>
</div>
<div>
<h3 class="font-bold text-amber-900">Mood Changes</h3>
<p class="text-sm text-amber-800">Irritability, anxiety, or even mild depression can occur as your brain chemistry adjusts.</p>
</div>
</div>
<div class="flex items-start pastel-pink rounded-lg p-4">
<div class="bg-amber-100 text-amber-800 rounded-full w-8 h-8 flex items-center justify-center mr-3 mt-1">
<i class="fas fa-hand-holding-medical"></i>
</div>
<div>
<h3 class="font-bold text-amber-900">Flu-like Symptoms</h3>
<p class="text-sm text-amber-800">Some people experience nausea, muscle stiffness, or achiness similar to having a mild flu.</p>
</div>
</div>
</div>
<div class="mt-8 pastel-green rounded-lg p-4">
<h3 class="font-bold text-amber-900 mb-2"><i class="fas fa-clock mr-2"></i>Duration of Symptoms</h3>
<p class="text-sm text-amber-800">Symptoms typically begin 12-24 hours after stopping caffeine, peak at 20-51 hours, and can last 2-9 days. The severity depends on your previous caffeine intake - heavier users may experience more intense symptoms.</p>
</div>
</div>
</div>
<!-- Timeline Tab -->
<div id="timeline" class="tab-content">
<div class="bg-white rounded-lg shadow-md p-6">
<h2 class="text-2xl font-bold text-amber-900 mb-4">What to Expect: Caffeine Withdrawal Timeline</h2>
<div class="relative">
<!-- Timeline line -->
<div class="absolute left-4 top-0 bottom-0 w-1 bg-amber-200"></div>
<div class="space-y-8 pl-12">
<!-- Timeline item 1 -->
<div class="relative">
<div class="absolute -left-12 top-0 w-8 h-8 rounded-full bg-amber-600 flex items-center justify-center text-white">
<i class="fas fa-hourglass-start"></i>
</div>
<div class="pastel-blue rounded-lg p-4">
<h3 class="font-bold text-amber-900">12-24 Hours</h3>
<p class="text-sm text-amber-800">First symptoms appear, often starting with fatigue and possibly a mild headache.</p>
</div>
</div>
<!-- Timeline item 2 -->
<div class="relative">
<div class="absolute -left-12 top-0 w-8 h-8 rounded-full bg-amber-600 flex items-center justify-center text-white">
<i class="fas fa-exclamation"></i>
</div>
<div class="pastel-pink rounded-lg p-4">
<h3 class="font-bold text-amber-900">24-48 Hours</h3>
<p class="text-sm text-amber-800">Peak withdrawal symptoms. Headaches are often most severe, fatigue increases, and mood changes may be noticeable.</p>
</div>
</div>
<!-- Timeline item 3 -->
<div class="relative">
<div class="absolute -left-12 top-0 w-8 h-8 rounded-full bg-amber-600 flex items-center justify-center text-white">
<i class="fas fa-cloud-sun"></i>
</div>
<div class="pastel-green rounded-lg p-4">
<h3 class="font-bold text-amber-900">2-5 Days</h3>
<p class="text-sm text-amber-800">Symptoms begin to improve. Headaches and fatigue start to diminish, though you may still feel less energetic than usual.</p>
</div>
</div>
<!-- Timeline item 4 -->
<div class="relative">
<div class="absolute -left-12 top-0 w-8 h-8 rounded-full bg-amber-600 flex items-center justify-center text-white">
<i class="fas fa-check"></i>
</div>
<div class="pastel-brown-dark rounded-lg p-4">
<h3 class="font-bold text-amber-900">1 Week</h3>
<p class="text-sm text-amber-800">Most physical symptoms have resolved. You may still experience occasional cravings or mild fatigue.</p>
</div>
</div>
<!-- Timeline item 5 -->
<div class="relative">
<div class="absolute -left-12 top-0 w-8 h-8 rounded-full bg-amber-600 flex items-center justify-center text-white">
<i class="fas fa-heart"></i>
</div>
<div class="pastel-blue rounded-lg p-4">
<h3 class="font-bold text-amber-900">2 Weeks+</h3>
<p class="text-sm text-amber-800">Your body has fully adjusted. Natural energy levels return, sleep quality improves, and you'll likely feel more stable without caffeine.</p>
</div>
</div>
</div>
</div>
<div class="mt-8 pastel-green rounded-lg p-4">
<h3 class="font-bold text-amber-900 mb-2"><i class="fas fa-info-circle mr-2"></i>Important Note</h3>
<p class="text-sm text-amber-800">This timeline can vary based on individual factors like metabolism, usual caffeine intake, and overall health. Some people may experience symptoms for a shorter or longer duration.</p>
</div>
</div>
</div>
<!-- Tips Tab -->
<div id="tips" class="tab-content">
<div class="bg-white rounded-lg shadow-md p-6">
<h2 class="text-2xl font-bold text-amber-900 mb-4">Tips for Quitting Caffeine Successfully</h2>
<div class="grid md:grid-cols-2 gap-6">
<div class="pastel-blue rounded-lg p-4">
<h3 class="font-bold text-amber-900 mb-2"><i class="fas fa-tint-slash mr-2"></i>Gradual Reduction</h3>
<p class="text-sm text-amber-800">Instead of quitting cold turkey, gradually reduce your intake over 1-2 weeks. This can minimize withdrawal symptoms.</p>
</div>
<div class="pastel-pink rounded-lg p-4">
<h3 class="font-bold text-amber-900 mb-2"><i class="fas fa-glass-whiskey mr-2"></i>Stay Hydrated</h3>
<p class="text-sm text-amber-800">Drink plenty of water to help flush caffeine from your system and reduce headaches.</p>
</div>
<div class="pastel-green rounded-lg p-4">
<h3 class="font-bold text-amber-900 mb-2"><i class="fas fa-bed mr-2"></i>Prioritize Sleep</h3>
<p class="text-sm text-amber-800">Get adequate rest to combat fatigue. Your sleep quality will improve without caffeine.</p>
</div>
<div class="pastel-brown-dark rounded-lg p-4">
<h3 class="font-bold text-amber-900 mb-2"><i class="fas fa-walking mr-2"></i>Exercise</h3>
<p class="text-sm text-amber-800">Physical activity can boost energy naturally and help with withdrawal symptoms.</p>
</div>
<div class="pastel-blue rounded-lg p-4">
<h3 class="font-bold text-amber-900 mb-2"><i class="fas fa-apple-alt mr-2"></i>Healthy Alternatives</h3>
<p class="text-sm text-amber-800">Try herbal teas, decaf coffee, or warm lemon water as substitutes for your usual caffeine drinks.</p>
</div>
<div class="pastel-pink rounded-lg p-4">
<h3 class="font-bold text-amber-900 mb-2"><i class="fas fa-sticky-note mr-2"></i>Track Your Progress</h3>
<p class="text-sm text-amber-800">Use this app to monitor how long you've been caffeine-free and celebrate milestones.</p>
</div>
</div>
<div class="mt-8 pastel-green rounded-lg p-4">
<h3 class="font-bold text-amber-900 mb-2"><i class="fas fa-heart mr-2"></i>Long-Term Benefits</h3>
<p class="text-sm text-amber-800 mb-2">After quitting caffeine, many people experience:</p>
<ul class="text-sm text-amber-800 list-disc pl-5 space-y-1">
<li>More stable energy throughout the day</li>
<li>Improved sleep quality</li>
<li>Reduced anxiety</li>
<li>Better hydration</li>
<li>No more afternoon crashes</li>
<li>Healthier teeth (less staining from coffee/tea)</li>
</ul>
</div>
</div>
</div>
</div>
</div>
<!-- Footer -->
<div class="container mx-auto px-4 py-8 max-w-4xl">
<div class="flex flex-wrap justify-center gap-2 mt-6">
<a href="https://wa.me/?text=Caffeine%20quitting%20tool%20" class="flex items-center bg-amber-100 hover:bg-amber-200 text-amber-800 font-medium py-2 px-4 rounded-full transition">
<i class="fab fa-whatsapp mr-2"></i> Share via WhatsApp
</button>
<a href="#" class="flex items-center bg-amber-100 hover:bg-amber-200 text-amber-800 font-medium py-2 px-4 rounded-full transition">
<i class="fas fa-heart mr-2"></i> Donate
</a>
<a href="#contact" class="flex items-center bg-amber-100 hover:bg-amber-200 text-amber-800 font-medium py-2 px-4 rounded-full transition">
<i class="fas fa-envelope mr-2"></i> Contact
</a>
</div>
</div>
<!-- Donate Page Content (hidden by default) -->
<div id="donate" class="hidden container mx-auto px-4 py-8 max-w-4xl">
<div class="bg-white rounded-lg shadow-md p-6">
<h2 class="text-2xl font-bold text-amber-900 mb-4">Support This Project</h2>
<p class="text-amber-800 mb-4">Running this tool involves costs like web hosting and development time. If you've found it helpful, consider making a donation to help keep it running.</p>
<p class="text-sm text-amber-700">(Donation options will be added here soon)</p>
</div>
</div>
<!-- Contact Page Content (hidden by default) -->
<div id="contact" class="hidden container mx-auto px-4 py-8 max-w-4xl">
<div class="bg-white rounded-lg shadow-md p-6">
<h2 class="text-2xl font-bold text-amber-900 mb-4">Contact</h2>
<p class="text-amber-800 mb-4">Have questions or feedback about this tool? We'd love to hear from you.</p>
<p class="text-sm text-amber-700">(Contact email will be added here soon)</p>
</div>
</div>
<script>
// Simple routing for donate/contact pages
window.addEventListener('hashchange', function() {
const hash = window.location.hash.substring(1);
if (hash === 'donate' || hash === 'contact') {
document.querySelectorAll('.tab-content').forEach(el => el.classList.remove('active'));
document.getElementById(hash).classList.remove('hidden');
}
});
document.addEventListener('DOMContentLoaded', function() {
// Tab switching functionality
const tabButtons = document.querySelectorAll('.tab-btn');
const tabContents = document.querySelectorAll('.tab-content');
tabButtons.forEach(button => {
button.addEventListener('click', () => {
const tabId = button.getAttribute('data-tab');
// Update active tab button
tabButtons.forEach(btn => btn.classList.remove('bg-amber-100'));
button.classList.add('bg-amber-100');
// Show selected tab content
tabContents.forEach(content => {
content.classList.remove('active');
});
document.getElementById(tabId).classList.add('active');
});
});
// Timer functionality
let timerInterval;
let seconds = 0;
let isRunning = false;
// Load saved timer from localStorage
const savedTimer = localStorage.getItem('caffeineFreeTimer');
if (savedTimer) {
const parsed = JSON.parse(savedTimer);
seconds = parsed.seconds;
isRunning = parsed.isRunning;
updateTimerDisplay();
updateProgressStats();
updateBenefitsList();
if (isRunning) {
startTimer();
} else {
updateCircleProgress();
}
}
// Timer elements
const timerDisplay = document.getElementById('timer-display');
const daysDisplay = document.getElementById('days-display');
const startBtn = document.getElementById('start-btn');
const resetBtn = document.getElementById('reset-btn');
const progressCircle = document.querySelector('.progress-ring__circle');
// Set up the progress circle
const radius = progressCircle.r.baseVal.value;
const circumference = radius * 2 * Math.PI;
progressCircle.style.strokeDasharray = circumference;
progressCircle.style.strokeDashoffset = circumference;
function updateCircleProgress() {
const days = Math.floor(seconds / 86400);
const percent = Math.min((days % 7) / 7, 1); // Weekly progress
const offset = circumference - percent * circumference;
progressCircle.style.strokeDashoffset = offset;
}
function startTimer() {
if (!isRunning) {
isRunning = true;
startBtn.innerHTML = '<i class="fas fa-pause mr-2"></i> Pause';
startBtn.classList.remove('bg-amber-600');
startBtn.classList.add('bg-amber-700');
const startTime = Date.now() - (seconds * 1000);
timerInterval = setInterval(() => {
seconds = Math.floor((Date.now() - startTime) / 1000);
updateTimerDisplay();
updateCircleProgress();
updateProgressStats();
updateBenefitsList();
saveTimerState();
}, 1000);
}
}
function pauseTimer() {
if (isRunning) {
isRunning = false;
clearInterval(timerInterval);
startBtn.innerHTML = '<i class="fas fa-play mr-2"></i> Start';
startBtn.classList.remove('bg-amber-700');
startBtn.classList.add('bg-amber-600');
saveTimerState();
}
}
function resetTimer() {
pauseTimer();
seconds = 0;
updateTimerDisplay();
updateCircleProgress();
updateProgressStats();
updateBenefitsList();
saveTimerState();
}
function updateTimerDisplay() {
const days = Math.floor(seconds / 86400);
const hours = Math.floor((seconds % 86400) / 3600);
const minutes = Math.floor((seconds % 3600) / 60);
const secs = seconds % 60;
timerDisplay.textContent =
`${hours.toString().padStart(2, '0')}:${minutes.toString().padStart(2, '0')}:${secs.toString().padStart(2, '0')}`;
daysDisplay.textContent = `${days} day${days !== 1 ? 's' : ''}`;
}
function updateProgressStats() {
const hours = Math.floor(seconds / 3600);
const days = Math.floor(seconds / 86400);
const weeks = Math.floor(days / 7);
const months = Math.floor(days / 30);
document.getElementById('progress-hours').textContent = hours;
document.getElementById('progress-days').textContent = days;
document.getElementById('progress-weeks').textContent = weeks;
document.getElementById('progress-months').textContent = months;
}
function updateBenefitsList() {
const benefitsList = document.getElementById('benefits-list');
benefitsList.innerHTML = '';
const benefits = [
{ threshold: 3600, text: "Caffeine is leaving your system" },
{ threshold: 43200, text: "Withdrawal symptoms may begin" },
{ threshold: 86400, text: "First 24 hours completed!" },
{ threshold: 172800, text: "Peak withdrawal period passing" },
{ threshold: 604800, text: "Most symptoms should be improving" },
{ threshold: 1209600, text: "Your body is adjusting well" },
{ threshold: 2592000, text: "1 month caffeine-free!" },
{ threshold: 7776000, text: "3 months - great job!" },
{ threshold: 15552000, text: "6 months - amazing progress!" },
{ threshold: 31536000, text: "1 year caffeine-free!" }
];
let achievedBenefits = 0;
benefits.forEach(benefit => {
if (seconds >= benefit.threshold) {
benefitsList.innerHTML += `
<div class="flex items-start mb-2">
<i class="fas fa-check text-green-500 mt-1 mr-2"></i>
<span>${benefit.text}</span>
</div>
`;
achievedBenefits++;
}
});
if (achievedBenefits === 0) {
benefitsList.innerHTML = '<p class="text-sm">Start your journey to see benefits appear here!</p>';
}
}
function saveTimerState() {
localStorage.setItem('caffeineFreeTimer', JSON.stringify({
seconds: seconds,
isRunning: isRunning
}));
}
// Event listeners
startBtn.addEventListener('click', function() {
if (isRunning) {
pauseTimer();
} else {
startTimer();
}
});
resetBtn.addEventListener('click', resetTimer);
// Initialize the display
updateTimerDisplay();
updateProgressStats();
updateBenefitsList();
});
</script>
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=satchcouk/decaf" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
</html> |