Thermometer 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>Thermometer Meter</title> <style> body { font-family: 'Arial', sans-serif; display: flex; justify-content: center; align-items: center; height: 100vh; background: linear-gradient(to right, #e0eafc, #cfdef3); margin: 0; } .meter-container { width: 10%; height: 360px; padding: 20px; background: white; border-radius: 15px; box-shadow: 0 4px 10px rgba(0,0,0,0.1); text-align: center; position: relative; } .meter-title { font-size: 1.2em; margin-bottom: 10px; } .meter { width: 30px; height: 300px; background: #e0e0e0; border-radius: 15px; overflow: hidden; position: relative; margin: 0 auto; } .meter span { display: block; width: 100%; height: 0; background: linear-gradient(to top, #ff4e50, #f9d423); border-radius: 0 0 15px 15px; animation: fill 4s ease-in-out forwards; } @keyframes fill { 0% { height: 0; } 100% { height: 80%; } /* Adjust this percentage based on your needs */ } .percentage { font-size: 1.2em; margin-top: 10px; color: #ff4e50; } </style> </head> <body> <div class="meter-container"> <div class="meter-title">Thermometer</div> <div class="meter"> <span></span> </div> <div class="percentage">80%</div> </div> <script> 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.height = `${targetPercentage}%`; percentage.textContent = `${targetPercentage}%`; }); </script> </body> </html>