Spaces:
Running
Running
Download script.js from dina25k/docshield-sentinel: direct link, hf CLI and curl.
- Browser
- Download file 739 Bytes
-
https://huggingface.co/spaces/dina25k/docshield-sentinel/resolve/main/script.js
- Command line
-
hf download hf://spaces/dina25k/docshield-sentinel/script.js
-
curl -L -o script.js https://huggingface.co/spaces/dina25k/docshield-sentinel/resolve/main/script.js
739 Bytes
| document.addEventListener('DOMContentLoaded', () => { | |
| // Theme toggle functionality | |
| const themeToggle = document.getElementById('theme-toggle'); | |
| if (themeToggle) { | |
| themeToggle.addEventListener('click', () => { | |
| document.documentElement.classList.toggle('dark'); | |
| localStorage.setItem('darkMode', document.documentElement.classList.contains('dark')); | |
| }); | |
| } | |
| // Initialize dark mode preference | |
| if (localStorage.getItem('darkMode') === 'true') { | |
| document.documentElement.classList.add('dark'); | |
| } else if (!localStorage.getItem('darkMode') && window.matchMedia('(prefers-color-scheme: dark)').matches) { | |
| document.documentElement.classList.add('dark'); | |
| } | |
| }); |