Spaces:
Running
Running
Download script.js from OlegXio/codeshadow-ninja: direct link, hf CLI and curl.
- Browser
- Download file 843 Bytes
-
https://huggingface.co/spaces/OlegXio/codeshadow-ninja/resolve/main/script.js
- Command line
-
hf download hf://spaces/OlegXio/codeshadow-ninja/script.js
-
curl -L -o script.js https://huggingface.co/spaces/OlegXio/codeshadow-ninja/resolve/main/script.js
843 Bytes
| // 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 animation to sections when they come into view | |
| const sections = document.querySelectorAll('section'); | |
| const observer = new IntersectionObserver((entries) => { | |
| entries.forEach(entry => { | |
| if (entry.isIntersecting) { | |
| entry.target.classList.add('fade-in'); | |
| observer.unobserve(entry.target); | |
| } | |
| }); | |
| }, { threshold: 0.1 }); | |
| sections.forEach(section => { | |
| observer.observe(section); | |
| }); | |
| }); |