diff --git a/src/components/Navigation.tsx b/src/components/Navigation.tsx index 3325ab7..0c2268a 100755 --- a/src/components/Navigation.tsx +++ b/src/components/Navigation.tsx @@ -6,66 +6,40 @@ import Image from "next/image"; const navLinks = [ { href: "#about", label: "About" }, - { href: "#services", label: "Services" }, { href: "#projects", label: "Projects" }, - { href: "#on-set", label: "On Set" }, { href: "#contact", label: "Contact" }, ]; export default function Navigation() { const [scrolled, setScrolled] = useState(false); const [mobileOpen, setMobileOpen] = useState(false); - const [activeSection, setActiveSection] = useState(""); useEffect(() => { const handleScroll = () => setScrolled(window.scrollY > 50); - window.addEventListener("scroll", handleScroll, { passive: true }); + window.addEventListener("scroll", handleScroll); return () => window.removeEventListener("scroll", handleScroll); }, []); - // Track active section - useEffect(() => { - const observer = new IntersectionObserver( - (entries) => { - entries.forEach((entry) => { - if (entry.isIntersecting) { - setActiveSection(`#${entry.target.id}`); - } - }); - }, - { threshold: 0.3, rootMargin: "-80px 0px -40% 0px" } - ); - - const sections = document.querySelectorAll("section[id]"); - sections.forEach((section) => observer.observe(section)); - return () => observer.disconnect(); - }, []); - - // Lock body scroll when mobile menu is open - useEffect(() => { - document.body.style.overflow = mobileOpen ? "hidden" : ""; - return () => { document.body.style.overflow = ""; }; - }, [mobileOpen]); - return ( ); }