Professional 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>Professional Counter</title> <style> body { font-family: 'Arial', sans-serif; background: linear-gradient(135deg, #f5f7fa, #c3cfe2); display: flex; justify-content: center; align-items: center; height: 100vh; margin: 0; } .counter-container { text-align: center; background: #fff; padding: 30px; border-radius: 15px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1); position: relative; overflow: hidden; } .counter-container::before { content: '✨'; position: absolute; top: -50px; left: -50px; font-size: 100px; animation: spin 10s linear infinite; opacity: 0.3; } .counter-container::after { content: '✨'; position: absolute; bottom: -50px; right: -50px; font-size: 100px; animation: spin 10s linear infinite reverse; opacity: 0.3; } .counter { font-size: 5rem; color: #333; margin: 20px 0; animation: fadeIn 2s; } .buttons { display: flex; justify-content: center; gap: 20px; } .button { padding: 10px 20px; font-size: 1.2rem; color: #fff; background: #6200ea; 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: #3700b3; transform: translateY(-3px); } .button:active { transform: translateY(0); } @keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } } @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } } </style> </head> <body> <div class="counter-container"> <div id="emoji">🔢</div> <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'); const emojiElement = document.getElementById('emoji'); function updateCounter() { counterElement.textContent = counter; emojiElement.innerHTML = counter % 2 === 0 ? '👍' : '✨'; } function increaseCounter() { counter++; updateCounter(); } function decreaseCounter() { counter--; updateCounter(); } function resetCounter() { counter = 0; updateCounter(); } updateCounter(); </script> </body> </html>