DevPlatform
Home
Components
Search
Submit
Earn
Login
Sign Up Free
Order Now - 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
Order Now
rohit
Feb 13, 2026
12
0
Share
Live Preview
Refresh
Live Editor
HTML
CSS
JS
HTML
CSS
JavaScript
1
<button id="orderBtn" class="order-btn"> <span class="text">Order Now</span> </button>
1
body { margin: 0; height: 100vh; display: flex; align-items: center; justify-content: center; background: #f4f6fb; font-family: "Poppins", sans-serif; } .order-btn { position: relative; padding: 16px 40px; font-size: 18px; font-weight: 600; border-radius: 40px; border: none; cursor: pointer; background: #1f2430; color: white; overflow: hidden; transition: all 0.4s ease; box-shadow: 0 6px 20px rgba(0,0,0,0.2); } .order-btn::before { content: ""; position: absolute; top: 0; left: -100%; width: 100%; height: 100%; background: #d4ff2f; transition: left 0.6s ease; z-index: 0; } .order-btn span { position: relative; z-index: 1; } .order-btn.loading::before { left: 0; } .order-btn.placed { background: #2ecc71; } .order-btn.shipped { background: #3498db; } .order-btn:active { transform: scale(0.95); }
1
const btn = document.getElementById("orderBtn"); btn.addEventListener("click", () => { btn.classList.add("loading"); btn.querySelector(".text").textContent = "Processing..."; setTimeout(() => { btn.classList.remove("loading"); btn.classList.add("placed"); btn.querySelector(".text").textContent = "✔ Order Placed"; }, 1500); setTimeout(() => { btn.classList.remove("placed"); btn.classList.add("shipped"); btn.querySelector(".text").textContent = "🚚 Shipped"; }, 3000); });
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!