Pulse Wave Button
Preview
Edit
Download
Run
Download Options
HTML File
Download as .html file
CSS File
Download as .css file
JavaScript File
Download as .js file
Combined HTML
All code in one HTML file
Project ZIP
All files in a ZIP archive
Cancel
HTML
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title> Buttons </title> <style> </style> </head> <body> <div class="container"> <div class="buttons-grid"> <div class="button-card"> <div class="button-title"> Pulse Effect</div> <button class="btn-pulse">Pulse Wave</button> </div> </div> </div> </body> </html>
CSS
* { margin: 0; padding: 0; box-sizing: border-box; } body { font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 2rem; } .container { max-width: 1200px; width: 100%; } .button-title { color: white; font-size: 1.1rem; margin-bottom: 1rem; font-weight: 600; } /* Button 7: Pulse */ .btn-pulse { background: #f900e9; color: white; border: none; padding: 15px 30px; border-radius: 50px; font-size: 16px; font-weight: 600; cursor: pointer; position: relative; } .btn-pulse::before { content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0; border-radius: 50px; background: #ff00c8; z-index: -1; transition: all 0.3s ease; } .btn-pulse:hover::before { animation: pulse 1s ease infinite; } @keyframes pulse { 0% { transform: scale(1); opacity: 1; } 100% { transform: scale(1.2); opacity: 0; } } @media (max-width: 768px) { .buttons-grid { grid-template-columns: 1fr; } h1 { font-size: 2rem; } }
JavaScript
// Add click feedback for all buttons document.querySelectorAll('button').forEach(button => { button.addEventListener('click', function() { // Create a temporary scale effect on click this.style.transform = 'scale(0.95)'; setTimeout(() => { this.style.transform = ''; }, 150); }); }); // Add extra interactivity to the magnetic button const magneticBtn = document.querySelector('.btn-magnetic'); magneticBtn.addEventListener('mousemove', function(e) { const rect = this.getBoundingClientRect(); const x = e.clientX - rect.left - rect.width / 2; const y = e.clientY - rect.top - rect.height / 2; this.style.transform = `translate(${x * 0.1}px, ${y * 0.1}px) scale(1.1)`; }); magneticBtn.addEventListener('mouseleave', function() { this.style.transform = ''; });
Output Preview
Desktop
Mobile
Fullscreen