Forest Green Swipe Button - 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>Forest Green Swipe Button</title> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css"> <style> body { margin: 0; padding: 0; font-family: 'Arial', sans-serif; display: flex; justify-content: center; align-items: center; height: 100vh; background: linear-gradient(135deg, #004d00, #009966); overflow: hidden; } .swipe-button-container { position: relative; width: 350px; height: 60px; background: rgba(255, 255, 255, 0.1); border-radius: 30px; display: flex; align-items: center; padding: 5px; box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5); border: 1px solid rgba(255, 255, 255, 0.3); cursor: pointer; } .swipe-button { position: absolute; top: 50%; left: 5px; transform: translateY(-50%); width: 60px; height: 60px; background: linear-gradient(135deg, #006400, #00b300); border-radius: 50%; box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4); display: flex; align-items: center; justify-content: center; color: #fff; transition: transform 0.4s ease, background 0.4s ease; font-size: 1.5rem; } .swipe-button:hover { background: linear-gradient(135deg, #00b300, #006400); } .swipe-button-container.swiped .swipe-button { transform: translateY(-50%) translateX(290px); background: #228B22; } .swipe-button-container.swiped .swipe-button::before { content: "\f00c"; font-family: 'Font Awesome 5 Free'; font-weight: 900; color: #fff; } .swipe-button-container::before { content: "Swipe"; position: absolute; top: 50%; left: 80px; transform: translateY(-50%); font-size: 1.2rem; color: #fff; font-weight: bold; } </style> </head> <body> <div class="swipe-button-container" id="swipeButton4"> <div class="swipe-button"> <i class="fas fa-arrow-right"></i> </div> </div> <script> const swipeButton4 = document.getElementById('swipeButton4'); swipeButton4.addEventListener('click', () => { swipeButton4.classList.toggle('swiped'); }); </script> </body> </html>