Spaces:
Running
Running
Completely redesign, enhance, and improve my site. Use the below notes to add to the site as well:
f4f0cff verified Download script.js from Cupofjavad/ideaforge-nexus: direct link, hf CLI and curl.
- Browser
- Download file 1.56 kB
-
https://huggingface.co/spaces/Cupofjavad/ideaforge-nexus/resolve/main/script.js
- Command line
-
hf download hf://spaces/Cupofjavad/ideaforge-nexus/script.js
-
curl -L -o script.js https://huggingface.co/spaces/Cupofjavad/ideaforge-nexus/resolve/main/script.js
1.56 kB
| document.addEventListener('DOMContentLoaded', function() { | |
| // Dark mode toggle functionality | |
| const darkModeToggle = document.getElementById('darkModeToggle'); | |
| if (darkModeToggle) { | |
| darkModeToggle.addEventListener('click', function() { | |
| document.documentElement.classList.toggle('dark'); | |
| localStorage.setItem('darkMode', document.documentElement.classList.contains('dark')); | |
| }); | |
| // Check for saved user preference | |
| if (localStorage.getItem('darkMode') === 'true') { | |
| document.documentElement.classList.add('dark'); | |
| } | |
| } | |
| // Smooth scrolling for anchor links | |
| document.querySelectorAll('a[href^="#"]').forEach(anchor => { | |
| anchor.addEventListener('click', function(e) { | |
| e.preventDefault(); | |
| document.querySelector(this.getAttribute('href')).scrollIntoView({ | |
| behavior: 'smooth' | |
| }); | |
| }); | |
| }); | |
| // Add fade-in animations to elements | |
| const animatedElements = document.querySelectorAll('.fade-in'); | |
| animatedElements.forEach((el, index) => { | |
| el.style.opacity = '0'; | |
| el.classList.add(`delay-${(index % 3 + 1) * 100}`); | |
| }); | |
| // Intersection Observer for scroll animations | |
| const observer = new IntersectionObserver((entries) => { | |
| entries.forEach(entry => { | |
| if (entry.isIntersecting) { | |
| entry.target.style.opacity = '1'; | |
| } | |
| }); | |
| }, { threshold: 0.1 }); | |
| animatedElements.forEach(el => observer.observe(el)); | |
| }); |