Neon Toggle Switch - MeggiTools
Run
Toggle Theme
Share Link
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Neon Toggle Switch</title> <style> body { display: flex; justify-content: center; align-items: center; height: 100vh; background-color: #000; font-family: Arial, sans-serif; } .toggle-switch { position: relative; width: 80px; height: 40px; background-color: #333; border-radius: 20px; box-shadow: 0 0 15px rgba(0, 0, 0, 0.5); cursor: pointer; transition: background-color 0.3s ease-in-out; } .toggle-switch input { display: none; } .toggle-switch-label { position: absolute; width: 100%; height: 100%; border-radius: 20px; overflow: hidden; } .toggle-switch .toggle-switch-handle { position: absolute; top: 3px; left: 3px; width: 34px; height: 34px; background-color: #fff; border-radius: 50%; box-shadow: 0 0 15px rgba(0, 0, 0, 0.2); transition: left 0.3s ease-in-out, box-shadow 0.3s ease-in-out; } .toggle-switch input:checked + .toggle-switch-label .toggle-switch-handle { left: 43px; box-shadow: 0 0 10px 2px #0f0, 0 0 20px 5px #0f0, 0 0 30px 10px #0f0; } .toggle-switch input:checked + .toggle-switch-label { background-color: #0f0; } </style> </head> <body> <div class="toggle-switch"> <input type="checkbox" id="toggle1" /> <label class="toggle-switch-label" for="toggle1"> <span class="toggle-switch-handle"></span> </label> </div> </body> </html>