Spaces:
Running
Running
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>StudyBuddy - Exam Preparation App</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> | |
| @import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap'); | |
| body { | |
| font-family: 'Poppins', sans-serif; | |
| background-color: #f8fafc; | |
| } | |
| .gradient-bg { | |
| background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); | |
| } | |
| .card-hover: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); | |
| } | |
| .flashcard { | |
| perspective: 1000px; | |
| height: 300px; | |
| } | |
| .flashcard-inner { | |
| position: relative; | |
| width: 100%; | |
| height: 100%; | |
| transition: transform 0.6s; | |
| transform-style: preserve-3d; | |
| } | |
| .flashcard.flipped .flashcard-inner { | |
| transform: rotateY(180deg); | |
| } | |
| .flashcard-front, .flashcard-back { | |
| position: absolute; | |
| width: 100%; | |
| height: 100%; | |
| backface-visibility: hidden; | |
| border-radius: 0.5rem; | |
| padding: 1.5rem; | |
| display: flex; | |
| flex-direction: column; | |
| justify-content: center; | |
| align-items: center; | |
| } | |
| .flashcard-back { | |
| transform: rotateY(180deg); | |
| } | |
| .progress-ring__circle { | |
| transition: stroke-dashoffset 0.35s; | |
| transform: rotate(-90deg); | |
| transform-origin: 50% 50%; | |
| } | |
| .timer-display { | |
| font-family: 'Courier New', monospace; | |
| } | |
| .sidebar { | |
| transition: all 0.3s ease; | |
| } | |
| @media (max-width: 768px) { | |
| .sidebar { | |
| position: fixed; | |
| left: -100%; | |
| top: 0; | |
| z-index: 50; | |
| height: 100vh; | |
| } | |
| .sidebar.active { | |
| left: 0; | |
| } | |
| .overlay { | |
| position: fixed; | |
| top: 0; | |
| left: 0; | |
| right: 0; | |
| bottom: 0; | |
| background-color: rgba(0, 0, 0, 0.5); | |
| z-index: 40; | |
| display: none; | |
| } | |
| .overlay.active { | |
| display: block; | |
| } | |
| } | |
| </style> | |
| </head> | |
| <body class="min-h-screen"> | |
| <!-- Mobile Menu Button --> | |
| <button id="mobile-menu-button" class="md:hidden fixed top-4 left-4 z-50 bg-white p-2 rounded-full shadow-lg"> | |
| <i class="fas fa-bars text-indigo-600"></i> | |
| </button> | |
| <!-- Overlay for mobile menu --> | |
| <div id="overlay" class="overlay"></div> | |
| <!-- Sidebar --> | |
| <div id="sidebar" class="sidebar w-64 bg-white shadow-lg fixed h-full"> | |
| <div class="p-4 flex items-center justify-between border-b"> | |
| <div class="flex items-center"> | |
| <i class="fas fa-graduation-cap text-indigo-600 text-2xl mr-2"></i> | |
| <span class="text-xl font-bold text-indigo-600">StudyBuddy</span> | |
| </div> | |
| <button id="close-sidebar" class="md:hidden text-gray-500 hover:text-gray-700"> | |
| <i class="fas fa-times"></i> | |
| </button> | |
| </div> | |
| <nav class="p-4"> | |
| <ul> | |
| <li class="mb-2"> | |
| <a href="#" class="flex items-center p-2 rounded-lg bg-indigo-50 text-indigo-600"> | |
| <i class="fas fa-home mr-3"></i> | |
| <span>Dashboard</span> | |
| </a> | |
| </li> | |
| <li class="mb-2"> | |
| <a href="#flashcards" class="flex items-center p-2 rounded-lg hover:bg-indigo-50 hover:text-indigo-600 text-gray-700"> | |
| <i class="fas fa-layer-group mr-3"></i> | |
| <span>Flashcards</span> | |
| </a> | |
| </li> | |
| <li class="mb-2"> | |
| <a href="#pomodoro" class="flex items-center p-2 rounded-lg hover:bg-indigo-50 hover:text-indigo-600 text-gray-700"> | |
| <i class="fas fa-clock mr-3"></i> | |
| <span>Study Timer</span> | |
| </a> | |
| </li> | |
| <li class="mb-2"> | |
| <a href="#progress" class="flex items-center p-2 rounded-lg hover:bg-indigo-50 hover:text-indigo-600 text-gray-700"> | |
| <i class="fas fa-chart-line mr-3"></i> | |
| <span>Progress</span> | |
| </a> | |
| </li> | |
| <li class="mb-2"> | |
| <a href="#resources" class="flex items-center p-2 rounded-lg hover:bg-indigo-50 hover:text-indigo-600 text-gray-700"> | |
| <i class="fas fa-book mr-3"></i> | |
| <span>Resources</span> | |
| </a> | |
| </li> | |
| <li class="mb-2"> | |
| <a href="#settings" class="flex items-center p-2 rounded-lg hover:bg-indigo-50 hover:text-indigo-600 text-gray-700"> | |
| <i class="fas fa-cog mr-3"></i> | |
| <span>Settings</span> | |
| </a> | |
| </li> | |
| </ul> | |
| </nav> | |
| <div class="absolute bottom-0 w-full p-4 border-t"> | |
| <div class="flex items-center"> | |
| <div class="w-10 h-10 rounded-full bg-indigo-100 flex items-center justify-center mr-3"> | |
| <i class="fas fa-user text-indigo-600"></i> | |
| </div> | |
| <div> | |
| <p class="font-medium">Student User</p> | |
| <p class="text-xs text-gray-500">Premium Member</p> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| <!-- Main Content --> | |
| <div class="md:ml-64"> | |
| <!-- Header --> | |
| <header class="gradient-bg text-white p-4 shadow-md"> | |
| <div class="container mx-auto flex justify-between items-center"> | |
| <h1 class="text-2xl font-bold">Exam Preparation Dashboard</h1> | |
| <div class="flex items-center space-x-4"> | |
| <div class="relative"> | |
| <i class="fas fa-bell text-xl"></i> | |
| <span class="absolute -top-1 -right-1 w-4 h-4 bg-red-500 rounded-full text-xs flex items-center justify-center">3</span> | |
| </div> | |
| <div class="w-8 h-8 rounded-full bg-white flex items-center justify-center"> | |
| <i class="fas fa-user text-indigo-600"></i> | |
| </div> | |
| </div> | |
| </div> | |
| </header> | |
| <!-- Dashboard Content --> | |
| <main class="container mx-auto p-4"> | |
| <!-- Welcome Banner --> | |
| <div class="bg-white rounded-xl shadow-md p-6 mb-6 relative overflow-hidden"> | |
| <div class="absolute -right-10 -top-10 w-32 h-32 bg-indigo-100 rounded-full"></div> | |
| <div class="relative z-10"> | |
| <h2 class="text-2xl font-bold text-gray-800 mb-2">Welcome back, Student!</h2> | |
| <p class="text-gray-600 mb-4">Your next exam is in <span class="font-bold text-indigo-600">14 days</span>. Let's make the most of your study time.</p> | |
| <div class="w-full bg-gray-200 rounded-full h-2.5"> | |
| <div class="bg-indigo-600 h-2.5 rounded-full" style="width: 45%"></div> | |
| </div> | |
| <p class="text-sm text-gray-500 mt-2">45% of your study plan completed</p> | |
| </div> | |
| </div> | |
| <!-- Quick Stats --> | |
| <div class="grid grid-cols-1 md:grid-cols-3 gap-4 mb-6"> | |
| <div class="bg-white rounded-xl shadow-md p-6 flex items-center card-hover transition-all duration-300"> | |
| <div class="w-12 h-12 rounded-full bg-green-100 flex items-center justify-center mr-4"> | |
| <i class="fas fa-check text-green-600 text-xl"></i> | |
| </div> | |
| <div> | |
| <p class="text-gray-500">Completed Topics</p> | |
| <p class="text-2xl font-bold">18/32</p> | |
| </div> | |
| </div> | |
| <div class="bg-white rounded-xl shadow-md p-6 flex items-center card-hover transition-all duration-300"> | |
| <div class="w-12 h-12 rounded-full bg-blue-100 flex items-center justify-center mr-4"> | |
| <i class="fas fa-clock text-blue-600 text-xl"></i> | |
| </div> | |
| <div> | |
| <p class="text-gray-500">Study Hours</p> | |
| <p class="text-2xl font-bold">24.5h</p> | |
| </div> | |
| </div> | |
| <div class="bg-white rounded-xl shadow-md p-6 flex items-center card-hover transition-all duration-300"> | |
| <div class="w-12 h-12 rounded-full bg-purple-100 flex items-center justify-center mr-4"> | |
| <i class="fas fa-star text-purple-600 text-xl"></i> | |
| </div> | |
| <div> | |
| <p class="text-gray-500">Performance</p> | |
| <p class="text-2xl font-bold">82%</p> | |
| </div> | |
| </div> | |
| </div> | |
| <!-- Flashcards Section --> | |
| <section id="flashcards" class="mb-8"> | |
| <div class="flex justify-between items-center mb-4"> | |
| <h2 class="text-xl font-bold text-gray-800">Flashcards</h2> | |
| <button id="add-flashcard" class="bg-indigo-600 text-white px-4 py-2 rounded-lg hover:bg-indigo-700 transition"> | |
| <i class="fas fa-plus mr-2"></i> Add New | |
| </button> | |
| </div> | |
| <div class="bg-white rounded-xl shadow-md p-6"> | |
| <div class="flex justify-between mb-4"> | |
| <div> | |
| <h3 class="font-medium">Biology Flashcards</h3> | |
| <p class="text-sm text-gray-500">Chapter 3: Cell Structure</p> | |
| </div> | |
| <div class="flex space-x-2"> | |
| <button class="p-2 rounded-full hover:bg-gray-100"> | |
| <i class="fas fa-chevron-left text-gray-500"></i> | |
| </button> | |
| <button class="p-2 rounded-full hover:bg-gray-100"> | |
| <i class="fas fa-chevron-right text-gray-500"></i> | |
| </button> | |
| </div> | |
| </div> | |
| <div class="flashcard bg-indigo-50 rounded-lg mb-4 cursor-pointer" onclick="this.classList.toggle('flipped')"> | |
| <div class="flashcard-inner"> | |
| <div class="flashcard-front flex flex-col items-center justify-center"> | |
| <p class="text-gray-500 mb-2">Question</p> | |
| <h3 class="text-xl font-bold text-center">What is the powerhouse of the cell?</h3> | |
| </div> | |
| <div class="flashcard-back bg-white flex flex-col items-center justify-center"> | |
| <p class="text-gray-500 mb-2">Answer</p> | |
| <h3 class="text-xl font-bold text-center">Mitochondria</h3> | |
| <div class="mt-4 flex space-x-2"> | |
| <button class="px-3 py-1 bg-green-100 text-green-600 rounded-full text-sm">Easy</button> | |
| <button class="px-3 py-1 bg-yellow-100 text-yellow-600 rounded-full text-sm">Medium</button> | |
| <button class="px-3 py-1 bg-red-100 text-red-600 rounded-full text-sm">Hard</button> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| <div class="flex justify-between items-center"> | |
| <div class="text-sm text-gray-500">Card 5/12</div> | |
| <div class="flex space-x-2"> | |
| <button class="p-2 rounded-full bg-indigo-100 text-indigo-600"> | |
| <i class="fas fa-check"></i> | |
| </button> | |
| <button class="p-2 rounded-full bg-indigo-100 text-indigo-600"> | |
| <i class="fas fa-edit"></i> | |
| </button> | |
| <button class="p-2 rounded-full bg-indigo-100 text-indigo-600"> | |
| <i class="fas fa-trash"></i> | |
| </button> | |
| </div> | |
| </div> | |
| </div> | |
| </section> | |
| <!-- Study Timer Section --> | |
| <section id="pomodoro" class="mb-8"> | |
| <h2 class="text-xl font-bold text-gray-800 mb-4">Study Timer</h2> | |
| <div class="bg-white rounded-xl shadow-md p-6"> | |
| <div class="flex flex-col md:flex-row items-center"> | |
| <div class="md:w-1/2 mb-6 md:mb-0"> | |
| <div class="relative w-48 h-48 mx-auto"> | |
| <svg class="w-full h-full" viewBox="0 0 100 100"> | |
| <circle cx="50" cy="50" r="45" fill="none" stroke="#e6e6e6" stroke-width="8"/> | |
| <circle id="progress-circle" cx="50" cy="50" r="45" fill="none" stroke="#667eea" stroke-width="8" stroke-dasharray="283" stroke-dashoffset="0" class="progress-ring__circle"/> | |
| </svg> | |
| <div class="absolute inset-0 flex items-center justify-center flex-col"> | |
| <div id="timer-display" class="timer-display text-3xl font-bold mb-1">25:00</div> | |
| <div id="timer-status" class="text-gray-500">Ready to study</div> | |
| </div> | |
| </div> | |
| </div> | |
| <div class="md:w-1/2"> | |
| <div class="flex justify-center space-x-4 mb-6"> | |
| <button data-minutes="25" class="timer-option px-4 py-2 rounded-lg border border-indigo-200 text-indigo-600 hover:bg-indigo-50">Pomodoro</button> | |
| <button data-minutes="10" class="timer-option px-4 py-2 rounded-lg border border-gray-200 text-gray-600 hover:bg-gray-50">Short Break</button> | |
| <button data-minutes="30" class="timer-option px-4 py-2 rounded-lg border border-gray-200 text-gray-600 hover:bg-gray-50">Long Break</button> | |
| </div> | |
| <div class="flex justify-center space-x-4"> | |
| <button id="start-timer" class="bg-indigo-600 text-white px-6 py-2 rounded-lg hover:bg-indigo-700 transition"> | |
| <i class="fas fa-play mr-2"></i> Start | |
| </button> | |
| <button id="pause-timer" class="bg-white text-indigo-600 px-6 py-2 rounded-lg border border-indigo-200 hover:bg-indigo-50 transition hidden"> | |
| <i class="fas fa-pause mr-2"></i> Pause | |
| </button> | |
| <button id="reset-timer" class="bg-white text-gray-600 px-6 py-2 rounded-lg border border-gray-200 hover:bg-gray-50 transition"> | |
| <i class="fas fa-redo mr-2"></i> Reset | |
| </button> | |
| </div> | |
| <div class="mt-6"> | |
| <h4 class="font-medium mb-2">Today's Sessions</h4> | |
| <div class="flex space-x-2"> | |
| <div class="w-8 h-8 rounded-full bg-indigo-100 flex items-center justify-center text-indigo-600">1</div> | |
| <div class="w-8 h-8 rounded-full bg-indigo-100 flex items-center justify-center text-indigo-600">2</div> | |
| <div class="w-8 h-8 rounded-full bg-indigo-100 flex items-center justify-center text-indigo-600">3</div> | |
| <div class="w-8 h-8 rounded-full bg-gray-100 flex items-center justify-center text-gray-400">4</div> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| </section> | |
| <!-- Progress Tracking --> | |
| <section id="progress" class="mb-8"> | |
| <h2 class="text-xl font-bold text-gray-800 mb-4">Your Progress</h2> | |
| <div class="grid grid-cols-1 md:grid-cols-2 gap-4"> | |
| <div class="bg-white rounded-xl shadow-md p-6"> | |
| <div class="flex justify-between items-center mb-4"> | |
| <h3 class="font-medium">Study Hours</h3> | |
| <select class="border border-gray-200 rounded-lg px-3 py-1 text-sm"> | |
| <option>This Week</option> | |
| <option>Last Week</option> | |
| <option>This Month</option> | |
| </select> | |
| </div> | |
| <div class="h-64"> | |
| <canvas id="study-hours-chart"></canvas> | |
| </div> | |
| </div> | |
| <div class="bg-white rounded-xl shadow-md p-6"> | |
| <div class="flex justify-between items-center mb-4"> | |
| <h3 class="font-medium">Topic Mastery</h3> | |
| <select class="border border-gray-200 rounded-lg px-3 py-1 text-sm"> | |
| <option>All Subjects</option> | |
| <option>Biology</option> | |
| <option>Chemistry</option> | |
| <option>Physics</option> | |
| </select> | |
| </div> | |
| <div class="h-64"> | |
| <canvas id="mastery-chart"></canvas> | |
| </div> | |
| </div> | |
| </div> | |
| </section> | |
| <!-- Resources Section --> | |
| <section id="resources" class="mb-8"> | |
| <h2 class="text-xl font-bold text-gray-800 mb-4">Study Resources</h2> | |
| <div class="grid grid-cols-1 md:grid-cols-3 gap-4"> | |
| <div class="bg-white rounded-xl shadow-md overflow-hidden card-hover transition-all duration-300"> | |
| <div class="h-40 bg-indigo-100 flex items-center justify-center"> | |
| <i class="fas fa-book-open text-indigo-600 text-5xl"></i> | |
| </div> | |
| <div class="p-4"> | |
| <h3 class="font-bold mb-2">Biology Textbook</h3> | |
| <p class="text-sm text-gray-500 mb-3">Chapter summaries and key concepts</p> | |
| <button class="w-full bg-indigo-600 text-white py-2 rounded-lg hover:bg-indigo-700 transition"> | |
| Open Resource | |
| </button> | |
| </div> | |
| </div> | |
| <div class="bg-white rounded-xl shadow-md overflow-hidden card-hover transition-all duration-300"> | |
| <div class="h-40 bg-blue-100 flex items-center justify-center"> | |
| <i class="fas fa-video text-blue-600 text-5xl"></i> | |
| </div> | |
| <div class="p-4"> | |
| <h3 class="font-bold mb-2">Video Lectures</h3> | |
| <p class="text-sm text-gray-500 mb-3">Comprehensive topic explanations</p> | |
| <button class="w-full bg-blue-600 text-white py-2 rounded-lg hover:bg-blue-700 transition"> | |
| Watch Videos | |
| </button> | |
| </div> | |
| </div> | |
| <div class="bg-white rounded-xl shadow-md overflow-hidden card-hover transition-all duration-300"> | |
| <div class="h-40 bg-purple-100 flex items-center justify-center"> | |
| <i class="fas fa-file-alt text-purple-600 text-5xl"></i> | |
| </div> | |
| <div class="p-4"> | |
| <h3 class="font-bold mb-2">Past Papers</h3> | |
| <p class="text-sm text-gray-500 mb-3">Practice with real exam questions</p> | |
| <button class="w-full bg-purple-600 text-white py-2 rounded-lg hover:bg-purple-700 transition"> | |
| Download | |
| </button> | |
| </div> | |
| </div> | |
| </div> | |
| </section> | |
| </main> | |
| </div> | |
| <!-- Add Flashcard Modal --> | |
| <div id="flashcard-modal" class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 hidden"> | |
| <div class="bg-white rounded-xl p-6 w-full max-w-md"> | |
| <div class="flex justify-between items-center mb-4"> | |
| <h3 class="text-lg font-bold">Add New Flashcard</h3> | |
| <button id="close-modal" class="text-gray-500 hover:text-gray-700"> | |
| <i class="fas fa-times"></i> | |
| </button> | |
| </div> | |
| <form id="flashcard-form"> | |
| <div class="mb-4"> | |
| <label class="block text-gray-700 mb-2">Subject</label> | |
| <select class="w-full border border-gray-200 rounded-lg px-4 py-2"> | |
| <option>Biology</option> | |
| <option>Chemistry</option> | |
| <option>Physics</option> | |
| <option>Mathematics</option> | |
| </select> | |
| </div> | |
| <div class="mb-4"> | |
| <label class="block text-gray-700 mb-2">Chapter/Topic</label> | |
| <input type="text" class="w-full border border-gray-200 rounded-lg px-4 py-2" placeholder="E.g. Cell Structure"> | |
| </div> | |
| <div class="mb-4"> | |
| <label class="block text-gray-700 mb-2">Question</label> | |
| <textarea class="w-full border border-gray-200 rounded-lg px-4 py-2" rows="2" placeholder="Enter your question"></textarea> | |
| </div> | |
| <div class="mb-4"> | |
| <label class="block text-gray-700 mb-2">Answer</label> | |
| <textarea class="w-full border border-gray-200 rounded-lg px-4 py-2" rows="3" placeholder="Enter the answer"></textarea> | |
| </div> | |
| <div class="flex justify-end space-x-3"> | |
| <button type="button" id="cancel-flashcard" class="px-4 py-2 border border-gray-200 rounded-lg hover:bg-gray-50">Cancel</button> | |
| <button type="submit" class="px-4 py-2 bg-indigo-600 text-white rounded-lg hover:bg-indigo-700">Save Flashcard</button> | |
| </div> | |
| </form> | |
| </div> | |
| </div> | |
| <script src="https://cdn.jsdelivr.net/npm/chart.js"></script> | |
| <script> | |
| // Mobile menu toggle | |
| const mobileMenuButton = document.getElementById('mobile-menu-button'); | |
| const closeSidebarButton = document.getElementById('close-sidebar'); | |
| const sidebar = document.getElementById('sidebar'); | |
| const overlay = document.getElementById('overlay'); | |
| mobileMenuButton.addEventListener('click', () => { | |
| sidebar.classList.add('active'); | |
| overlay.classList.add('active'); | |
| }); | |
| closeSidebarButton.addEventListener('click', () => { | |
| sidebar.classList.remove('active'); | |
| overlay.classList.remove('active'); | |
| }); | |
| overlay.addEventListener('click', () => { | |
| sidebar.classList.remove('active'); | |
| overlay.classList.remove('active'); | |
| }); | |
| // Flashcard modal | |
| const addFlashcardButton = document.getElementById('add-flashcard'); | |
| const closeModalButton = document.getElementById('close-modal'); | |
| const cancelFlashcardButton = document.getElementById('cancel-flashcard'); | |
| const flashcardModal = document.getElementById('flashcard-modal'); | |
| addFlashcardButton.addEventListener('click', () => { | |
| flashcardModal.classList.remove('hidden'); | |
| }); | |
| closeModalButton.addEventListener('click', () => { | |
| flashcardModal.classList.add('hidden'); | |
| }); | |
| cancelFlashcardButton.addEventListener('click', () => { | |
| flashcardModal.classList.add('hidden'); | |
| }); | |
| // Timer functionality | |
| let timer; | |
| let timeLeft = 1500; // 25 minutes in seconds | |
| let timerRunning = false; | |
| const timerDisplay = document.getElementById('timer-display'); | |
| const timerStatus = document.getElementById('timer-status'); | |
| const startButton = document.getElementById('start-timer'); | |
| const pauseButton = document.getElementById('pause-timer'); | |
| const resetButton = document.getElementById('reset-timer'); | |
| const timerOptions = document.querySelectorAll('.timer-option'); | |
| const progressCircle = document.getElementById('progress-circle'); | |
| const circumference = 2 * Math.PI * 45; | |
| progressCircle.style.strokeDasharray = circumference; | |
| progressCircle.style.strokeDashoffset = circumference; | |
| function updateTimerDisplay() { | |
| const minutes = Math.floor(timeLeft / 60); | |
| const seconds = timeLeft % 60; | |
| timerDisplay.textContent = `${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}`; | |
| // Update progress circle | |
| const totalTime = parseInt(startButton.dataset.time || 1500); | |
| const offset = circumference - (timeLeft / totalTime) * circumference; | |
| progressCircle.style.strokeDashoffset = offset; | |
| } | |
| function startTimer() { | |
| if (!timerRunning) { | |
| timerRunning = true; | |
| startButton.classList.add('hidden'); | |
| pauseButton.classList.remove('hidden'); | |
| timerStatus.textContent = timerStatus.textContent === 'Ready to study' ? 'Studying...' : timerStatus.textContent; | |
| timer = setInterval(() => { | |
| timeLeft--; | |
| updateTimerDisplay(); | |
| if (timeLeft <= 0) { | |
| clearInterval(timer); | |
| timerRunning = false; | |
| startButton.classList.remove('hidden'); | |
| pauseButton.classList.add('hidden'); | |
| timerStatus.textContent = 'Time is up! Take a break.'; | |
| // Play sound | |
| const audio = new Audio('https://assets.mixkit.co/sfx/preview/mixkit-alarm-digital-clock-beep-989.mp3'); | |
| audio.play(); | |
| } | |
| }, 1000); | |
| } | |
| } | |
| function pauseTimer() { | |
| clearInterval(timer); | |
| timerRunning = false; | |
| startButton.classList.remove('hidden'); | |
| pauseButton.classList.add('hidden'); | |
| timerStatus.textContent = 'Paused'; | |
| } | |
| function resetTimer() { | |
| clearInterval(timer); | |
| timerRunning = false; | |
| timeLeft = parseInt(startButton.dataset.time || 1500); | |
| updateTimerDisplay(); | |
| startButton.classList.remove('hidden'); | |
| pauseButton.classList.add('hidden'); | |
| timerStatus.textContent = 'Ready to study'; | |
| } | |
| startButton.addEventListener('click', startTimer); | |
| pauseButton.addEventListener('click', pauseTimer); | |
| resetButton.addEventListener('click', resetTimer); | |
| timerOptions.forEach(option => { | |
| option.addEventListener('click', () => { | |
| // Remove active class from all options | |
| timerOptions.forEach(opt => { | |
| opt.classList.remove('border-indigo-200', 'text-indigo-600', 'bg-indigo-50'); | |
| opt.classList.add('border-gray-200', 'text-gray-600'); | |
| }); | |
| // Add active class to clicked option | |
| option.classList.remove('border-gray-200', 'text-gray-600'); | |
| option.classList.add('border-indigo-200', 'text-indigo-600', 'bg-indigo-50'); | |
| // Set the time | |
| const minutes = parseInt(option.dataset.minutes); | |
| timeLeft = minutes * 60; | |
| startButton.dataset.time = timeLeft; | |
| updateTimerDisplay(); | |
| // Reset timer if it's running | |
| if (timerRunning) { | |
| pauseTimer(); | |
| } | |
| }); | |
| }); | |
| // Initialize charts | |
| document.addEventListener('DOMContentLoaded', function() { | |
| // Study Hours Chart | |
| const studyHoursCtx = document.getElementById('study-hours-chart').getContext('2d'); | |
| const studyHoursChart = new Chart(studyHoursCtx, { | |
| type: 'bar', | |
| data: { | |
| labels: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'], | |
| datasets: [{ | |
| label: 'Study Hours', | |
| data: [2.5, 3, 4, 2.5, 3.5, 1, 2], | |
| backgroundColor: '#667eea', | |
| borderRadius: 4 | |
| }] | |
| }, | |
| options: { | |
| responsive: true, | |
| maintainAspectRatio: false, | |
| scales: { | |
| y: { | |
| beginAtZero: true, | |
| grid: { | |
| display: false | |
| } | |
| }, | |
| x: { | |
| grid: { | |
| display: false | |
| } | |
| } | |
| }, | |
| plugins: { | |
| legend: { | |
| display: false | |
| } | |
| } | |
| } | |
| }); | |
| // Mastery Chart | |
| const masteryCtx = document.getElementById('mastery-chart').getContext('2d'); | |
| const masteryChart = new Chart(masteryCtx, { | |
| type: 'doughnut', | |
| data: { | |
| labels: ['Mastered', 'Practiced', 'Needs Work'], | |
| datasets: [{ | |
| data: [45, 30, 25], | |
| backgroundColor: [ | |
| '#10b981', | |
| '#3b82f6', | |
| '#ef4444' | |
| ], | |
| borderWidth: 0 | |
| }] | |
| }, | |
| options: { | |
| responsive: true, | |
| maintainAspectRatio: false, | |
| cutout: '70%', | |
| plugins: { | |
| legend: { | |
| position: 'bottom' | |
| } | |
| } | |
| } | |
| }); | |
| // 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=Thabang576/buddy" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body> | |
| </html> |