feat: extend navbar to edges and dissolve scrolling content seamlessly inside it

This commit is contained in:
2026-11-04 12:46:47 +05:30
parent 6b2c0f92b3
commit a9b6080eeb
+77 -66
View File
@@ -35,79 +35,87 @@ export function Navbar({ config, currentLocale }: NavbarProps) {
}, [mobileMenuOpen]); }, [mobileMenuOpen]);
return ( return (
<header className="fixed top-3 sm:top-5 left-0 right-0 z-50 px-3 sm:px-6 lg:px-8 pointer-events-none transition-all duration-300"> <header
<div className={`fixed top-0 left-0 right-0 w-full z-50 transition-all duration-300 ${
className={`relative max-w-6xl mx-auto liquid-glass-nav rounded-2xl sm:rounded-[22px] px-3.5 sm:px-6 py-2.5 sm:py-3 flex items-center justify-between transition-all duration-300 pointer-events-auto ${ isScrolled
isScrolled ? 'nav-scrolled' : '' ? 'bg-[#FAF8F5] border-b border-slate-900/[0.08] shadow-[0_4px_20px_-4px_rgba(15,23,42,0.06)] py-3'
}`} : 'bg-[#FAF8F5]/95 backdrop-blur-md border-b border-slate-900/[0.04] py-3.5 sm:py-4'
> }`}
<div className="relative z-20 flex items-center justify-between w-full"> >
{/* Brand Logo */} {/* Top Prismatic Micro-Highlight */}
<div className="relative z-20"> <div className="absolute top-0 inset-x-0 h-[1px] bg-gradient-to-r from-transparent via-white/80 to-transparent pointer-events-none" />
<BrandLogo size="md" />
</div>
{/* Center Navigation Links - Protected Optical Floating Pill */} {/* Main Aligned Edge-to-Edge Container */}
<nav className="hidden md:flex items-center gap-1 px-2 py-1 rounded-full bg-white/55 backdrop-blur-md border border-white/70 shadow-sm relative z-20"> <div className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 flex items-center justify-between">
{config.nav.header.map((item) => { {/* Brand Logo */}
const active = pathname === item.href || (item.href !== '/' && pathname.startsWith(`${item.href}/`)); <div className="relative z-20 flex-shrink-0">
return ( <BrandLogo size="md" />
<Link </div>
key={item.href}
href={item.href}
aria-current={active ? 'page' : undefined}
className={`relative px-4 py-2 rounded-full text-xs font-bold tracking-wide transition-all duration-200 ${
active
? 'text-blue-700 bg-white shadow-sm border border-slate-900/[0.06]'
: 'text-slate-800 hover:text-slate-950 hover:bg-white/60'
}`}
>
{resolveLocalised(item.label, currentLocale)}
</Link>
);
})}
{/* Direct Anchor to Studio Suite */} {/* Center Navigation Links - Protected Optical Floating Pill */}
<Link <nav className="hidden md:flex items-center gap-1 px-2 py-1 rounded-full bg-white/60 backdrop-blur-md border border-white/80 shadow-sm relative z-20">
href="/#studio-suite" {config.nav.header.map((item) => {
className="flex items-center gap-1.5 px-4 py-2 rounded-full text-xs font-bold tracking-wide text-blue-700 hover:text-blue-900 hover:bg-blue-50/70 transition-colors" const active = pathname === item.href || (item.href !== '/' && pathname.startsWith(`${item.href}/`));
> return (
<Layers className="w-3.5 h-3.5 text-blue-600" /> <Link
<span>Creative Suite</span> key={item.href}
</Link> href={item.href}
</nav> aria-current={active ? 'page' : undefined}
className={`relative px-4 py-2 rounded-full text-xs font-bold tracking-wide transition-all duration-200 ${
active
? 'text-blue-700 bg-white shadow-sm border border-slate-900/[0.06]'
: 'text-slate-800 hover:text-slate-950 hover:bg-white/60'
}`}
>
{resolveLocalised(item.label, currentLocale)}
</Link>
);
})}
{/* Right CTA Button */} {/* Direct Anchor to Studio Suite */}
<div className="hidden md:flex items-center space-x-3 relative z-20"> <Link
<Link href="/#studio-suite"
href={config.nav.cta.href} className="flex items-center gap-1.5 px-4 py-2 rounded-full text-xs font-bold tracking-wide text-blue-700 hover:text-blue-900 hover:bg-blue-50/70 transition-colors"
className="group relative inline-flex items-center gap-1.5 lg:gap-2 px-3.5 py-2 lg:px-5 lg:py-2.5 rounded-full text-xs font-bold text-white bg-gradient-to-r from-blue-600 via-indigo-600 to-blue-600 hover:from-blue-700 hover:to-indigo-700 shadow-md shadow-blue-500/25 hover:shadow-lg hover:shadow-blue-500/35 transition-all duration-300 hover:scale-105 active:scale-95" >
> <Layers className="w-3.5 h-3.5 text-blue-600" />
<Smartphone className="w-3.5 h-3.5 lg:w-4 lg:h-4 text-white group-hover:rotate-6 transition-transform" /> <span>Creative Suite</span>
<span>{resolveLocalised(config.nav.cta.label, currentLocale)}</span> </Link>
<ArrowUpRight className="w-3.5 h-3.5 opacity-80 group-hover:translate-x-0.5 group-hover:-translate-y-0.5 transition-transform" /> </nav>
</Link>
</div>
{/* Mobile Menu Trigger */} {/* Right CTA Button */}
<div className="flex md:hidden items-center space-x-2 relative z-20"> <div className="hidden md:flex items-center space-x-3 relative z-20 flex-shrink-0">
<button <Link
onClick={() => setMobileMenuOpen(!mobileMenuOpen)} href={config.nav.cta.href}
className="p-2 rounded-xl text-slate-800 bg-white/80 hover:bg-white border border-white/90 shadow-sm transition-colors" className="group relative inline-flex items-center gap-1.5 lg:gap-2 px-3.5 py-2 lg:px-5 lg:py-2.5 rounded-full text-xs font-bold text-white bg-gradient-to-r from-blue-600 via-indigo-600 to-blue-600 hover:from-blue-700 hover:to-indigo-700 shadow-md shadow-blue-500/25 hover:shadow-lg hover:shadow-blue-500/35 transition-all duration-300 hover:scale-105 active:scale-95"
aria-label={mobileMenuOpen ? 'Close navigation menu' : 'Open navigation menu'} >
aria-expanded={mobileMenuOpen} <Smartphone className="w-3.5 h-3.5 lg:w-4 lg:h-4 text-white group-hover:rotate-6 transition-transform" />
aria-controls="mobile-navigation" <span>{resolveLocalised(config.nav.cta.label, currentLocale)}</span>
> <ArrowUpRight className="w-3.5 h-3.5 opacity-80 group-hover:translate-x-0.5 group-hover:-translate-y-0.5 transition-transform" />
{mobileMenuOpen ? <X className="w-5 h-5 text-blue-600" /> : <Menu className="w-5 h-5" />} </Link>
</button> </div>
</div>
{/* Mobile Menu Trigger */}
<div className="flex md:hidden items-center space-x-2 relative z-20">
<button
onClick={() => setMobileMenuOpen(!mobileMenuOpen)}
className="p-2 rounded-xl text-slate-800 bg-white/80 hover:bg-white border border-white/90 shadow-sm transition-colors"
aria-label={mobileMenuOpen ? 'Close navigation menu' : 'Open navigation menu'}
aria-expanded={mobileMenuOpen}
aria-controls="mobile-navigation"
>
{mobileMenuOpen ? <X className="w-5 h-5 text-blue-600" /> : <Menu className="w-5 h-5" />}
</button>
</div> </div>
</div> </div>
{/* Mobile Drawer (Matching Liquid Glass Card) */} {/* Mobile Drawer (Full width dropdown) */}
{mobileMenuOpen && ( {mobileMenuOpen && (
<nav id="mobile-navigation" aria-label="Mobile navigation" className="max-w-6xl mx-auto md:hidden mt-2 rounded-2xl liquid-glass-dropdown p-5 space-y-3 pointer-events-auto shadow-2xl animate-in slide-in-from-top-3 duration-200"> <nav
<div className="space-y-1"> id="mobile-navigation"
aria-label="Mobile navigation"
className="md:hidden mt-3 border-t border-slate-900/[0.08] bg-[#FAF8F5]/98 backdrop-blur-2xl p-5 space-y-3 shadow-2xl animate-in slide-in-from-top-2 duration-200"
>
<div className="max-w-7xl mx-auto space-y-1">
{config.nav.header.map((item) => { {config.nav.header.map((item) => {
const active = pathname === item.href || (item.href !== '/' && pathname.startsWith(`${item.href}/`)); const active = pathname === item.href || (item.href !== '/' && pathname.startsWith(`${item.href}/`));
return ( return (
@@ -139,7 +147,7 @@ export function Navbar({ config, currentLocale }: NavbarProps) {
</Link> </Link>
</div> </div>
<div className="pt-3 border-t border-slate-900/[0.06]"> <div className="pt-3 border-t border-slate-900/[0.06] max-w-7xl mx-auto">
<Link <Link
href={config.nav.cta.href} href={config.nav.cta.href}
onClick={() => setMobileMenuOpen(false)} onClick={() => setMobileMenuOpen(false)}
@@ -151,6 +159,9 @@ export function Navbar({ config, currentLocale }: NavbarProps) {
</div> </div>
</nav> </nav>
)} )}
{/* Optical Dissolve Edge (soft feather at bottom edge so content seamlessly melts inside it) */}
<div className="absolute -bottom-3 inset-x-0 h-3 bg-gradient-to-b from-[#FAF8F5] to-transparent pointer-events-none opacity-80" />
</header> </header>
); );
} }