Pastel 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>Pastel Counter</title> <style> body { font-family: 'Arial', sans-serif; background: linear-gradient(to right, #ff9a9e, #fad0c4); display: flex; justify-content: center; align-items: center; height: 100vh; margin: 0; } .counter-container { text-align: center; background: rgba(255, 255, 255, 0.8); padding: 40px; border-radius: 15px; box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2); } .counter { font-size: 4rem; color: #333; margin: 20px 0; } .buttons { display: flex; justify-content: center; gap: 15px; } .button { padding: 10px 15px; font-size: 1.1rem; color: #fff; background: #6a11cb; border: none; border-radius: 5px; cursor: pointer; transition: background 0.3s, transform 0.3s; box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2); } .button:hover { background: #2575fc; transform: translateY(-2px); } .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>