Cosmic 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>Cosmic 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, #3b0249, #5b6e8f); 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, #ff0047, #c94b4b); 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, #c94b4b, #ff0047); } .swipe-button-container.swiped .swipe-button { transform: translateY(-50%) translateX(290px); background: #4caf50; } .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="swipeButton1"> <div class="swipe-button"> <i class="fas fa-arrow-right"></i> </div> </div> <script> const swipeButton1 = document.getElementById('swipeButton1'); swipeButton1.addEventListener('click', () => { swipeButton1.classList.toggle('swiped'); }); </script> </body> </html>