DevPlatform
Home
Components
Search
Submit
Earn
Login
Sign Up Free
Liquid Button - Preview | DevPlatform
DevPlatform
Categories
Accordion
Animation
Box Shadow
Button
Card
Footer
Form
Gallery
Hero Section
Inputs
Loader
Marquee
Modal
Modules
Navbar
Progress Bar
Radio Buttons
Search-Bar
Sections
Slider
Tab
Timeline
Toggle
Liquid Button
admin1234
Feb 07, 2026
5
0
Share
Live Preview
Refresh
Live Editor
HTML
CSS
JS
HTML
CSS
JavaScript
1
<div class="button-container"> <button class="liquid-button"> <div class="liquid-bg"> <div class="liquid-wave"></div> <div class="liquid-bubble"></div> <div class="liquid-bubble"></div> <div class="liquid-bubble"></div> <div class="liquid-bubble"></div> <div class="liquid-bubble"></div> </div> Click Me </button> <div class="button-shadow"></div> </div>
1
* { margin: 0; padding: 0; box-sizing: border-box; } body { min-height: 100vh; display: flex; align-items: center; justify-content: center; gap: 40px; flex-wrap: wrap; background: linear-gradient(135deg, #e8e8e8 0%, #f5f5f5 50%, #e0e0e0 100%); font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; padding: 40px; } .button-container { position: relative; display: inline-block; } .liquid-button { position: relative; padding: 18px 45px; font-size: 18px; font-weight: 600; color: #fff; background: transparent; border: none; cursor: pointer; outline: none; z-index: 1; letter-spacing: 0.5px; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2); } /* Liquid jelly background */ .liquid-bg { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: linear-gradient(135deg, rgba(255, 245, 235, 0.95) 0%, rgba(255, 220, 190, 0.9) 20%, rgba(255, 180, 140, 0.88) 50%, rgba(240, 150, 110, 0.92) 100%); border-radius: 50px; overflow: hidden; z-index: -1; box-shadow: 0 8px 25px rgba(240, 140, 100, 0.35), 0 2px 8px rgba(0, 0, 0, 0.1), inset 0 -8px 15px rgba(220, 120, 80, 0.25), inset 0 8px 20px rgba(255, 255, 255, 0.5); transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); } /* Glass shine effect */ .liquid-bg::before { content: ''; position: absolute; top: 10%; left: 15%; width: 50%; height: 45%; background: radial-gradient(ellipse at 30% 30%, rgba(255, 255, 255, 0.8) 0%, rgba(255, 255, 255, 0.4) 30%, rgba(255, 255, 255, 0.1) 50%, transparent 70%); border-radius: 50%; filter: blur(4px); transform: rotate(-25deg); } /* Liquid wave effect */ .liquid-wave { position: absolute; bottom: 0; left: 0; width: 200%; height: 100%; background: linear-gradient(to top, rgba(255, 140, 90, 0.6) 0%, rgba(255, 180, 140, 0.3) 50%, transparent 100%); border-radius: 45%; animation: wave-float 3s ease-in-out infinite; } .liquid-wave::before { content: ''; position: absolute; bottom: 0; left: -50%; width: 200%; height: 100%; background: linear-gradient(to top, rgba(240, 120, 80, 0.5) 0%, rgba(255, 160, 120, 0.2) 40%, transparent 100%); border-radius: 43%; animation: wave-float 4s ease-in-out infinite reverse; } @keyframes wave-float { 0%, 100% { transform: translateX(-25%) translateY(0%) rotate(0deg); } 50% { transform: translateX(-75%) translateY(-10%) rotate(5deg); } } /* Liquid bubbles */ .liquid-bubble { position: absolute; border-radius: 50%; background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.6) 0%, rgba(255, 255, 255, 0.3) 50%, rgba(255, 200, 160, 0.2) 100%); box-shadow: inset 0 2px 6px rgba(255, 255, 255, 0.5), 0 2px 8px rgba(0, 0, 0, 0.1); animation: bubble-rise linear infinite; } .liquid-bubble:nth-child(1) { width: 8px; height: 8px; left: 15%; bottom: -10px; animation-duration: 3.5s; animation-delay: 0s; } .liquid-bubble:nth-child(2) { width: 12px; height: 12px; left: 45%; bottom: -15px; animation-duration: 4s; animation-delay: 1s; } .liquid-bubble:nth-child(3) { width: 6px; height: 6px; left: 70%; bottom: -8px; animation-duration: 3s; animation-delay: 2s; } .liquid-bubble:nth-child(4) { width: 10px; height: 10px; left: 30%; bottom: -12px; animation-duration: 3.8s; animation-delay: 0.5s; } .liquid-bubble:nth-child(5) { width: 7px; height: 7px; left: 85%; bottom: -9px; animation-duration: 3.2s; animation-delay: 1.5s; } @keyframes bubble-rise { 0% { transform: translateY(0) scale(1); opacity: 0; } 10% { opacity: 1; } 90% { opacity: 1; } 100% { transform: translateY(-120px) scale(0.5); opacity: 0; } } /* Hover state */ .liquid-button:hover .liquid-bg { transform: scale(1.05); box-shadow: 0 12px 35px rgba(240, 140, 100, 0.45), 0 4px 12px rgba(0, 0, 0, 0.15), inset 0 -10px 18px rgba(220, 120, 80, 0.3), inset 0 10px 25px rgba(255, 255, 255, 0.6); } .liquid-button:hover .liquid-wave { animation-duration: 2s; } /* Active/Click state - liquid squish */ .liquid-button:active .liquid-bg { animation: liquid-squish 0.6s cubic-bezier(0.34, 1.56, 0.64, 1); transform: scale(0.95); } @keyframes liquid-squish { 0% { border-radius: 50px; } 25% { border-radius: 45px 55px 48px 52px / 52px 48px 45px 55px; transform: scale(0.95) scaleY(0.9); } 50% { border-radius: 52px 48px 55px 45px / 48px 52px 52px 48px; transform: scale(0.95) scaleY(1.05); } 75% { border-radius: 48px 52px 45px 55px / 55px 45px 48px 52px; transform: scale(0.95) scaleY(0.97); } 100% { border-radius: 50px; transform: scale(0.95); } } /* Different color variants */ .liquid-button.blue .liquid-bg { background: linear-gradient(135deg, rgba(230, 240, 255, 0.95) 0%, rgba(190, 220, 255, 0.9) 20%, rgba(140, 180, 255, 0.88) 50%, rgba(100, 150, 240, 0.92) 100%); box-shadow: 0 8px 25px rgba(100, 150, 240, 0.35), 0 2px 8px rgba(0, 0, 0, 0.1), inset 0 -8px 15px rgba(80, 120, 220, 0.25), inset 0 8px 20px rgba(255, 255, 255, 0.5); } .liquid-button.blue .liquid-wave { background: linear-gradient(to top, rgba(90, 140, 255, 0.6) 0%, rgba(140, 180, 255, 0.3) 50%, transparent 100%); } .liquid-button.blue .liquid-wave::before { background: linear-gradient(to top, rgba(80, 120, 240, 0.5) 0%, rgba(120, 160, 255, 0.2) 40%, transparent 100%); } .liquid-button.green .liquid-bg { background: linear-gradient(135deg, rgba(240, 255, 235, 0.95) 0%, rgba(200, 240, 190, 0.9) 20%, rgba(140, 220, 140, 0.88) 50%, rgba(100, 200, 110, 0.92) 100%); box-shadow: 0 8px 25px rgba(100, 200, 110, 0.35), 0 2px 8px rgba(0, 0, 0, 0.1), inset 0 -8px 15px rgba(80, 180, 90, 0.25), inset 0 8px 20px rgba(255, 255, 255, 0.5); } .liquid-button.green .liquid-wave { background: linear-gradient(to top, rgba(90, 200, 100, 0.6) 0%, rgba(140, 220, 140, 0.3) 50%, transparent 100%); } .liquid-button.green .liquid-wave::before { background: linear-gradient(to top, rgba(80, 180, 90, 0.5) 0%, rgba(120, 210, 120, 0.2) 40%, transparent 100%); } .liquid-button.purple .liquid-bg { background: linear-gradient(135deg, rgba(250, 235, 255, 0.95) 0%, rgba(230, 190, 255, 0.9) 20%, rgba(200, 140, 255, 0.88) 50%, rgba(170, 100, 240, 0.92) 100%); box-shadow: 0 8px 25px rgba(170, 100, 240, 0.35), 0 2px 8px rgba(0, 0, 0, 0.1), inset 0 -8px 15px rgba(150, 80, 220, 0.25), inset 0 8px 20px rgba(255, 255, 255, 0.5); } .liquid-button.purple .liquid-wave { background: linear-gradient(to top, rgba(170, 90, 240, 0.6) 0%, rgba(200, 140, 255, 0.3) 50%, transparent 100%); } .liquid-button.purple .liquid-wave::before { background: linear-gradient(to top, rgba(150, 80, 220, 0.5) 0%, rgba(190, 120, 250, 0.2) 40%, transparent 100%); } /* Shadow beneath button */ .button-shadow { position: absolute; bottom: -10px; left: 50%; transform: translateX(-50%); width: 80%; height: 15px; background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.2) 0%, rgba(0, 0, 0, 0.08) 50%, transparent 75%); border-radius: 50%; filter: blur(6px); transition: all 0.3s ease; } .liquid-button:hover ~ .button-shadow { width: 85%; opacity: 1.2; } .liquid-button:active ~ .button-shadow { width: 90%; bottom: -8px; }
1
// Add click animation feedback document.querySelectorAll('.liquid-button').forEach(button => { button.addEventListener('click', function(e) { // Create ripple effect const ripple = document.createElement('div'); ripple.style.position = 'absolute'; ripple.style.borderRadius = '50%'; ripple.style.background = 'rgba(255, 255, 255, 0.5)'; ripple.style.width = '10px'; ripple.style.height = '10px'; ripple.style.pointerEvents = 'none'; ripple.style.animation = 'ripple-expand 0.6s ease-out'; const rect = this.getBoundingClientRect(); ripple.style.left = (e.clientX - rect.left - 5) + 'px'; ripple.style.top = (e.clientY - rect.top - 5) + 'px'; this.appendChild(ripple); setTimeout(() => ripple.remove(), 600); }); }); // Add ripple animation const style = document.createElement('style'); style.textContent = ` @keyframes ripple-expand { from { transform: scale(1); opacity: 1; } to { transform: scale(20); opacity: 0; } } `; document.head.appendChild(style);
Comments
0
Want to comment?
Please
login
or
sign up
to post comments.
No comments yet
Be the first to comment on this component!
Comments 0
Want to comment?
Please login or sign up to post comments.
No comments yet
Be the first to comment on this component!