diff --git a/components/layout/Navigation.tsx b/components/layout/Navigation.tsx index f14d43e..62a5a65 100644 --- a/components/layout/Navigation.tsx +++ b/components/layout/Navigation.tsx @@ -1,25 +1,83 @@ -"use client" +"use client"; -import { useState, useEffect } from "react" -import { Button } from "../ui/button" -import { NexlayerLogo } from "../NexlayerLogo" +import { useState, useEffect } from "react"; +import { Button } from "../ui/button"; +import { NexlayerLogo } from "../NexlayerLogo"; + +// Simple hamburger icon component +const Hamburger = ({ + open, + onClick, +}: { + open: boolean; + onClick: () => void; +}) => ( + +); export const Navigation = () => { - const [isScrolled, setIsScrolled] = useState(false) + const [isScrolled, setIsScrolled] = useState(false); + + const [menuOpen, setMenuOpen] = useState(false); useEffect(() => { const handleScroll = () => { - setIsScrolled(window.scrollY > 0) + setIsScrolled(window.scrollY > 0); + }; + + window.addEventListener("scroll", handleScroll); + return () => window.removeEventListener("scroll", handleScroll); + }, []); + + // Close menu on route change or resize, and lock body scroll when menu is open + useEffect(() => { + const handleResize = () => { + if (window.innerWidth >= 640) setMenuOpen(false); + }; + window.addEventListener("resize", handleResize); + + // Lock scroll by adding a class to html and body + if (menuOpen) { + document.body.classList.add("nxl-lock-scroll"); + document.documentElement.classList.add("nxl-lock-scroll"); + } else { + document.body.classList.remove("nxl-lock-scroll"); + document.documentElement.classList.remove("nxl-lock-scroll"); } - window.addEventListener("scroll", handleScroll) - return () => window.removeEventListener("scroll", handleScroll) - }, []) + return () => { + window.removeEventListener("resize", handleResize); + document.body.classList.remove("nxl-lock-scroll"); + document.documentElement.classList.remove("nxl-lock-scroll"); + }; + }, [menuOpen]); return ( - ) -} + ); +}; -export default Navigation +export default Navigation; + +if (typeof window !== "undefined") { + const styleId = "nxl-lock-scroll-style"; + if (!document.getElementById(styleId)) { + const style = document.createElement("style"); + style.id = styleId; + style.innerHTML = ` + .nxl-lock-scroll { + overflow: hidden !important; + touch-action: none !important; + overscroll-behavior: none !important; + } + `; + document.head.appendChild(style); + } +} diff --git a/components/sections/HeroSection.tsx b/components/sections/HeroSection.tsx index faecc53..c3b059a 100644 --- a/components/sections/HeroSection.tsx +++ b/components/sections/HeroSection.tsx @@ -33,7 +33,7 @@ export const HeroSection = () => { -
+
The fastest way from code to cloud. 5,000+ apps deployed. The next is yours.
diff --git a/components/sections/HowItWorksSection.tsx b/components/sections/HowItWorksSection.tsx index c162142..c6a24a3 100644 --- a/components/sections/HowItWorksSection.tsx +++ b/components/sections/HowItWorksSection.tsx @@ -69,7 +69,7 @@ export const HowItWorksSection = () => { >- Nexlayer offers flexible plans to meet your needs. Choose the plan that works best for you and your business. + Nexlayer offers flexible plans to meet your needs. Choose the plan + that works best for you and your business.
{plan.subtitle}
-{plan.description}
-+ {plan.subtitle} +
+{plan.description}
+- Only 25 founders accepted in 2025 — just 13 spots left. Go from MVP → Cloud in 24h, free. - Skip Kubernetes. Skip DevOps hires. Be live & investor-ready today. - Includes 12 months Fractional CTO support + $300,000+ value free. + Only 25 founders accepted in 2025 — just 13 spots left. Go + from MVP → Cloud in 24h, free. Skip Kubernetes. Skip DevOps + hires. Be live & investor-ready today. Includes 12 months + Fractional CTO support + $300,000+ value free.