DevPlatform
Home
Components
Search
Submit
Earn
Login
Sign Up Free
Magic 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
Magic Button
sachin007
Jan 22, 2026
9
0
Share
Live Preview
Refresh
Live Editor
HTML
CSS
JS
HTML
CSS
JavaScript
1
<div class="button-container"> <button class="btn-3d"> <span class="btn-text"> <span class="btn-icon">✨</span> Click Me </span> <span class="sparkle"></span> <span class="sparkle"></span> <span class="sparkle"></span> <span class="sparkle"></span> </button> <div class="shadow"></div> </div>
1
* { margin: 0; padding: 0; box-sizing: border-box; } body { min-height: 100vh; display: flex; justify-content: center; align-items: center; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); font-family: 'Arial', sans-serif; perspective: 1000px; } .button-container { position: relative; } .btn-3d { position: relative; padding: 20px 60px; font-size: 24px; font-weight: bold; color: #fff; background: linear-gradient(145deg, #ff6b6b, #ee5a6f); border: none; border-radius: 15px; cursor: pointer; transform-style: preserve-3d; transition: all 0.3s ease; box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3), 0 0 0 2px rgba(255, 255, 255, 0.1); overflow: hidden; } .btn-3d::before { content: ''; position: absolute; top: 0; left: -100%; width: 100%; height: 100%; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent); transition: left 0.5s ease; } .btn-3d::after { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: radial-gradient(circle at center, rgba(255, 255, 255, 0.1), transparent); transform: translateZ(-20px); border-radius: 15px; } .btn-3d:hover { transform: translateY(-5px) rotateX(10deg); box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 0 0 0 2px rgba(255, 255, 255, 0.2); } .btn-3d:hover::before { left: 100%; } .btn-3d:active { transform: translateY(-2px) rotateX(5deg) scale(0.98); box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3), 0 0 0 2px rgba(255, 255, 255, 0.1); } .btn-text { position: relative; z-index: 2; display: flex; align-items: center; gap: 10px; } .btn-icon { display: inline-block; animation: float 2s ease-in-out infinite; } @keyframes float { 0%, 100% { transform: translateY(0px); } 50% { transform: translateY(-5px); } } .sparkle { position: absolute; width: 4px; height: 4px; background: white; border-radius: 50%; opacity: 0; animation: sparkle 1.5s ease-in-out infinite; } .sparkle:nth-child(1) { top: 20%; left: 20%; animation-delay: 0s; } .sparkle:nth-child(2) { top: 60%; left: 80%; animation-delay: 0.3s; } .sparkle:nth-child(3) { top: 80%; left: 30%; animation-delay: 0.6s; } .sparkle:nth-child(4) { top: 40%; left: 70%; animation-delay: 0.9s; } @keyframes sparkle { 0%, 100% { opacity: 0; transform: scale(0); } 50% { opacity: 1; transform: scale(1); } } .shadow { position: absolute; bottom: -30px; left: 50%; transform: translateX(-50%); width: 80%; height: 20px; background: radial-gradient(ellipse, rgba(0, 0, 0, 0.3), transparent); border-radius: 50%; transition: all 0.3s ease; } .btn-3d:hover ~ .shadow { width: 90%; opacity: 0.7; }
1
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!