WEBLEB
Home
AI Editor
Login
Pro
English
English
Français
Español
Português
Deutsch
Italiano
हिंदी
Animated Send Button
22
siddharth_9167_
Open In Editor
Video
Publish Your Code
0
Recommended
24 May 2025
Neumorphism Dark Submit Button
30 August 2025
CSS Animated Button & Layer
7 August 2025
Stylish CSS Button with Animated Text and Icon
HTML
Copy
Animated Send Button
Send
CSS
Copy
body { height: 100vh; display: flex; justify-content: center; align-items: center; background: #0f0f1a; font-family: -apple-system, BlinkMacSystemFont, sans-serif; } .send-btn { display: flex; align-items: center; gap: 10px; padding: 14px 28px; border: none; border-radius: 50px; background: linear-gradient(135deg, #1e1e3f, #5b3cc4); color: white; font-size: 16px; cursor: pointer; position: relative; overflow: hidden; transition: all 0.3s ease; } .send-btn:hover { transform: scale(1.05); box-shadow: 0 0 20px rgba(91, 60, 196, 0.6); } .plane { width: 18px; height: 18px; fill: white; transition: transform 0.3s ease; } .send-btn:hover .plane { transform: translateX(4px); } /* Flying Animation */ @keyframes fly { 0% { transform: translate(0, 0) rotate(0deg); opacity: 1; } 40% { transform: translate(80px, -40px) rotate(25deg); opacity: 0.7; } 60% { transform: translate(100px, -60px) rotate(45deg); opacity: 0; } 61% { transform: translate(-60px, 40px) rotate(-120deg); opacity: 0; } 100% { transform: translate(0, 0) rotate(0deg); opacity: 1; } } .fly { animation: fly 1.5s cubic-bezier(0.65, -0.2, 0.2, 1.3); }
JS
Copy
const sendBtn = document.getElementById("sendBtn"); const text = sendBtn.querySelector(".btn-text"); const plane = sendBtn.querySelector(".plane"); let isAnimating = false; sendBtn.addEventListener("click", () => { if (isAnimating) return; isAnimating = true; text.textContent = "Sending..."; plane.classList.add("fly"); setTimeout(() => { text.textContent = "Sent"; }, 700); setTimeout(() => { plane.classList.remove("fly"); text.textContent = "Send"; isAnimating = false; }, 1500); });