Spaces:
Running
Running
File size: 719 Bytes
999c6f1 f4a6f61 999c6f1 d915abf 999c6f1 d915abf 999c6f1 9eb1f7a 999c6f1 9eb1f7a | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | // 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.");
});
|