Download script.js from barroyoe/pyrenees-climate-tracker: direct link, hf CLI and curl.
- Browser
- Download file 809 Bytes
-
https://huggingface.co/spaces/barroyoe/pyrenees-climate-tracker/resolve/main/script.js
- Command line
-
hf download hf://spaces/barroyoe/pyrenees-climate-tracker/script.js
-
curl -L -o script.js https://huggingface.co/spaces/barroyoe/pyrenees-climate-tracker/resolve/main/script.js
809 Bytes
| // Shared JavaScript across all pages | |
| document.addEventListener('DOMContentLoaded', () => { | |
| // Add animation classes to elements | |
| const animateElements = document.querySelectorAll('.fade-in'); | |
| animateElements.forEach((el, index) => { | |
| el.style.animationDelay = `${index * 0.1}s`; | |
| }); | |
| // 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' | |
| }); | |
| }); | |
| }); | |
| }); | |
| // Dynamic year for footer | |
| const yearSpan = document.querySelector('#current-year'); | |
| if (yearSpan) { | |
| yearSpan.textContent = new Date().getFullYear(); | |
| } |