Spaces:
Running
Running
Download script.js from Dvirus/amberdusk-explorer: direct link, hf CLI and curl.
- Browser
- Download file 1.01 kB
-
https://huggingface.co/spaces/Dvirus/amberdusk-explorer/resolve/main/script.js
- Command line
-
hf download hf://spaces/Dvirus/amberdusk-explorer/script.js
-
curl -L -o script.js https://huggingface.co/spaces/Dvirus/amberdusk-explorer/resolve/main/script.js
1.01 kB
| document.addEventListener('DOMContentLoaded', function() { | |
| // Initialize animations | |
| const animatedElements = document.querySelectorAll('.fade-in'); | |
| const observer = new IntersectionObserver((entries) => { | |
| entries.forEach(entry => { | |
| if (entry.isIntersecting) { | |
| entry.target.classList.add('animate-fadeIn'); | |
| } | |
| }); | |
| }, { threshold: 0.1 }); | |
| animatedElements.forEach(el => observer.observe(el)); | |
| // Theme toggle functionality | |
| const themeToggle = document.getElementById('theme-toggle'); | |
| if (themeToggle) { | |
| themeToggle.addEventListener('click', () => { | |
| document.documentElement.classList.toggle('dark'); | |
| localStorage.setItem('theme', document.documentElement.classList.contains('dark') ? 'dark' : 'light'); | |
| }); | |
| } | |
| // Check for saved theme preference | |
| if (localStorage.getItem('theme') === 'light') { | |
| document.documentElement.classList.remove('dark'); | |
| } | |
| }); |