DevPlatform
Home
Components
Search
Submit
Earn
Login
Sign Up Free
toggle red - 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 red
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">Fire Power</div> <div class="toggle-switch" id="toggleSwitch"> <div class="heat-waves"> <div class="heat-wave"></div> <div class="heat-wave"></div> <div class="heat-wave"></div> </div> <div class="power-indicator"></div> <div class="toggle-slider"> <div class="fire-icon"></div> </div> </div> <div class="status-text" id="statusText">DORMANT</div> </div>
1
body { margin: 0; padding: 0; height: 100vh; display: flex; justify-content: center; align-items: center; background: linear-gradient(135deg, #1a0000 0%, #2d0a0a 50%, #1a0000 100%); font-family: 'Arial', sans-serif; } .toggle-container { text-align: center; position: relative; } .toggle-label { color: #ff4444; font-size: 24px; margin-bottom: 40px; font-weight: 700; letter-spacing: 4px; text-transform: uppercase; text-shadow: 0 0 10px #ff0000, 0 0 20px #ff0000, 0 0 30px #ff0000, 0 0 40px #cc0000; animation: flicker 3s ease-in-out infinite; } @keyframes flicker { 0%, 100% { opacity: 1; } 25% { opacity: 0.9; } 50% { opacity: 1; } 75% { opacity: 0.95; } } .toggle-switch { position: relative; width: 160px; height: 80px; background: linear-gradient(145deg, #2a0505, #1a0000); border-radius: 80px; cursor: pointer; transition: all 0.5s ease; border: 3px solid #4a0000; box-shadow: 0 8px 30px rgba(255, 0, 0, 0.2), inset 0 4px 10px rgba(0, 0, 0, 0.5); overflow: visible; } .toggle-switch::before { content: ''; position: absolute; top: -5px; left: -5px; right: -5px; bottom: -5px; background: linear-gradient(45deg, #ff0000, #ff4444, #ff6666, #ff0000); border-radius: 80px; opacity: 0; z-index: -1; transition: opacity 0.5s ease; filter: blur(10px); animation: rotateBorder 4s linear infinite; } @keyframes rotateBorder { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } } .toggle-switch.active::before { opacity: 1; } .toggle-switch.active { background: linear-gradient(145deg, #8a0000, #5a0000); border-color: #ff0000; box-shadow: 0 8px 40px rgba(255, 0, 0, 0.6), 0 0 60px rgba(255, 0, 0, 0.4), inset 0 4px 10px rgba(255, 0, 0, 0.2); } .toggle-slider { position: absolute; top: 10px; left: 10px; width: 60px; height: 60px; background: linear-gradient(145deg, #3a0000, #1a0000); border-radius: 50%; transition: all 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55); border: 3px solid #660000; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.8), inset 0 2px 8px rgba(255, 0, 0, 0.1); display: flex; align-items: center; justify-content: center; } .toggle-switch.active .toggle-slider { transform: translateX(80px); background: linear-gradient(145deg, #ff3333, #cc0000); border-color: #ff6666; box-shadow: 0 0 30px #ff0000, 0 0 50px #ff0000, 0 6px 20px rgba(255, 0, 0, 0.8), inset 0 2px 8px rgba(255, 255, 255, 0.2); animation: pulse-glow 2s ease-in-out infinite; } @keyframes pulse-glow { 0%, 100% { box-shadow: 0 0 30px #ff0000, 0 0 50px #ff0000, 0 6px 20px rgba(255, 0, 0, 0.8), inset 0 2px 8px rgba(255, 255, 255, 0.2); } 50% { box-shadow: 0 0 40px #ff0000, 0 0 70px #ff0000, 0 6px 25px rgba(255, 0, 0, 1), inset 0 2px 8px rgba(255, 255, 255, 0.3); } } .fire-icon { width: 30px; height: 30px; position: relative; } .fire-icon::before { content: '🔥'; font-size: 28px; opacity: 0.3; transition: all 0.5s ease; filter: grayscale(1); } .toggle-switch.active .fire-icon::before { opacity: 1; filter: grayscale(0); animation: fire-dance 0.5s ease-in-out infinite; } @keyframes fire-dance { 0%, 100% { transform: scale(1) rotate(-5deg); } 50% { transform: scale(1.1) rotate(5deg); } } .heat-waves { position: absolute; top: -20px; left: 50%; transform: translateX(-50%); width: 100px; height: 100px; opacity: 0; transition: opacity 0.5s ease; pointer-events: none; } .heat-wave { position: absolute; width: 100%; height: 2px; background: linear-gradient(90deg, transparent, #ff0000, transparent); opacity: 0; } .toggle-switch.active .heat-waves { opacity: 1; } .toggle-switch.active .heat-wave:nth-child(1) { animation: wave 2s ease-in-out infinite; animation-delay: 0s; } .toggle-switch.active .heat-wave:nth-child(2) { animation: wave 2s ease-in-out infinite; animation-delay: 0.5s; } .toggle-switch.active .heat-wave:nth-child(3) { animation: wave 2s ease-in-out infinite; animation-delay: 1s; } @keyframes wave { 0% { transform: translateY(0) scaleX(0.5); opacity: 0; } 50% { opacity: 0.6; } 100% { transform: translateY(-40px) scaleX(1.2); opacity: 0; } } .status-text { margin-top: 50px; color: #660000; font-size: 20px; font-weight: 700; letter-spacing: 3px; text-transform: uppercase; transition: all 0.5s ease; text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5); } .toggle-switch.active ~ .status-text { color: #ff3333; text-shadow: 0 0 10px #ff0000, 0 0 20px #ff0000, 0 0 30px #cc0000; } .power-indicator { position: absolute; top: 50%; right: 25px; transform: translateY(-50%); width: 20px; height: 20px; background: #330000; border-radius: 50%; border: 2px solid #660000; transition: all 0.5s ease; } .toggle-switch.active .power-indicator { background: #ff0000; border-color: #ff6666; box-shadow: 0 0 15px #ff0000, 0 0 30px #ff0000, inset 0 0 10px rgba(255, 255, 255, 0.5); }
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 = 'IGNITED'; } else { toggleSwitch.classList.remove('active'); statusText.textContent = 'DORMANT'; } });
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!