Download script.js from onzii/transformation-showcase-magic: direct link, hf CLI and curl.
- Browser
- Download file 706 Bytes
-
https://huggingface.co/spaces/onzii/transformation-showcase-magic/resolve/main/script.js
- Command line
-
hf download hf://spaces/onzii/transformation-showcase-magic/script.js
-
curl -L -o script.js https://huggingface.co/spaces/onzii/transformation-showcase-magic/resolve/main/script.js
706 Bytes
| // Animation for before/after sections | |
| document.addEventListener('DOMContentLoaded', () => { | |
| const sections = document.querySelectorAll('div[class*="transform"]'); | |
| const observer = new IntersectionObserver((entries) => { | |
| entries.forEach(entry => { | |
| if (entry.isIntersecting) { | |
| entry.target.classList.add('translate-y-0', 'opacity-100'); | |
| entry.target.classList.remove('translate-y-10', 'opacity-0'); | |
| } | |
| }); | |
| }, { threshold: 0.1 }); | |
| sections.forEach(section => { | |
| section.classList.add('transition-all', 'duration-500', 'ease-out', 'translate-y-10', 'opacity-0'); | |
| observer.observe(section); | |
| }); | |
| }); |