Spaces:
Running
Running
Download script.js from mywebexpert/webwizard-ai-nexus: direct link, hf CLI and curl.
- Browser
- Download file 982 Bytes
-
https://huggingface.co/spaces/mywebexpert/webwizard-ai-nexus/resolve/main/script.js
- Command line
-
hf download hf://spaces/mywebexpert/webwizard-ai-nexus/script.js
-
curl -L -o script.js https://huggingface.co/spaces/mywebexpert/webwizard-ai-nexus/resolve/main/script.js
982 Bytes
| // Shared JavaScript | |
| document.addEventListener('DOMContentLoaded', () => { | |
| // Smooth scrolling for anchor links | |
| document.querySelectorAll('a[href^="#"]').forEach(anchor => { | |
| anchor.addEventListener('click', function(e) { | |
| e.preventDefault(); | |
| const target = document.querySelector(this.getAttribute('href')); | |
| if (target) { | |
| target.scrollIntoView({ | |
| behavior: 'smooth' | |
| }); | |
| } | |
| }); | |
| }); | |
| // Dynamic navbar background on scroll | |
| const navbar = document.querySelector('custom-navbar').shadowRoot.querySelector('nav'); | |
| window.addEventListener('scroll', () => { | |
| if (window.scrollY > 50) { | |
| navbar.style.background = 'rgba(17, 24, 39, 0.95)'; | |
| navbar.style.boxShadow = '0 4px 6px -1px rgba(0, 0, 0, 0.1)'; | |
| } else { | |
| navbar.style.background = ''; | |
| navbar.style.boxShadow = ''; | |
| } | |
| }); | |
| }); |