Spaces:
Running
Running
Download script.js from Rehan12345678/Securetronics: direct link, hf CLI and curl.
- Browser
- Download file 719 Bytes
-
https://huggingface.co/spaces/Rehan12345678/Securetronics/resolve/main/script.js
- Command line
-
hf download hf://spaces/Rehan12345678/Securetronics/script.js
-
curl -L -o script.js https://huggingface.co/spaces/Rehan12345678/Securetronics/resolve/main/script.js
719 Bytes
| // Mobile menu toggle | |
| const menuBtn = document.getElementById("mobileMenuBtn"); | |
| const navList = document.querySelector(".site-nav ul"); | |
| menuBtn?.addEventListener("click", () => navList?.classList.toggle("open")); | |
| // Smooth scroll | |
| document.querySelectorAll('a[href^="#"]').forEach(a=>{ | |
| a.addEventListener("click",e=>{ | |
| const id=a.getAttribute("href"); | |
| const el=document.querySelector(id); | |
| if(!el) return; | |
| e.preventDefault(); | |
| el.scrollIntoView({behavior:"smooth",block:"start"}); | |
| navList?.classList.remove("open"); | |
| }); | |
| }); | |
| // Contact form demo | |
| document.getElementById("contactForm")?.addEventListener("submit",(e)=>{ | |
| e.preventDefault(); | |
| alert("Thanks! We will contact you shortly."); | |
| }); | |