Rocket Progress Bar - 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>Rocket Progress Bar</title> <style> body { display: flex; justify-content: center; align-items: center; height: 100vh; background: #282c34; font-family: Arial, sans-serif; margin: 0; color: #fff; } .progress-container { width: 80%; max-width: 600px; background: #3c3f41; border-radius: 50px; padding: 10px; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3); } .progress-bar { height: 40px; width: 0; background: linear-gradient(to right, #1f8ef1, #5b86e5); border-radius: 50px; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: bold; transition: width 0.5s ease-in-out; position: relative; } .progress-bar::before { content: ""; position: absolute; left: 10px; animation: slideIn 0.5s ease-in-out forwards; } @keyframes slideIn { from { left: -30px; opacity: 0; } to { left: 10px; opacity: 1; } } .progress-bar span { margin-left: 35px; } .buttons { display: flex; gap: 10px; justify-content: space-between; } .button { padding: 10px 20px; background: #1f8ef1; color: #fff; border: none; border-radius: 50px; cursor: pointer; transition: background 0.3s; } .button:hover { background: #1d74b8; } .button:disabled { background: #9e9e9e; cursor: not-allowed; } </style> </head> <body> <div class="progress-container"> <div class="progress-bar" id="progress-bar"> <span id="progress-text">0%</span> </div> </div> <div class="buttons"> <button class="button" onclick="startProgress()">Start</button> <button class="button" onclick="resetProgress()">Reset</button> </div> <script> let progress = 0; let progressInterval; function startProgress() { clearInterval(progressInterval); progressInterval = setInterval(() => { if (progress < 100) { progress += 1; updateProgressBar(); } else { clearInterval(progressInterval); document.getElementById('progress-bar').querySelector('span').textContent = '🎉 100%'; } }, 100); } function resetProgress() { clearInterval(progressInterval); progress = 0; updateProgressBar(); } function updateProgressBar() { const progressBar = document.getElementById('progress-bar'); progressBar.style.width = progress + '%'; document.getElementById('progress-text').textContent = progress + '%'; } </script> </body> </html>