Ocean Breeze 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>Ocean Breeze 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, #1e3c72, #2a5298); 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.4); 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, #00c6ff, #0072ff); 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, #0072ff, #00c6ff); } .swipe-button-container.swiped .swipe-button { transform: translateY(-50%) translateX(290px); background: #28a745; } .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="swipeButton2"> <div class="swipe-button"> <i class="fas fa-arrow-right"></i> </div> </div> <script> const swipeButton2 = document.getElementById('swipeButton2'); swipeButton2.addEventListener('click', () => { swipeButton2.classList.toggle('swiped'); }); </script> </body> </html>