Download index.html from AImamber/study: direct link, hf CLI and curl.
- Browser
- Download file 32.6 kB
-
https://huggingface.co/spaces/AImamber/study/resolve/main/index.html
- Command line
-
hf download hf://spaces/AImamber/study/index.html
-
curl -L -o index.html https://huggingface.co/spaces/AImamber/study/resolve/main/index.html
32.6 kB
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>StudyFocus - Boost Your Learning</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> | |
| .gradient-bg { | |
| background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); | |
| } | |
| .study-card:hover { | |
| transform: translateY(-5px); | |
| box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04); | |
| } | |
| .pomodoro-active { | |
| animation: pulse 2s infinite; | |
| } | |
| @keyframes pulse { | |
| 0% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4); } | |
| 70% { box-shadow: 0 0 0 10px rgba(99, 102, 241, 0); } | |
| 100% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0); } | |
| } | |
| .progress-ring__circle { | |
| transition: stroke-dashoffset 0.35s; | |
| transform: rotate(-90deg); | |
| transform-origin: 50% 50%; | |
| } | |
| </style> | |
| </head> | |
| <body class="font-sans bg-gray-50"> | |
| <!-- Header --> | |
| <header class="gradient-bg text-white shadow-lg"> | |
| <div class="container mx-auto px-4 py-6"> | |
| <div class="flex justify-between items-center"> | |
| <div class="flex items-center space-x-2"> | |
| <i class="fas fa-graduation-cap text-3xl"></i> | |
| <h1 class="text-2xl font-bold">StudyFocus</h1> | |
| </div> | |
| <nav class="hidden md:flex space-x-8"> | |
| <a href="#features" class="hover:text-gray-200 transition">Features</a> | |
| <a href="#techniques" class="hover:text-gray-200 transition">Techniques</a> | |
| <a href="#timer" class="hover:text-gray-200 transition">Pomodoro</a> | |
| <a href="#resources" class="hover:text-gray-200 transition">Resources</a> | |
| </nav> | |
| <button class="md:hidden text-2xl" id="menu-toggle"> | |
| <i class="fas fa-bars"></i> | |
| </button> | |
| </div> | |
| </div> | |
| </header> | |
| <!-- Mobile Menu --> | |
| <div class="hidden gradient-bg text-white py-4 px-4" id="mobile-menu"> | |
| <div class="flex flex-col space-y-4"> | |
| <a href="#features" class="hover:text-gray-200 transition">Features</a> | |
| <a href="#techniques" class="hover:text-gray-200 transition">Techniques</a> | |
| <a href="#timer" class="hover:text-gray-200 transition">Pomodoro</a> | |
| <a href="#resources" class="hover:text-gray-200 transition">Resources</a> | |
| </div> | |
| </div> | |
| <!-- Hero Section --> | |
| <section class="gradient-bg text-white py-20"> | |
| <div class="container mx-auto px-4 flex flex-col md:flex-row items-center"> | |
| <div class="md:w-1/2 mb-10 md:mb-0"> | |
| <h2 class="text-4xl md:text-5xl font-bold mb-6">Master Your Study Sessions</h2> | |
| <p class="text-xl mb-8">Discover powerful techniques, track your progress, and join a community of motivated learners to achieve academic success.</p> | |
| <div class="flex flex-col sm:flex-row space-y-4 sm:space-y-0 sm:space-x-4"> | |
| <button class="bg-white text-indigo-700 font-bold py-3 px-6 rounded-lg hover:bg-gray-100 transition">Get Started</button> | |
| <button class="border-2 border-white text-white font-bold py-3 px-6 rounded-lg hover:bg-white hover:text-indigo-700 transition">Learn Techniques</button> | |
| </div> | |
| </div> | |
| <div class="md:w-1/2 flex justify-center"> | |
| <img src="https://images.unsplash.com/photo-1434030216411-0b793f4b4173?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1470&q=80" alt="Student studying" class="rounded-lg shadow-2xl max-w-md w-full"> | |
| </div> | |
| </div> | |
| </section> | |
| <!-- Features Section --> | |
| <section id="features" class="py-20 bg-white"> | |
| <div class="container mx-auto px-4"> | |
| <h2 class="text-3xl font-bold text-center mb-16">Powerful Study Features</h2> | |
| <div class="grid md:grid-cols-3 gap-10"> | |
| <!-- Feature 1 --> | |
| <div class="study-card bg-gray-50 p-8 rounded-xl shadow-md transition duration-300"> | |
| <div class="text-indigo-600 mb-4"> | |
| <i class="fas fa-clock text-4xl"></i> | |
| </div> | |
| <h3 class="text-xl font-bold mb-3">Smart Timer</h3> | |
| <p class="text-gray-600">Customizable Pomodoro timer with session tracking to maximize your focus and minimize burnout.</p> | |
| </div> | |
| <!-- Feature 2 --> | |
| <div class="study-card bg-gray-50 p-8 rounded-xl shadow-md transition duration-300"> | |
| <div class="text-indigo-600 mb-4"> | |
| <i class="fas fa-chart-line text-4xl"></i> | |
| </div> | |
| <h3 class="text-xl font-bold mb-3">Progress Tracking</h3> | |
| <p class="text-gray-600">Visualize your study patterns and improvement over time with detailed analytics and reports.</p> | |
| </div> | |
| <!-- Feature 3 --> | |
| <div class="study-card bg-gray-50 p-8 rounded-xl shadow-md transition duration-300"> | |
| <div class="text-indigo-600 mb-4"> | |
| <i class="fas fa-users text-4xl"></i> | |
| </div> | |
| <h3 class="text-xl font-bold mb-3">Study Groups</h3> | |
| <p class="text-gray-600">Connect with fellow learners, share resources, and stay accountable through our community platform.</p> | |
| </div> | |
| </div> | |
| </div> | |
| </section> | |
| <!-- Study Techniques --> | |
| <section id="techniques" class="py-20 bg-gray-50"> | |
| <div class="container mx-auto px-4"> | |
| <h2 class="text-3xl font-bold text-center mb-16">Proven Study Techniques</h2> | |
| <div class="grid md:grid-cols-2 gap-10"> | |
| <!-- Technique 1 --> | |
| <div class="bg-white p-8 rounded-xl shadow-md"> | |
| <div class="flex items-center mb-4"> | |
| <div class="bg-indigo-100 p-3 rounded-full mr-4"> | |
| <i class="fas fa-brain text-indigo-600 text-xl"></i> | |
| </div> | |
| <h3 class="text-xl font-bold">Active Recall</h3> | |
| </div> | |
| <p class="text-gray-600 mb-4">Test yourself on the material you're trying to learn rather than passively reviewing it. This strengthens memory retention.</p> | |
| <div class="bg-indigo-50 p-4 rounded-lg"> | |
| <h4 class="font-semibold text-indigo-800 mb-2">How to practice:</h4> | |
| <ul class="list-disc pl-5 text-gray-700"> | |
| <li class="mb-1">Create flashcards</li> | |
| <li class="mb-1">Close your notes and write down what you remember</li> | |
| <li class="mb-1">Explain concepts out loud without looking</li> | |
| </ul> | |
| </div> | |
| </div> | |
| <!-- Technique 2 --> | |
| <div class="bg-white p-8 rounded-xl shadow-md"> | |
| <div class="flex items-center mb-4"> | |
| <div class="bg-indigo-100 p-3 rounded-full mr-4"> | |
| <i class="fas fa-calendar-alt text-indigo-600 text-xl"></i> | |
| </div> | |
| <h3 class="text-xl font-bold">Spaced Repetition</h3> | |
| </div> | |
| <p class="text-gray-600 mb-4">Review information at increasing intervals to combat the forgetting curve and move knowledge to long-term memory.</p> | |
| <div class="bg-indigo-50 p-4 rounded-lg"> | |
| <h4 class="font-semibold text-indigo-800 mb-2">Implementation:</h4> | |
| <ul class="list-disc pl-5 text-gray-700"> | |
| <li class="mb-1">Review material 1 day after learning</li> | |
| <li class="mb-1">Then again after 3 days</li> | |
| <li class="mb-1">Then after 1 week, 2 weeks, 1 month etc.</li> | |
| </ul> | |
| </div> | |
| </div> | |
| <!-- Technique 3 --> | |
| <div class="bg-white p-8 rounded-xl shadow-md"> | |
| <div class="flex items-center mb-4"> | |
| <div class="bg-indigo-100 p-3 rounded-full mr-4"> | |
| <i class="fas fa-pen-fancy text-indigo-600 text-xl"></i> | |
| </div> | |
| <h3 class="text-xl font-bold">Feynman Technique</h3> | |
| </div> | |
| <p class="text-gray-600 mb-4">Explain concepts in simple terms as if teaching someone else to identify gaps in your understanding.</p> | |
| <div class="bg-indigo-50 p-4 rounded-lg"> | |
| <h4 class="font-semibold text-indigo-800 mb-2">Steps:</h4> | |
| <ul class="list-disc pl-5 text-gray-700"> | |
| <li class="mb-1">Choose a concept to learn</li> | |
| <li class="mb-1">Explain it to a 12-year-old</li> | |
| <li class="mb-1">Identify knowledge gaps</li> | |
| <li class="mb-1">Simplify and use analogies</li> | |
| </ul> | |
| </div> | |
| </div> | |
| <!-- Technique 4 --> | |
| <div class="bg-white p-8 rounded-xl shadow-md"> | |
| <div class="flex items-center mb-4"> | |
| <div class="bg-indigo-100 p-3 rounded-full mr-4"> | |
| <i class="fas fa-layer-group text-indigo-600 text-xl"></i> | |
| </div> | |
| <h3 class="text-xl font-bold">Interleaving</h3> | |
| </div> | |
| <p class="text-gray-600 mb-4">Mix different topics or types of problems during study sessions to improve discrimination between concepts.</p> | |
| <div class="bg-indigo-50 p-4 rounded-lg"> | |
| <h4 class="font-semibold text-indigo-800 mb-2">Example:</h4> | |
| <ul class="list-disc pl-5 text-gray-700"> | |
| <li class="mb-1">Math: Mix algebra, geometry, calculus problems</li> | |
| <li class="mb-1">Language: Alternate vocabulary, grammar, reading</li> | |
| <li class="mb-1">Science: Switch between different topics</li> | |
| </ul> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| </section> | |
| <!-- Pomodoro Timer --> | |
| <section id="timer" class="py-20 bg-white"> | |
| <div class="container mx-auto px-4"> | |
| <h2 class="text-3xl font-bold text-center mb-16">Pomodoro Timer</h2> | |
| <div class="max-w-md mx-auto bg-gray-50 rounded-xl shadow-lg p-8"> | |
| <div class="flex justify-center mb-8"> | |
| <svg class="w-64 h-64" viewBox="0 0 100 100"> | |
| <circle class="text-gray-200" stroke-width="8" stroke="currentColor" fill="transparent" r="40" cx="50" cy="50" /> | |
| <circle class="progress-ring__circle text-indigo-600" stroke-width="8" stroke-linecap="round" stroke="currentColor" fill="transparent" r="40" cx="50" cy="50" id="progress-circle" /> | |
| </svg> | |
| </div> | |
| <div class="text-center mb-8"> | |
| <div id="timer-display" class="text-5xl font-bold mb-4">25:00</div> | |
| <div id="timer-status" class="text-xl font-semibold text-gray-600">Ready to Focus</div> | |
| </div> | |
| <div class="flex justify-center space-x-4"> | |
| <button id="start-btn" class="bg-indigo-600 text-white px-6 py-3 rounded-lg font-semibold hover:bg-indigo-700 transition">Start</button> | |
| <button id="pause-btn" class="bg-gray-200 text-gray-700 px-6 py-3 rounded-lg font-semibold hover:bg-gray-300 transition" disabled>Pause</button> | |
| <button id="reset-btn" class="bg-gray-200 text-gray-700 px-6 py-3 rounded-lg font-semibold hover:bg-gray-300 transition">Reset</button> | |
| </div> | |
| <div class="mt-8 pt-6 border-t border-gray-200"> | |
| <div class="flex justify-between mb-4"> | |
| <span class="font-medium">Focus Duration:</span> | |
| <div class="flex items-center space-x-2"> | |
| <button id="focus-minus" class="w-8 h-8 rounded-full bg-gray-200 flex items-center justify-center">-</button> | |
| <span id="focus-time" class="w-10 text-center">25</span> | |
| <button id="focus-plus" class="w-8 h-8 rounded-full bg-gray-200 flex items-center justify-center">+</button> | |
| </div> | |
| </div> | |
| <div class="flex justify-between"> | |
| <span class="font-medium">Break Duration:</span> | |
| <div class="flex items-center space-x-2"> | |
| <button id="break-minus" class="w-8 h-8 rounded-full bg-gray-200 flex items-center justify-center">-</button> | |
| <span id="break-time" class="w-10 text-center">5</span> | |
| <button id="break-plus" class="w-8 h-8 rounded-full bg-gray-200 flex items-center justify-center">+</button> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| </section> | |
| <!-- Resources Section --> | |
| <section id="resources" class="py-20 bg-gray-50"> | |
| <div class="container mx-auto px-4"> | |
| <h2 class="text-3xl font-bold text-center mb-16">Study Resources</h2> | |
| <div class="grid md:grid-cols-3 gap-8"> | |
| <!-- Resource 1 --> | |
| <div class="bg-white rounded-xl shadow-md overflow-hidden"> | |
| <div class="h-48 bg-indigo-600 flex items-center justify-center"> | |
| <i class="fas fa-book-open text-white text-6xl"></i> | |
| </div> | |
| <div class="p-6"> | |
| <h3 class="text-xl font-bold mb-3">Study Guides</h3> | |
| <p class="text-gray-600 mb-4">Comprehensive guides for various subjects with key concepts, summaries, and practice questions.</p> | |
| <a href="#" class="text-indigo-600 font-semibold hover:underline">Explore Guides →</a> | |
| </div> | |
| </div> | |
| <!-- Resource 2 --> | |
| <div class="bg-white rounded-xl shadow-md overflow-hidden"> | |
| <div class="h-48 bg-indigo-600 flex items-center justify-center"> | |
| <i class="fas fa-video text-white text-6xl"></i> | |
| </div> | |
| <div class="p-6"> | |
| <h3 class="text-xl font-bold mb-3">Video Tutorials</h3> | |
| <p class="text-gray-600 mb-4">Curated collection of the best educational videos from top instructors worldwide.</p> | |
| <a href="#" class="text-indigo-600 font-semibold hover:underline">Watch Videos →</a> | |
| </div> | |
| </div> | |
| <!-- Resource 3 --> | |
| <div class="bg-white rounded-xl shadow-md overflow-hidden"> | |
| <div class="h-48 bg-indigo-600 flex items-center justify-center"> | |
| <i class="fas fa-headphones text-white text-6xl"></i> | |
| </div> | |
| <div class="p-6"> | |
| <h3 class="text-xl font-bold mb-3">Focus Music</h3> | |
| <p class="text-gray-600 mb-4">Specially designed playlists to enhance concentration and block distractions.</p> | |
| <a href="#" class="text-indigo-600 font-semibold hover:underline">Listen Now →</a> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| </section> | |
| <!-- Testimonials --> | |
| <section class="py-20 bg-white"> | |
| <div class="container mx-auto px-4"> | |
| <h2 class="text-3xl font-bold text-center mb-16">Success Stories</h2> | |
| <div class="grid md:grid-cols-2 gap-10"> | |
| <!-- Testimonial 1 --> | |
| <div class="bg-gray-50 p-8 rounded-xl"> | |
| <div class="flex items-center mb-4"> | |
| <div class="w-12 h-12 rounded-full bg-indigo-600 flex items-center justify-center text-white font-bold text-xl mr-4">S</div> | |
| <div> | |
| <h4 class="font-bold">Sarah J.</h4> | |
| <p class="text-gray-600">Medical Student</p> | |
| </div> | |
| </div> | |
| <p class="text-gray-700 italic">"The Pomodoro timer and spaced repetition techniques helped me memorize thousands of medical terms. My exam scores improved by 30%!"</p> | |
| <div class="mt-4 text-yellow-400"> | |
| <i class="fas fa-star"></i> | |
| <i class="fas fa-star"></i> | |
| <i class="fas fa-star"></i> | |
| <i class="fas fa-star"></i> | |
| <i class="fas fa-star"></i> | |
| </div> | |
| </div> | |
| <!-- Testimonial 2 --> | |
| <div class="bg-gray-50 p-8 rounded-xl"> | |
| <div class="flex items-center mb-4"> | |
| <div class="w-12 h-12 rounded-full bg-indigo-600 flex items-center justify-center text-white font-bold text-xl mr-4">M</div> | |
| <div> | |
| <h4 class="font-bold">Michael T.</h4> | |
| <p class="text-gray-600">Engineering Student</p> | |
| </div> | |
| </div> | |
| <p class="text-gray-700 italic">"I was struggling with calculus until I discovered the Feynman technique through StudyFocus. Being able to explain concepts simply made all the difference."</p> | |
| <div class="mt-4 text-yellow-400"> | |
| <i class="fas fa-star"></i> | |
| <i class="fas fa-star"></i> | |
| <i class="fas fa-star"></i> | |
| <i class="fas fa-star"></i> | |
| <i class="fas fa-star-half-alt"></i> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| </section> | |
| <!-- CTA Section --> | |
| <section class="gradient-bg text-white py-16"> | |
| <div class="container mx-auto px-4 text-center"> | |
| <h2 class="text-3xl font-bold mb-6">Ready to Transform Your Study Habits?</h2> | |
| <p class="text-xl mb-8 max-w-2xl mx-auto">Join thousands of students who have improved their focus, retention, and academic performance.</p> | |
| <button class="bg-white text-indigo-700 font-bold py-3 px-8 rounded-lg hover:bg-gray-100 transition text-lg">Start Your Free Trial</button> | |
| </div> | |
| </section> | |
| <!-- Footer --> | |
| <footer class="bg-gray-900 text-white py-12"> | |
| <div class="container mx-auto px-4"> | |
| <div class="grid md:grid-cols-4 gap-8"> | |
| <div> | |
| <div class="flex items-center space-x-2 mb-4"> | |
| <i class="fas fa-graduation-cap text-2xl"></i> | |
| <h3 class="text-xl font-bold">StudyFocus</h3> | |
| </div> | |
| <p class="text-gray-400">Empowering students with science-backed study techniques and tools for academic success.</p> | |
| </div> | |
| <div> | |
| <h4 class="text-lg font-semibold mb-4">Quick Links</h4> | |
| <ul class="space-y-2"> | |
| <li><a href="#" class="text-gray-400 hover:text-white transition">Home</a></li> | |
| <li><a href="#features" class="text-gray-400 hover:text-white transition">Features</a></li> | |
| <li><a href="#techniques" class="text-gray-400 hover:text-white transition">Techniques</a></li> | |
| <li><a href="#resources" class="text-gray-400 hover:text-white transition">Resources</a></li> | |
| </ul> | |
| </div> | |
| <div> | |
| <h4 class="text-lg font-semibold mb-4">Support</h4> | |
| <ul class="space-y-2"> | |
| <li><a href="#" class="text-gray-400 hover:text-white transition">FAQ</a></li> | |
| <li><a href="#" class="text-gray-400 hover:text-white transition">Contact Us</a></li> | |
| <li><a href="#" class="text-gray-400 hover:text-white transition">Privacy Policy</a></li> | |
| <li><a href="#" class="text-gray-400 hover:text-white transition">Terms of Service</a></li> | |
| </ul> | |
| </div> | |
| <div> | |
| <h4 class="text-lg font-semibold mb-4">Connect With Us</h4> | |
| <div class="flex space-x-4 mb-4"> | |
| <a href="#" class="w-10 h-10 rounded-full bg-gray-800 flex items-center justify-center hover:bg-indigo-600 transition"> | |
| <i class="fab fa-facebook-f"></i> | |
| </a> | |
| <a href="#" class="w-10 h-10 rounded-full bg-gray-800 flex items-center justify-center hover:bg-indigo-600 transition"> | |
| <i class="fab fa-twitter"></i> | |
| </a> | |
| <a href="#" class="w-10 h-10 rounded-full bg-gray-800 flex items-center justify-center hover:bg-indigo-600 transition"> | |
| <i class="fab fa-instagram"></i> | |
| </a> | |
| <a href="#" class="w-10 h-10 rounded-full bg-gray-800 flex items-center justify-center hover:bg-indigo-600 transition"> | |
| <i class="fab fa-youtube"></i> | |
| </a> | |
| </div> | |
| <p class="text-gray-400">Subscribe to our newsletter for study tips and updates.</p> | |
| <div class="mt-3 flex"> | |
| <input type="email" placeholder="Your email" class="bg-gray-800 text-white px-4 py-2 rounded-l-lg focus:outline-none w-full"> | |
| <button class="bg-indigo-600 px-4 py-2 rounded-r-lg hover:bg-indigo-700 transition"> | |
| <i class="fas fa-paper-plane"></i> | |
| </button> | |
| </div> | |
| </div> | |
| </div> | |
| <div class="border-t border-gray-800 mt-12 pt-8 text-center text-gray-400"> | |
| <p>© 2023 StudyFocus. All rights reserved.</p> | |
| </div> | |
| </div> | |
| </footer> | |
| <script> | |
| // Mobile menu toggle | |
| document.getElementById('menu-toggle').addEventListener('click', function() { | |
| const menu = document.getElementById('mobile-menu'); | |
| menu.classList.toggle('hidden'); | |
| }); | |
| // Pomodoro Timer Functionality | |
| let timer; | |
| let totalSeconds = 25 * 60; | |
| let isRunning = false; | |
| let isBreak = false; | |
| let focusTime = 25; | |
| let breakTime = 5; | |
| const timerDisplay = document.getElementById('timer-display'); | |
| const timerStatus = document.getElementById('timer-status'); | |
| const startBtn = document.getElementById('start-btn'); | |
| const pauseBtn = document.getElementById('pause-btn'); | |
| const resetBtn = document.getElementById('reset-btn'); | |
| const focusTimeDisplay = document.getElementById('focus-time'); | |
| const breakTimeDisplay = document.getElementById('break-time'); | |
| const progressCircle = document.getElementById('progress-circle'); | |
| const circle = document.querySelector('.progress-ring__circle'); | |
| const radius = circle.r.baseVal.value; | |
| const circumference = 2 * Math.PI * radius; | |
| circle.style.strokeDasharray = circumference; | |
| circle.style.strokeDashoffset = circumference; | |
| function updateTimerDisplay() { | |
| const minutes = Math.floor(totalSeconds / 60); | |
| const seconds = totalSeconds % 60; | |
| timerDisplay.textContent = `${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}`; | |
| // Update progress circle | |
| const offset = circumference - (totalSeconds / (isBreak ? breakTime * 60 : focusTime * 60)) * circumference; | |
| circle.style.strokeDashoffset = offset; | |
| } | |
| function startTimer() { | |
| if (!isRunning) { | |
| isRunning = true; | |
| startBtn.disabled = true; | |
| pauseBtn.disabled = false; | |
| startBtn.classList.remove('bg-indigo-600', 'hover:bg-indigo-700'); | |
| startBtn.classList.add('bg-gray-400', 'cursor-not-allowed'); | |
| pauseBtn.classList.remove('bg-gray-200', 'hover:bg-gray-300'); | |
| pauseBtn.classList.add('bg-indigo-600', 'hover:bg-indigo-700', 'text-white'); | |
| if (!isBreak) { | |
| timerStatus.textContent = 'Focus Time'; | |
| document.querySelector('.progress-ring__circle').classList.add('text-indigo-600'); | |
| document.querySelector('.progress-ring__circle').classList.remove('text-green-500'); | |
| } else { | |
| timerStatus.textContent = 'Break Time'; | |
| document.querySelector('.progress-ring__circle').classList.add('text-green-500'); | |
| document.querySelector('.progress-ring__circle').classList.remove('text-indigo-600'); | |
| } | |
| timer = setInterval(function() { | |
| totalSeconds--; | |
| updateTimerDisplay(); | |
| if (totalSeconds <= 0) { | |
| clearInterval(timer); | |
| isRunning = false; | |
| // Play sound | |
| const audio = new Audio('https://assets.mixkit.co/sfx/preview/mixkit-alarm-digital-clock-beep-989.mp3'); | |
| audio.play(); | |
| // Switch between focus and break | |
| isBreak = !isBreak; | |
| if (isBreak) { | |
| totalSeconds = breakTime * 60; | |
| timerStatus.textContent = 'Break Time!'; | |
| document.querySelector('.progress-ring__circle').classList.add('text-green-500'); | |
| document.querySelector('.progress-ring__circle').classList.remove('text-indigo-600'); | |
| } else { | |
| totalSeconds = focusTime * 60; | |
| timerStatus.textContent = 'Focus Time'; | |
| document.querySelector('.progress-ring__circle').classList.add('text-indigo-600'); | |
| document.querySelector('.progress-ring__circle').classList.remove('text-green-500'); | |
| } | |
| startBtn.disabled = false; | |
| pauseBtn.disabled = true; | |
| startBtn.textContent = 'Start'; | |
| startBtn.classList.remove('bg-gray-400', 'cursor-not-allowed'); | |
| startBtn.classList.add('bg-indigo-600', 'hover:bg-indigo-700'); | |
| pauseBtn.classList.remove('bg-indigo-600', 'hover:bg-indigo-700', 'text-white'); | |
| pauseBtn.classList.add('bg-gray-200', 'hover:bg-gray-300'); | |
| updateTimerDisplay(); | |
| } | |
| }, 1000); | |
| } | |
| } | |
| function pauseTimer() { | |
| if (isRunning) { | |
| clearInterval(timer); | |
| isRunning = false; | |
| startBtn.disabled = false; | |
| pauseBtn.disabled = true; | |
| startBtn.textContent = 'Resume'; | |
| startBtn.classList.remove('bg-gray-400', 'cursor-not-allowed'); | |
| startBtn.classList.add('bg-indigo-600', 'hover:bg-indigo-700'); | |
| pauseBtn.classList.remove('bg-indigo-600', 'hover:bg-indigo-700', 'text-white'); | |
| pauseBtn.classList.add('bg-gray-200', 'hover:bg-gray-300'); | |
| timerStatus.textContent = 'Paused'; | |
| } | |
| } | |
| function resetTimer() { | |
| clearInterval(timer); | |
| isRunning = false; | |
| isBreak = false; | |
| totalSeconds = focusTime * 60; | |
| startBtn.disabled = false; | |
| pauseBtn.disabled = true; | |
| startBtn.textContent = 'Start'; | |
| startBtn.classList.remove('bg-gray-400', 'cursor-not-allowed'); | |
| startBtn.classList.add('bg-indigo-600', 'hover:bg-indigo-700'); | |
| pauseBtn.classList.remove('bg-indigo-600', 'hover:bg-indigo-700', 'text-white'); | |
| pauseBtn.classList.add('bg-gray-200', 'hover:bg-gray-300'); | |
| timerStatus.textContent = 'Ready to Focus'; | |
| document.querySelector('.progress-ring__circle').classList.add('text-indigo-600'); | |
| document.querySelector('.progress-ring__circle').classList.remove('text-green-500'); | |
| updateTimerDisplay(); | |
| } | |
| // Event Listeners | |
| startBtn.addEventListener('click', startTimer); | |
| pauseBtn.addEventListener('click', pauseTimer); | |
| resetBtn.addEventListener('click', resetTimer); | |
| // Timer Settings | |
| document.getElementById('focus-plus').addEventListener('click', function() { | |
| if (focusTime < 60) { | |
| focusTime++; | |
| focusTimeDisplay.textContent = focusTime; | |
| if (!isRunning && !isBreak) { | |
| totalSeconds = focusTime * 60; | |
| updateTimerDisplay(); | |
| } | |
| } | |
| }); | |
| document.getElementById('focus-minus').addEventListener('click', function() { | |
| if (focusTime > 1) { | |
| focusTime--; | |
| focusTimeDisplay.textContent = focusTime; | |
| if (!isRunning && !isBreak) { | |
| totalSeconds = focusTime * 60; | |
| updateTimerDisplay(); | |
| } | |
| } | |
| }); | |
| document.getElementById('break-plus').addEventListener('click', function() { | |
| if (breakTime < 30) { | |
| breakTime++; | |
| breakTimeDisplay.textContent = breakTime; | |
| if (!isRunning && isBreak) { | |
| totalSeconds = breakTime * 60; | |
| updateTimerDisplay(); | |
| } | |
| } | |
| }); | |
| document.getElementById('break-minus').addEventListener('click', function() { | |
| if (breakTime > 1) { | |
| breakTime--; | |
| breakTimeDisplay.textContent = breakTime; | |
| if (!isRunning && isBreak) { | |
| totalSeconds = breakTime * 60; | |
| updateTimerDisplay(); | |
| } | |
| } | |
| }); | |
| // Initialize timer display | |
| updateTimerDisplay(); | |
| </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=AImamber/study" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body> | |
| </html> |