Download script.js from Aviation169/component-crafters-workshop: direct link, hf CLI and curl.
- Browser
- Download file 744 Bytes
-
https://huggingface.co/spaces/Aviation169/component-crafters-workshop/resolve/main/script.js
- Command line
-
hf download hf://spaces/Aviation169/component-crafters-workshop/script.js
-
curl -L -o script.js https://huggingface.co/spaces/Aviation169/component-crafters-workshop/resolve/main/script.js
744 Bytes
| // Initialize components and add interactivity | |
| document.addEventListener('DOMContentLoaded', () => { | |
| // Smooth scroll 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 all custom components | |
| const components = document.querySelectorAll('custom-navbar, custom-card, custom-accordion, custom-testimonials, custom-newsletter, custom-footer'); | |
| components.forEach(component => { | |
| component.classList.add('fade-in'); | |
| }); | |
| }); |