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]);
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">
<div
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 ? 'nav-scrolled' : ''
}`}
>
<div className="relative z-20 flex items-center justify-between w-full">
{/* Brand Logo */}
<div className="relative z-20">
<BrandLogo size="md" />
</div>
<header
className={`fixed top-0 left-0 right-0 w-full z-50 transition-all duration-300 ${
isScrolled
? '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'
}`}
>
{/* Top Prismatic Micro-Highlight */}
<div className="absolute top-0 inset-x-0 h-[1px] bg-gradient-to-r from-transparent via-white/80 to-transparent pointer-events-none" />
{/* Center Navigation Links - Protected Optical Floating Pill */}
<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">
{config.nav.header.map((item) => {
const active = pathname === item.href || (item.href !== '/' && pathname.startsWith(`${item.href}/`));
return (
<Link
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>
);
})}
{/* Main Aligned Edge-to-Edge Container */}
<div className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 flex items-center justify-between">
{/* Brand Logo */}
<div className="relative z-20 flex-shrink-0">
<BrandLogo size="md" />
</div>
{/* Direct Anchor to Studio Suite */}
<Link
href="/#studio-suite"
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"
>
<Layers className="w-3.5 h-3.5 text-blue-600" />
<span>Creative Suite</span>
</Link>
</nav>
{/* Center Navigation Links - Protected Optical Floating Pill */}
<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">
{config.nav.header.map((item) => {
const active = pathname === item.href || (item.href !== '/' && pathname.startsWith(`${item.href}/`));
return (
<Link
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>
);
})}
{/* Right CTA Button */}
<div className="hidden md:flex items-center space-x-3 relative z-20">
<Link
href={config.nav.cta.href}
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"
>
<Smartphone className="w-3.5 h-3.5 lg:w-4 lg:h-4 text-white group-hover:rotate-6 transition-transform" />
<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" />
</Link>
</div>
{/* Direct Anchor to Studio Suite */}
<Link
href="/#studio-suite"
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"
>
<Layers className="w-3.5 h-3.5 text-blue-600" />
<span>Creative Suite</span>
</Link>
</nav>
{/* 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>
{/* Right CTA Button */}
<div className="hidden md:flex items-center space-x-3 relative z-20 flex-shrink-0">
<Link
href={config.nav.cta.href}
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"
>
<Smartphone className="w-3.5 h-3.5 lg:w-4 lg:h-4 text-white group-hover:rotate-6 transition-transform" />
<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" />
</Link>
</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>
{/* Mobile Drawer (Matching Liquid Glass Card) */}
{/* Mobile Drawer (Full width dropdown) */}
{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">
<div className="space-y-1">
<nav
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) => {
const active = pathname === item.href || (item.href !== '/' && pathname.startsWith(`${item.href}/`));
return (
@@ -139,7 +147,7 @@ export function Navbar({ config, currentLocale }: NavbarProps) {
</Link>
</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
href={config.nav.cta.href}
onClick={() => setMobileMenuOpen(false)}
@@ -151,6 +159,9 @@ export function Navbar({ config, currentLocale }: NavbarProps) {
</div>
</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>
);
}