Download script.js from oadrianoferrari/deepsite-project-3364f: direct link, hf CLI and curl.
- Browser
- Download file 1.11 kB
-
https://huggingface.co/spaces/oadrianoferrari/deepsite-project-3364f/resolve/main/script.js
- Command line
-
hf download hf://spaces/oadrianoferrari/deepsite-project-3364f/script.js
-
curl -L -o script.js https://huggingface.co/spaces/oadrianoferrari/deepsite-project-3364f/resolve/main/script.js
1.11 kB
| // Smooth scroll polyfill for older browsers | |
| document.querySelectorAll('a[href^="#"]').forEach(anchor => { | |
| anchor.addEventListener('click', function (e) { | |
| e.preventDefault(); | |
| const target = document.querySelector(this.getAttribute('href')); | |
| if (target) { | |
| target.scrollIntoView({ | |
| behavior: 'smooth', | |
| block: 'start' | |
| }); | |
| } | |
| }); | |
| }); | |
| // Add intersection observer for animations on scroll | |
| const observerOptions = { | |
| threshold: 0.1, | |
| rootMargin: '0px 0px -50px 0px' | |
| }; | |
| const observer = new IntersectionObserver((entries) => { | |
| entries.forEach(entry => { | |
| if (entry.isIntersecting) { | |
| entry.target.style.opacity = '1'; | |
| entry.target.style.transform = 'translateY(0)'; | |
| } | |
| }); | |
| }, observerOptions); | |
| // Observe cards and sections | |
| document.querySelectorAll('.value-card, .pain-border').forEach((el) => { | |
| el.style.opacity = '0'; | |
| el.style.transform = 'translateY(20px)'; | |
| el.style.transition = 'opacity 0.6s ease, transform 0.6s ease'; | |
| observer.observe(el); | |
| }); |