Spaces:
Running
Running
Download script.js from lundstream/techviking-express: direct link, hf CLI and curl.
- Browser
- Download file 965 Bytes
-
https://huggingface.co/spaces/lundstream/techviking-express/resolve/main/script.js
- Command line
-
hf download hf://spaces/lundstream/techviking-express/script.js
-
curl -L -o script.js https://huggingface.co/spaces/lundstream/techviking-express/resolve/main/script.js
965 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' | |
| }); | |
| }); | |
| }); | |
| // Intersection Observer for animations | |
| const animateOnScroll = () => { | |
| const elements = document.querySelectorAll('.animate-on-scroll'); | |
| const observer = new IntersectionObserver((entries) => { | |
| entries.forEach(entry => { | |
| if (entry.isIntersecting) { | |
| entry.target.classList.add('animate-fadeIn'); | |
| observer.unobserve(entry.target); | |
| } | |
| }); | |
| }, { | |
| threshold: 0.1 | |
| }); | |
| elements.forEach(element => { | |
| observer.observe(element); | |
| }); | |
| }; | |
| document.addEventListener('DOMContentLoaded', () => { | |
| animateOnScroll(); | |
| feather.replace(); | |
| }); |