Neon Glow Stopwatch - MeggiTools
Run
Toggle Theme
Share Link
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Neon Glow Stopwatch</title> <style> body { font-family: 'Neucha', cursive; background: #000; display: flex; justify-content: center; align-items: center; height: 100vh; margin: 0; color: #00ff99; } .stopwatch { background: #111; border-radius: 15px; padding: 30px; text-align: center; box-shadow: 0 0 20px #00ff99; } .stopwatch .time { font-size: 3rem; margin-bottom: 20px; text-shadow: 0 0 10px #00ff99; } .stopwatch .buttons { display: flex; justify-content: space-between; } .stopwatch button { background: #00ff99; border: none; border-radius: 5px; color: #111; font-size: 1rem; padding: 10px 20px; cursor: pointer; transition: background 0.3s, transform 0.3s; } .stopwatch button:hover { background: #00cc7a; } .stopwatch button:active { transform: scale(0.95); } .stopwatch button:focus { outline: none; } .stopwatch .start-btn { animation: neonPulse 2s infinite; } @keyframes neonPulse { 0% { box-shadow: 0 0 10px #00ff99; } 50% { box-shadow: 0 0 20px #00ff99; } 100% { box-shadow: 0 0 10px #00ff99; } } </style> </head> <body> <div class="stopwatch"> <div class="time">00:00:00</div> <div class="buttons"> <button type="button" class="start-btn">Start ⏱️</button> <button type="button" class="reset-btn">Reset 🔄</button> </div> </div> <script> let timeDisplay = document.querySelector('.time'); let startBtn = document.querySelector('.start-btn'); let resetBtn = document.querySelector('.reset-btn'); let intervalId; let elapsedTime = 0; let running = false; startBtn.addEventListener('click', function() { if (!running) { intervalId = setInterval(() => { elapsedTime += 10; let date = new Date(elapsedTime); let minutes = String(date.getMinutes()).padStart(2, '0'); let seconds = String(date.getSeconds()).padStart(2, '0'); let milliseconds = String(date.getMilliseconds()).padStart(3, '0').slice(0, -1); timeDisplay.textContent = `${minutes}:${seconds}:${milliseconds}`; }, 10); running = true; startBtn.textContent = 'Pause ⏸️'; } else { clearInterval(intervalId); running = false; startBtn.textContent = 'Start ⏱️'; } }); resetBtn.addEventListener('click', function() { clearInterval(intervalId); elapsedTime = 0; timeDisplay.textContent = '00:00:00'; running = false; startBtn.textContent = 'Start ⏱️'; }); </script> </body> </html>