feat: implement multi-tier progressive gradient blur canopy on navbar
This commit is contained in:
+122
-69
@@ -35,76 +35,132 @@ export function Navbar({ config, currentLocale }: NavbarProps) {
|
||||
}, [mobileMenuOpen]);
|
||||
|
||||
return (
|
||||
<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" />
|
||||
<header className="fixed top-0 left-0 right-0 w-full z-50 pointer-events-none transition-all duration-300">
|
||||
{/* 1. Progressive Multi-Tier Gradient Blur Canopy (Extends 120px down from the top) */}
|
||||
<div className="absolute top-0 inset-x-0 h-[120px] sm:h-[135px] pointer-events-none overflow-hidden select-none">
|
||||
{/* Tier 1: Deep subtle blur (softest edge at the bottom) */}
|
||||
<div
|
||||
className="absolute inset-0 backdrop-blur-[2px]"
|
||||
style={{
|
||||
maskImage: 'linear-gradient(to bottom, rgba(0,0,0,1) 0%, rgba(0,0,0,1) 40%, rgba(0,0,0,0) 100%)',
|
||||
WebkitMaskImage: 'linear-gradient(to bottom, rgba(0,0,0,1) 0%, rgba(0,0,0,1) 40%, rgba(0,0,0,0) 100%)',
|
||||
}}
|
||||
/>
|
||||
|
||||
{/* 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>
|
||||
{/* Tier 2: Low-mid progressive blur */}
|
||||
<div
|
||||
className="absolute inset-0 backdrop-blur-[6px]"
|
||||
style={{
|
||||
maskImage: 'linear-gradient(to bottom, rgba(0,0,0,1) 0%, rgba(0,0,0,1) 30%, rgba(0,0,0,0) 80%)',
|
||||
WebkitMaskImage: 'linear-gradient(to bottom, rgba(0,0,0,1) 0%, rgba(0,0,0,1) 30%, rgba(0,0,0,0) 80%)',
|
||||
}}
|
||||
/>
|
||||
|
||||
{/* 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>
|
||||
);
|
||||
})}
|
||||
{/* Tier 3: Medium progressive blur */}
|
||||
<div
|
||||
className="absolute inset-0 backdrop-blur-[12px]"
|
||||
style={{
|
||||
maskImage: 'linear-gradient(to bottom, rgba(0,0,0,1) 0%, rgba(0,0,0,1) 22%, rgba(0,0,0,0) 65%)',
|
||||
WebkitMaskImage: 'linear-gradient(to bottom, rgba(0,0,0,1) 0%, rgba(0,0,0,1) 22%, rgba(0,0,0,0) 65%)',
|
||||
}}
|
||||
/>
|
||||
|
||||
{/* 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>
|
||||
{/* Tier 4: Strong progressive blur */}
|
||||
<div
|
||||
className="absolute inset-0 backdrop-blur-[24px]"
|
||||
style={{
|
||||
maskImage: 'linear-gradient(to bottom, rgba(0,0,0,1) 0%, rgba(0,0,0,1) 15%, rgba(0,0,0,0) 50%)',
|
||||
WebkitMaskImage: 'linear-gradient(to bottom, rgba(0,0,0,1) 0%, rgba(0,0,0,1) 15%, rgba(0,0,0,0) 50%)',
|
||||
}}
|
||||
/>
|
||||
|
||||
{/* 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>
|
||||
{/* Tier 5: Ultra dense frosted blur under the main header */}
|
||||
<div
|
||||
className="absolute inset-0 backdrop-blur-[40px]"
|
||||
style={{
|
||||
maskImage: 'linear-gradient(to bottom, rgba(0,0,0,1) 0%, rgba(0,0,0,1) 10%, rgba(0,0,0,0) 40%)',
|
||||
WebkitMaskImage: 'linear-gradient(to bottom, rgba(0,0,0,1) 0%, rgba(0,0,0,1) 10%, rgba(0,0,0,0) 40%)',
|
||||
}}
|
||||
/>
|
||||
|
||||
{/* 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>
|
||||
{/* Progressive Color Tint: Melts scrolling content softly into the warm page canvas background (#FAF8F5) */}
|
||||
<div
|
||||
className="absolute inset-0 bg-gradient-to-b from-[#FAF8F5] via-[#FAF8F5]/92 to-transparent pointer-events-none"
|
||||
style={{
|
||||
maskImage: 'linear-gradient(to bottom, rgba(0,0,0,1) 0%, rgba(0,0,0,1) 45%, rgba(0,0,0,0) 95%)',
|
||||
WebkitMaskImage: 'linear-gradient(to bottom, rgba(0,0,0,1) 0%, rgba(0,0,0,1) 45%, rgba(0,0,0,0) 95%)',
|
||||
}}
|
||||
/>
|
||||
|
||||
{/* Soft feather at bottom */}
|
||||
<div className="absolute bottom-0 inset-x-0 h-6 bg-gradient-to-b from-transparent to-[#FAF8F5]/0 pointer-events-none" />
|
||||
</div>
|
||||
|
||||
{/* 2. 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 z-30" />
|
||||
|
||||
{/* 3. Main Aligned Edge-to-Edge Navigation Bar */}
|
||||
<div className={`relative z-30 pointer-events-auto transition-all duration-300 ${isScrolled ? 'py-3' : 'py-3.5 sm:py-4'}`}>
|
||||
<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>
|
||||
|
||||
{/* 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>
|
||||
);
|
||||
})}
|
||||
|
||||
{/* 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>
|
||||
|
||||
{/* 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>
|
||||
</div>
|
||||
|
||||
@@ -113,7 +169,7 @@ export function Navbar({ config, currentLocale }: NavbarProps) {
|
||||
<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"
|
||||
className="md:hidden mt-1 pointer-events-auto 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) => {
|
||||
@@ -159,9 +215,6 @@ 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>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user