Skip to content

Commit eb4e660

Browse files
committed
fix: navbar full width by default, shrinks on scroll
- Navbar is full width (100%) by default when not scrolled - Navbar shrinks to centered width when scrolled - Full width state has no rounded edges (rounded-none) - Scrolled state has rounded-full with shadow - Matches landing page behavior Fixes #3428 Signed-off-by: Dhruv Bharuka <iit2022015@iiitl.ac.in>
1 parent 215ee7d commit eb4e660

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

components/navbar/FloatingNavbar.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,19 +42,19 @@ export default function FloatingNavbar({ isBlogReadingPage }: FloatingNavbarProp
4242
const navPositionClasses = derivedBlogReadingPage
4343
? "relative top-0 z-40"
4444
: isScrolled
45-
? "fixed top-0 left-0 right-0 z-40"
46-
: "fixed top-6 left-1/2 -translate-x-1/2 z-40";
45+
? "fixed top-6 left-1/2 -translate-x-1/2 z-40"
46+
: "fixed top-0 left-0 right-0 z-40";
4747
const navWidthClasses = isScrolled
48-
? "w-full"
49-
: "w-[90%] md:w-[96%] md:max-w-6xl";
48+
? "w-[90%] md:w-[96%] md:max-w-6xl"
49+
: "w-full";
5050
const navPaddingClasses = isScrolled
5151
? "px-4 py-1.5 md:px-6 md:py-2 lg:px-8 lg:py-2.5"
5252
: "px-5 py-2 md:px-6 md:py-3 lg:px-8 lg:py-4";
5353
const navShadowClasses = derivedBlogReadingPage
5454
? ""
5555
: isScrolled
56-
? "shadow-none"
57-
: "shadow-[0_18px_44px_rgba(15,23,42,0.18)]";
56+
? "shadow-[0_18px_44px_rgba(15,23,42,0.18)]"
57+
: "shadow-none";
5858

5959
const navGlassClasses = derivedBlogReadingPage
6060
? glassNavReading
@@ -65,8 +65,8 @@ export default function FloatingNavbar({ isBlogReadingPage }: FloatingNavbarProp
6565
const navBorderRadius = derivedBlogReadingPage
6666
? "rounded-none"
6767
: isScrolled
68-
? "rounded-none"
69-
: "rounded-full";
68+
? "rounded-full"
69+
: "rounded-none";
7070

7171
return (
7272
<nav className={`${navPositionClasses} transition-all duration-300 ${navWidthClasses}`}>

0 commit comments

Comments
 (0)