feat: Implement auto-hiding navbar with scroll detection
Implements auto-hiding navbar functionality that provides users with more screen real estate while maintaining intuitive navigation access.
Problem The navbar remained constantly visible, taking up valuable screen space and reducing content visibility during scrolling sessions.
Solution Smart scroll detection: Hides navbar after scrolling down 100px, shows immediately on scroll up Always visible near top: Navbar stays visible when scroll position < 10px Smooth animations: 300ms CSS transform transitions without layout shifts Fixed positioning: Consistent navbar placement across all pages Proper scroll offsets: Anchored sections account for navbar height
Changes Made New hook: useAutoHidingNavbar.ts for reusable scroll detection logic Updated navbars: Both Home and Landing page navbars with auto-hide behavior Layout fixes: Added scroll-mt-16 to anchored sections and pt-16 content padding Transform animations: Smooth slide-up/down using CSS transforms
Files Modified frontend/src/hooks/useAutoHidingNavbar.ts (new) frontend/src/components/HomeComponents/Navbar/Navbar.tsx frontend/src/components/LandingComponents/Navbar/Navbar.tsx frontend/src/components/HomePage.tsx frontend/src/components/LandingPage.tsx frontend/src/components/LandingComponents/About/About.tsx frontend/src/components/LandingComponents/Contact/Contact.tsx frontend/src/components/LandingComponents/FAQ/FAQ.tsx frontend/src/components/LandingComponents/HowItWorks/HowItWorks.tsx
Testing Instructions Page load - Navbar should be visible at top Scroll down - Navbar hides after 100px scroll Scroll up - Navbar appears immediately Anchor links - Content appears below navbar without overlap Mobile viewport - Test responsive behavior Rapid scrolling - Verify smooth animations
UX Benefits 64px additional content space when scrolling Intuitive navigation access when needed Smooth, jarring-free interactions Better content focus during reading
Thank you for opening this PR!
Before a maintainer takes a look, it would be really helpful if you could walk through your changes using GitHub's review tools.
Please take a moment to:
- Check the "Files changed" tab
- Leave comments on any lines for functions, comments, etc. that are important, non-obvious, or may need attention
- Clarify decisions you made or areas you might be unsure about and/or any future updates being considered.
- Finally, submit all the comments!
More information on how to conduct a self review: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/reviewing-proposed-changes-in-a-pull-request
This helps make the review process smoother and gives us a clearer understanding of your thought process.
Once you've added your self-review, we'll continue from our side. Thank you!