Spaces:
Running
Running
Download script.js from Kayzex/fivemvortex-showcase: direct link, hf CLI and curl.
- Browser
- Download file 1.06 kB
-
https://huggingface.co/spaces/Kayzex/fivemvortex-showcase/resolve/main/script.js
- Command line
-
hf download hf://spaces/Kayzex/fivemvortex-showcase/script.js
-
curl -L -o script.js https://huggingface.co/spaces/Kayzex/fivemvortex-showcase/resolve/main/script.js
1.06 kB
| // 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 server stats counter (example) | |
| const counters = document.querySelectorAll('.text-5xl'); | |
| const speed = 200; | |
| counters.forEach(counter => { | |
| const target = +counter.getAttribute('data-target'); | |
| const count = +counter.innerText; | |
| const increment = target / speed; | |
| if(count < target) { | |
| counter.innerText = Math.ceil(count + increment); | |
| setTimeout(updateCount, 1); | |
| } else { | |
| counter.innerText = target; | |
| } | |
| function updateCount() { | |
| const current = +counter.innerText; | |
| if(current < target) { | |
| counter.innerText = Math.ceil(current + increment); | |
| setTimeout(updateCount, 1); | |
| } else { | |
| counter.innerText = target; | |
| } | |
| } | |
| }); |