Stylish Animated Meter - 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>Stylish Animated Meter</title> <style> body { font-family: 'Arial', sans-serif; display: flex; justify-content: center; align-items: center; height: 100vh; background: linear-gradient(135deg, #f5f7fa, #c3cfe2); margin: 0; } .meter-container { width: 300px; padding: 20px; background: white; border-radius: 15px; box-shadow: 0 4px 10px rgba(0,0,0,0.1); text-align: center; position: relative; } .meter-container::before { content: '⚡'; font-size: 50px; position: absolute; top: -40px; left: 50%; transform: translateX(-50%); } .meter-title { font-size: 1.2em; margin-bottom: 10px; } .meter { width: 100%; height: 30px; background: #e0e0e0; border-radius: 15px; overflow: hidden; position: relative; } .meter span { display: block; height: 100%; background: linear-gradient(135deg, #ff6a00, #ee0979); border-radius: 15px 0 0 15px; width: 0; animation: load 3s ease-in-out forwards; position: relative; } .meter span::after { content: '🔥'; position: absolute; top: 50%; right: -20px; transform: translateY(-50%); animation: bounce 1s infinite; } @keyframes load { 0% { width: 0; } 100% { width: 80%; } /* Adjust this percentage based on your needs */ } @keyframes bounce { 0%, 100% { transform: translateY(-50%) translateX(0); } 50% { transform: translateY(-50%) translateX(5px); } } .percentage { font-size: 1.2em; margin-top: 10px; color: #ff6a00; } </style> </head> <body> <div class="meter-container"> <div class="meter-title">Energy Level</div> <div class="meter"> <span></span> </div> <div class="percentage">80%</div> </div> <script> // JavaScript code to dynamically update the meter percentage and animation if needed document.addEventListener('DOMContentLoaded', () => { const meter = document.querySelector('.meter span'); const percentage = document.querySelector('.percentage'); let targetPercentage = 80; // Change this value to dynamically set the percentage meter.style.width = `${targetPercentage}%`; percentage.textContent = `${targetPercentage}%`; }); </script> </body> </html>