Flip 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>Flip Counter</title> <style> body { display: flex; justify-content: center; align-items: center; height: 100vh; background: linear-gradient(135deg, #e66465, #9198e5); font-family: 'Arial', sans-serif; margin: 0; } .counter-container { text-align: center; background: #fff; padding: 20px; border-radius: 10px; box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1); position: relative; } .counter { font-size: 100px; color: #333; margin: 0; transition: transform 0.6s ease; } .label { font-size: 20px; color: #333; margin-top: 10px; letter-spacing: 1.5px; } .increment-btn { background: #e66465; color: #fff; border: none; padding: 10px 20px; font-size: 20px; border-radius: 5px; cursor: pointer; margin-top: 20px; transition: background 0.3s; } .increment-btn:hover { background: #ff7f50; } </style> </head> <body> <div class="counter-container"> <div class="counter" id="counter">0</div> <div class="label">Visitors</div> <button class="increment-btn" onclick="incrementCounter()">Increment</button> </div> <script> let count = 0; const counterElement = document.getElementById('counter'); function incrementCounter() { count++; counterElement.textContent = count; counterElement.style.transform = 'rotateX(360deg)'; setTimeout(() => counterElement.style.transform = 'rotateX(0deg)', 600); } </script> </body> </html>