Spaces:
Running
Running
Download script.js from Roman125orlov/ready-coder-ninja: direct link, hf CLI and curl.
- Browser
- Download file 633 Bytes
-
https://huggingface.co/spaces/Roman125orlov/ready-coder-ninja/resolve/main/script.js
- Command line
-
hf download hf://spaces/Roman125orlov/ready-coder-ninja/script.js
-
curl -L -o script.js https://huggingface.co/spaces/Roman125orlov/ready-coder-ninja/resolve/main/script.js
633 Bytes
| document.addEventListener('DOMContentLoaded', function() { | |
| // Smooth scrolling 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 active class to current nav link | |
| const navLinks = document.querySelectorAll('custom-navbar a'); | |
| const currentUrl = window.location.href; | |
| navLinks.forEach(link => { | |
| if (link.href === currentUrl) { | |
| link.classList.add('active'); | |
| } | |
| }); | |
| }); |