Download script.js from FourLabs-UN2/darkside-data-input-wizard: direct link, hf CLI and curl.
- Browser
- Download file 1.02 kB
-
https://huggingface.co/spaces/FourLabs-UN2/darkside-data-input-wizard/resolve/main/script.js
- Command line
-
hf download hf://spaces/FourLabs-UN2/darkside-data-input-wizard/script.js
-
curl -L -o script.js https://huggingface.co/spaces/FourLabs-UN2/darkside-data-input-wizard/resolve/main/script.js
1.02 kB
| document.addEventListener('DOMContentLoaded', function() { | |
| // Theme switcher functionality | |
| const themeToggle = document.getElementById('theme-toggle'); | |
| if (themeToggle) { | |
| themeToggle.addEventListener('click', function() { | |
| document.documentElement.classList.toggle('dark'); | |
| localStorage.setItem('darkMode', document.documentElement.classList.contains('dark')); | |
| }); | |
| } | |
| // Initialize dark mode from localStorage | |
| if (localStorage.getItem('darkMode') === 'true') { | |
| document.documentElement.classList.add('dark'); | |
| } | |
| // Form validation example | |
| const formInputs = document.querySelectorAll('input, select, textarea'); | |
| formInputs.forEach(input => { | |
| input.addEventListener('focus', function() { | |
| this.parentElement.classList.add('ring-1', 'ring-primary-500'); | |
| }); | |
| input.addEventListener('blur', function() { | |
| this.parentElement.classList.remove('ring-1', 'ring-primary-500'); | |
| }); | |
| }); | |
| }); |