Please change the share link so instead it says, "Share via WhatsApp" and links to this: https://wa.me/?text=Caffeine%20quitting%20tool%20 and also make the gap to the 3 links at the bottom a lot smaller. And give the Donate link just a hashtag symbol so nothing happens when it's clicked. - Follow Up Deployment
861aaf2 verified Download index.html from satchcouk/decaf: direct link, hf CLI and curl.
- Browser
- Download file 33.3 kB
-
https://huggingface.co/spaces/satchcouk/decaf/resolve/main/index.html
- Command line
-
hf download hf://spaces/satchcouk/decaf/index.html
-
curl -L -o index.html https://huggingface.co/spaces/satchcouk/decaf/resolve/main/index.html
33.3 kB
| <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> |