DevPlatform
Home
Components
Search
Submit
Earn
Login
Sign Up Free
toggle round - 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
toggle round
sachin007
Jan 25, 2026
2
0
Share
Live Preview
Refresh
Live Editor
HTML
CSS
JS
HTML
CSS
JavaScript
1
<div class="toggle-container"> <div class="toggle-label">🦜 Tropical Vibes</div> <div class="toggle-switch" id="toggleSwitch"> <div class="circle-track"></div> <div class="circle-inner"></div> <div class="rainbow-trail"></div> <div class="color-orbs"> <div class="orb orb-1"></div> <div class="orb orb-2"></div> <div class="orb orb-3"></div> <div class="orb orb-4"></div> </div> <div class="center-dot"></div> <div class="toggle-slider"> <div class="feather-icon">🪶</div> </div> </div> <div class="status-text" id="statusText">MUTED</div> </div>
1
body { margin: 0; padding: 0; height: 100vh; display: flex; justify-content: center; align-items: center; background: linear-gradient(135deg, #0d3d2d 0%, #1a5c47 50%, #0d3d2d 100%); font-family: 'Arial', sans-serif; } .toggle-container { text-align: center; position: relative; } .toggle-label { background: linear-gradient(90deg, #ff6b35, #f7b801, #00d9ff, #6a4c93); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; font-size: 26px; margin-bottom: 50px; font-weight: 700; letter-spacing: 3px; text-transform: uppercase; filter: drop-shadow(0 2px 8px rgba(255, 107, 53, 0.4)); animation: rainbow-shift 3s ease-in-out infinite; } @keyframes rainbow-shift { 0%, 100% { filter: drop-shadow(0 2px 8px rgba(255, 107, 53, 0.4)); } 25% { filter: drop-shadow(0 2px 8px rgba(247, 184, 1, 0.4)); } 50% { filter: drop-shadow(0 2px 8px rgba(0, 217, 255, 0.4)); } 75% { filter: drop-shadow(0 2px 8px rgba(106, 76, 147, 0.4)); } } .toggle-switch { position: relative; width: 180px; height: 180px; cursor: pointer; margin: 0 auto; } .circle-track { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: linear-gradient(145deg, #2a4a3f, #1a3a2f); border-radius: 50%; border: 4px solid #3a5a4f; transition: all 0.6s ease; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), inset 0 -4px 10px rgba(0, 0, 0, 0.3), inset 0 4px 10px rgba(255, 255, 255, 0.1); } .toggle-switch.active .circle-track { background: linear-gradient(145deg, #ff6b35, #f7b801, #00d9ff, #6a4c93); border-color: #ff6b35; box-shadow: 0 0 40px rgba(255, 107, 53, 0.6), 0 0 60px rgba(247, 184, 1, 0.4), 0 10px 30px rgba(0, 217, 255, 0.3), inset 0 -4px 10px rgba(0, 0, 0, 0.2), inset 0 4px 10px rgba(255, 255, 255, 0.3); animation: rainbow-rotate 4s linear infinite; } @keyframes rainbow-rotate { 0% { filter: hue-rotate(0deg); } 100% { filter: hue-rotate(360deg); } } .circle-inner { position: absolute; top: 15px; left: 15px; width: calc(100% - 30px); height: calc(100% - 30px); background: radial-gradient(circle at 30% 30%, #2a4a3f, #1a3a2f); border-radius: 50%; transition: all 0.6s ease; } .toggle-switch.active .circle-inner { background: radial-gradient(circle at 30% 30%, rgba(255, 107, 53, 0.2), rgba(0, 217, 255, 0.1)); } .toggle-slider { position: absolute; top: 50%; left: 20px; transform: translateY(-50%); width: 60px; height: 60px; background: linear-gradient(145deg, #4a6a5f, #3a5a4f); border-radius: 50%; transition: all 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55); box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6), inset 0 2px 6px rgba(255, 255, 255, 0.2); z-index: 10; } .toggle-switch.active .toggle-slider { left: calc(100% - 80px); background: linear-gradient(145deg, #ff6b35, #f7b801); box-shadow: 0 0 30px rgba(255, 107, 53, 0.8), 0 0 50px rgba(247, 184, 1, 0.6), 0 6px 20px rgba(255, 107, 53, 0.4), inset 0 2px 6px rgba(255, 255, 255, 0.4); animation: slider-rainbow 2s ease-in-out infinite; } @keyframes slider-rainbow { 0%, 100% { background: linear-gradient(145deg, #ff6b35, #f7b801); } 33% { background: linear-gradient(145deg, #f7b801, #00d9ff); } 66% { background: linear-gradient(145deg, #00d9ff, #6a4c93); } } .feather-icon { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 32px; transition: all 0.6s ease; filter: grayscale(1) brightness(0.5); } .toggle-switch.active .feather-icon { filter: grayscale(0) brightness(1); animation: feather-float 2s ease-in-out infinite; } @keyframes feather-float { 0%, 100% { transform: translate(-50%, -50%) rotate(-10deg); } 50% { transform: translate(-50%, -45%) rotate(10deg); } } .color-orbs { position: absolute; top: 50%; left: 50%; width: 100%; height: 100%; transform: translate(-50%, -50%); } .orb { position: absolute; width: 12px; height: 12px; border-radius: 50%; opacity: 0; transition: all 0.6s ease; } .orb-1 { background: #ff6b35; top: 10%; left: 50%; box-shadow: 0 0 20px #ff6b35; } .orb-2 { background: #f7b801; top: 50%; right: 10%; box-shadow: 0 0 20px #f7b801; } .orb-3 { background: #00d9ff; bottom: 10%; left: 50%; box-shadow: 0 0 20px #00d9ff; } .orb-4 { background: #6a4c93; top: 50%; left: 10%; box-shadow: 0 0 20px #6a4c93; } .toggle-switch.active .orb { opacity: 1; animation: orb-pulse 2s ease-in-out infinite; } .toggle-switch.active .orb-1 { animation-delay: 0s; } .toggle-switch.active .orb-2 { animation-delay: 0.5s; } .toggle-switch.active .orb-3 { animation-delay: 1s; } .toggle-switch.active .orb-4 { animation-delay: 1.5s; } @keyframes orb-pulse { 0%, 100% { transform: scale(1); opacity: 0.8; } 50% { transform: scale(1.5); opacity: 1; } } .rainbow-trail { position: absolute; top: 50%; left: 50%; width: 140px; height: 140px; transform: translate(-50%, -50%); border-radius: 50%; border: 3px dashed transparent; opacity: 0; transition: all 0.6s ease; } .toggle-switch.active .rainbow-trail { border-color: rgba(255, 107, 53, 0.5); opacity: 1; animation: trail-spin 8s linear infinite; } @keyframes trail-spin { 0% { transform: translate(-50%, -50%) rotate(0deg); } 100% { transform: translate(-50%, -50%) rotate(360deg); } } .status-text { margin-top: 60px; color: #4a6a5f; font-size: 20px; font-weight: 700; letter-spacing: 3px; text-transform: uppercase; transition: all 0.6s ease; } .toggle-switch.active ~ .status-text { background: linear-gradient(90deg, #ff6b35, #f7b801, #00d9ff, #6a4c93); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; filter: drop-shadow(0 2px 8px rgba(255, 107, 53, 0.6)); } .center-dot { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 30px; height: 30px; background: #2a4a3f; border-radius: 50%; border: 2px solid #3a5a4f; transition: all 0.6s ease; z-index: 5; } .toggle-switch.active .center-dot { background: radial-gradient(circle, #ffffff, #f7b801); border-color: #ff6b35; box-shadow: 0 0 20px rgba(247, 184, 1, 0.8), 0 0 40px rgba(255, 107, 53, 0.6); }
1
const toggleSwitch = document.getElementById('toggleSwitch'); const statusText = document.getElementById('statusText'); let isActive = false; toggleSwitch.addEventListener('click', function() { isActive = !isActive; if (isActive) { toggleSwitch.classList.add('active'); statusText.textContent = 'VIBRANT'; } else { toggleSwitch.classList.remove('active'); statusText.textContent = 'MUTED'; } });
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!