Glassmorphism Counter - 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>Glassmorphism Counter</title> <style> body { font-family: 'Roboto', sans-serif; background: linear-gradient(135deg, #c3cfe2, #f5f7fa); display: flex; justify-content: center; align-items: center; height: 100vh; margin: 0; } .counter-container { text-align: center; background: rgba(255, 255, 255, 0.1); padding: 50px; border-radius: 15px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1); border: 1px solid rgba(255, 255, 255, 0.3); } .counter { font-size: 4rem; color: #fff; margin: 20px 0; } .buttons { display: flex; justify-content: center; gap: 20px; } .button { padding: 10px 20px; font-size: 1.2rem; color: #fff; background: rgba(255, 255, 255, 0.1); border: none; border-radius: 10px; cursor: pointer; transition: background 0.3s, transform 0.3s; box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1); } .button:hover { background: rgba(255, 255, 255, 0.2); transform: translateY(-3px); } .button:active { transform: translateY(0); } </style> </head> <body> <div class="counter-container"> <div class="counter" id="counter">0</div> <div class="buttons"> <button class="button" onclick="decreaseCounter()">➖</button> <button class="button" onclick="resetCounter()">🔄</button> <button class="button" onclick="increaseCounter()">➕</button> </div> </div> <script> let counter = 0; const counterElement = document.getElementById('counter'); function updateCounter() { counterElement.textContent = counter; } function increaseCounter() { counter++; updateCounter(); } function decreaseCounter() { counter--; updateCounter(); } function resetCounter() { counter = 0; updateCounter(); } updateCounter(); </script> </body> </html>