diff --git a/src/app/page.tsx b/src/app/page.tsx index 075cd60..b891fc6 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -66,6 +66,8 @@ export default function Home() { const [lang, setLang] = useState('fr'); const [isLangOpen, setIsLangOpen] = useState(false); const langDropdownRef = useRef(null); + const [navVisible, setNavVisible] = useState(true); + const lastScrollY = useRef(0); const t = translations[lang]; @@ -76,6 +78,17 @@ export default function Home() { value: t.modules.items[i].value, })); + // Hide navbar on scroll down, show on scroll up + useEffect(() => { + const handleScroll = () => { + const currentY = window.scrollY; + setNavVisible(currentY < lastScrollY.current || currentY < 10); + lastScrollY.current = currentY; + }; + window.addEventListener('scroll', handleScroll, { passive: true }); + return () => window.removeEventListener('scroll', handleScroll); + }, []); + // Lock body scroll when mobile menu is open useEffect(() => { if (isMenuOpen) { @@ -140,7 +153,7 @@ export default function Home() { return (
{/* Top Navigation */} -
+