2026-11-03 12:24:43 +05:30
|
|
|
'use client';
|
|
|
|
|
|
2026-11-04 12:28:32 +05:30
|
|
|
import React, { useState, useEffect } from 'react';
|
2026-11-03 12:24:43 +05:30
|
|
|
import Link from 'next/link';
|
|
|
|
|
import { usePathname } from 'next/navigation';
|
2026-11-05 12:32:38 +05:30
|
|
|
import {
|
|
|
|
|
Menu,
|
|
|
|
|
X,
|
|
|
|
|
Smartphone,
|
|
|
|
|
Layers,
|
|
|
|
|
ArrowUpRight,
|
|
|
|
|
Home,
|
|
|
|
|
ChevronRight,
|
|
|
|
|
Wrench,
|
|
|
|
|
Sparkles,
|
|
|
|
|
ShieldCheck
|
|
|
|
|
} from 'lucide-react';
|
2026-11-03 12:24:43 +05:30
|
|
|
import { SiteConfig, resolveLocalised } from '@/types';
|
2026-11-03 12:54:41 +05:30
|
|
|
import { BrandLogo } from './BrandLogo';
|
2026-11-03 12:24:43 +05:30
|
|
|
|
|
|
|
|
interface NavbarProps {
|
|
|
|
|
config: SiteConfig;
|
|
|
|
|
currentLocale: string;
|
|
|
|
|
}
|
|
|
|
|
|
2026-11-03 12:31:06 +05:30
|
|
|
export function Navbar({ config, currentLocale }: NavbarProps) {
|
2026-11-03 12:24:43 +05:30
|
|
|
const [isScrolled, setIsScrolled] = useState(false);
|
|
|
|
|
const [mobileMenuOpen, setMobileMenuOpen] = useState(false);
|
|
|
|
|
const pathname = usePathname();
|
|
|
|
|
|
|
|
|
|
useEffect(() => {
|
2026-11-05 15:44:10 +05:30
|
|
|
let lastScrolled = window.scrollY > 20;
|
|
|
|
|
if (lastScrolled !== isScrolled) {
|
|
|
|
|
setIsScrolled(lastScrolled);
|
|
|
|
|
}
|
2026-11-03 12:24:43 +05:30
|
|
|
const handleScroll = () => {
|
2026-11-05 15:44:10 +05:30
|
|
|
const nextScrolled = window.scrollY > 20;
|
|
|
|
|
if (nextScrolled !== lastScrolled) {
|
|
|
|
|
lastScrolled = nextScrolled;
|
|
|
|
|
setIsScrolled(nextScrolled);
|
|
|
|
|
}
|
2026-11-03 12:24:43 +05:30
|
|
|
};
|
2026-11-03 12:31:06 +05:30
|
|
|
window.addEventListener('scroll', handleScroll, { passive: true });
|
2026-11-03 12:24:43 +05:30
|
|
|
return () => window.removeEventListener('scroll', handleScroll);
|
|
|
|
|
}, []);
|
|
|
|
|
|
2026-11-05 12:32:38 +05:30
|
|
|
// Close mobile menu on Escape key
|
2026-11-03 18:30:13 +05:30
|
|
|
useEffect(() => {
|
|
|
|
|
if (!mobileMenuOpen) return;
|
|
|
|
|
const closeOnEscape = (event: KeyboardEvent) => {
|
|
|
|
|
if (event.key === 'Escape') setMobileMenuOpen(false);
|
|
|
|
|
};
|
|
|
|
|
document.addEventListener('keydown', closeOnEscape);
|
|
|
|
|
return () => document.removeEventListener('keydown', closeOnEscape);
|
|
|
|
|
}, [mobileMenuOpen]);
|
|
|
|
|
|
2026-11-05 12:32:38 +05:30
|
|
|
// Lock body scroll on iOS/Mobile when mobile menu is open to prevent background bleed/scroll
|
|
|
|
|
useEffect(() => {
|
|
|
|
|
if (mobileMenuOpen) {
|
|
|
|
|
document.body.style.overflow = 'hidden';
|
|
|
|
|
document.body.style.touchAction = 'none';
|
|
|
|
|
} else {
|
|
|
|
|
document.body.style.overflow = '';
|
|
|
|
|
document.body.style.touchAction = '';
|
|
|
|
|
}
|
|
|
|
|
return () => {
|
|
|
|
|
document.body.style.overflow = '';
|
|
|
|
|
document.body.style.touchAction = '';
|
|
|
|
|
};
|
|
|
|
|
}, [mobileMenuOpen]);
|
2026-11-03 12:24:43 +05:30
|
|
|
|
2026-11-05 12:32:38 +05:30
|
|
|
return (
|
|
|
|
|
<header
|
|
|
|
|
className={`fixed top-0 left-0 right-0 w-full z-50 transition-colors duration-200 ${
|
|
|
|
|
mobileMenuOpen
|
|
|
|
|
? 'bg-[#FAF8F5] pointer-events-auto border-b border-slate-200/90 shadow-sm'
|
|
|
|
|
: 'pointer-events-none'
|
|
|
|
|
}`}
|
|
|
|
|
>
|
|
|
|
|
{/* 1. Ultra-Smooth High-Performance Gradient Blur Canopy (Active only when menu is closed) */}
|
|
|
|
|
{!mobileMenuOpen && (
|
|
|
|
|
<div className="absolute top-0 inset-x-0 h-28 sm:h-32 pointer-events-none overflow-hidden select-none">
|
|
|
|
|
<div
|
|
|
|
|
className="absolute inset-0 backdrop-blur-md"
|
|
|
|
|
style={{
|
|
|
|
|
maskImage: 'linear-gradient(to bottom, rgba(0,0,0,1) 0%, rgba(0,0,0,1) 45%, rgba(0,0,0,0) 100%)',
|
|
|
|
|
WebkitMaskImage: 'linear-gradient(to bottom, rgba(0,0,0,1) 0%, rgba(0,0,0,1) 45%, rgba(0,0,0,0) 100%)',
|
|
|
|
|
}}
|
|
|
|
|
/>
|
|
|
|
|
<div
|
|
|
|
|
className="absolute inset-0 bg-gradient-to-b from-[#FAF8F5] via-[#FAF8F5]/85 to-transparent pointer-events-none"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
)}
|
2026-11-04 12:55:21 +05:30
|
|
|
|
|
|
|
|
{/* 2. Top Prismatic Micro-Highlight */}
|
2026-11-05 12:32:38 +05:30
|
|
|
{!mobileMenuOpen && (
|
|
|
|
|
<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" />
|
|
|
|
|
)}
|
2026-11-04 12:55:21 +05:30
|
|
|
|
|
|
|
|
{/* 3. Main Aligned Edge-to-Edge Navigation Bar */}
|
2026-11-04 18:48:24 +05:30
|
|
|
<div className="relative z-30 pointer-events-auto py-3 sm:py-3.5">
|
2026-11-04 18:05:26 +05:30
|
|
|
<div className="max-w-[1640px] mx-auto px-4 sm:px-6 lg:px-10 flex items-center justify-between">
|
2026-11-04 12:55:21 +05:30
|
|
|
{/* Brand Logo */}
|
|
|
|
|
<div className="relative z-20 flex-shrink-0">
|
|
|
|
|
<BrandLogo size="md" />
|
|
|
|
|
</div>
|
|
|
|
|
|
2026-11-05 12:32:38 +05:30
|
|
|
{/* Center Navigation Links - Protected Optical Floating Pill (Desktop only) */}
|
2026-11-04 12:55:21 +05:30
|
|
|
<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">
|
2026-11-04 17:55:18 +05:30
|
|
|
{/* Dedicated Top Home Button */}
|
|
|
|
|
<Link
|
|
|
|
|
href="/"
|
|
|
|
|
aria-current={pathname === '/' ? 'page' : undefined}
|
2026-11-04 18:48:24 +05:30
|
|
|
className={`relative flex items-center gap-1.5 px-4 py-2 rounded-full text-xs font-bold tracking-wide transition-[background-color,color,box-shadow] duration-200 ease-[cubic-bezier(0.16,1,0.3,1)] ${
|
2026-11-04 17:55:18 +05:30
|
|
|
pathname === '/'
|
|
|
|
|
? 'text-blue-700 bg-white shadow-sm border border-slate-900/[0.06]'
|
|
|
|
|
: 'text-slate-800 hover:text-slate-950 hover:bg-white/60'
|
|
|
|
|
}`}
|
|
|
|
|
>
|
|
|
|
|
<Home className="w-3.5 h-3.5" />
|
|
|
|
|
<span>Home</span>
|
|
|
|
|
</Link>
|
|
|
|
|
|
2026-11-04 12:55:21 +05:30
|
|
|
{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}
|
2026-11-04 18:48:24 +05:30
|
|
|
className={`relative px-4 py-2 rounded-full text-xs font-bold tracking-wide transition-[background-color,color,box-shadow] duration-200 ease-[cubic-bezier(0.16,1,0.3,1)] ${
|
2026-11-04 12:55:21 +05:30
|
|
|
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>
|
|
|
|
|
|
2026-11-05 12:32:38 +05:30
|
|
|
{/* Right CTA Button (Desktop only) */}
|
2026-11-04 12:55:21 +05:30
|
|
|
<div className="hidden md:flex items-center space-x-3 relative z-20 flex-shrink-0">
|
|
|
|
|
<Link
|
|
|
|
|
href={config.nav.cta.href}
|
2026-11-04 18:48:24 +05:30
|
|
|
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-[transform,opacity,box-shadow] duration-300 ease-[cubic-bezier(0.16,1,0.3,1)] hover:scale-105 active:scale-95"
|
2026-11-04 12:55:21 +05:30
|
|
|
>
|
|
|
|
|
<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)}
|
2026-11-05 12:32:38 +05:30
|
|
|
className="p-2.5 rounded-xl text-slate-800 bg-white hover:bg-slate-50 border border-slate-200/90 shadow-sm transition-colors active:scale-95"
|
2026-11-04 12:55:21 +05:30
|
|
|
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>
|
2026-11-03 12:24:43 +05:30
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
2026-11-05 12:32:38 +05:30
|
|
|
{/* Mobile Solid Opaque Drawer (100% Solid Warm Canvas - Zero Transparency Bleed or Text Collision) */}
|
2026-11-03 12:24:43 +05:30
|
|
|
{mobileMenuOpen && (
|
2026-11-04 12:46:47 +05:30
|
|
|
<nav
|
|
|
|
|
id="mobile-navigation"
|
|
|
|
|
aria-label="Mobile navigation"
|
2026-11-05 12:32:38 +05:30
|
|
|
className="md:hidden fixed inset-x-0 top-[60px] sm:top-[68px] bottom-0 z-50 bg-[#FAF8F5] overflow-y-auto px-4 py-5 flex flex-col justify-between pointer-events-auto border-t border-slate-200/90 animate-in fade-in duration-200"
|
2026-11-04 12:46:47 +05:30
|
|
|
>
|
2026-11-05 12:32:38 +05:30
|
|
|
<div className="w-full max-w-md mx-auto space-y-2.5">
|
|
|
|
|
{/* Home Card */}
|
2026-11-04 17:55:18 +05:30
|
|
|
<Link
|
|
|
|
|
href="/"
|
|
|
|
|
onClick={() => setMobileMenuOpen(false)}
|
|
|
|
|
aria-current={pathname === '/' ? 'page' : undefined}
|
2026-11-05 12:32:38 +05:30
|
|
|
className={`flex items-center justify-between px-4 py-3.5 rounded-2xl text-sm font-semibold transition-all border ${
|
2026-11-04 17:55:18 +05:30
|
|
|
pathname === '/'
|
2026-11-05 12:32:38 +05:30
|
|
|
? 'text-blue-700 bg-white border-blue-200 shadow-sm'
|
|
|
|
|
: 'text-slate-800 bg-white hover:bg-slate-50 border-slate-200/80 shadow-xs'
|
2026-11-04 17:55:18 +05:30
|
|
|
}`}
|
|
|
|
|
>
|
2026-11-05 12:32:38 +05:30
|
|
|
<div className="flex items-center gap-3">
|
|
|
|
|
<div className="w-9 h-9 rounded-xl bg-blue-50 flex items-center justify-center text-blue-600">
|
|
|
|
|
<Home className="w-4 h-4" />
|
|
|
|
|
</div>
|
|
|
|
|
<span className="text-sm font-bold">Home</span>
|
|
|
|
|
</div>
|
|
|
|
|
<ChevronRight className="w-4 h-4 text-slate-400" />
|
2026-11-04 17:55:18 +05:30
|
|
|
</Link>
|
|
|
|
|
|
2026-11-05 12:32:38 +05:30
|
|
|
{/* Header Navigation Cards */}
|
2026-11-03 12:54:41 +05:30
|
|
|
{config.nav.header.map((item) => {
|
2026-11-03 18:30:13 +05:30
|
|
|
const active = pathname === item.href || (item.href !== '/' && pathname.startsWith(`${item.href}/`));
|
2026-11-05 12:32:38 +05:30
|
|
|
|
|
|
|
|
let Icon = Wrench;
|
|
|
|
|
let iconColor = 'text-indigo-600';
|
|
|
|
|
let iconBg = 'bg-indigo-50';
|
|
|
|
|
if (item.href.includes('app')) {
|
|
|
|
|
Icon = Smartphone;
|
|
|
|
|
iconColor = 'text-sky-600';
|
|
|
|
|
iconBg = 'bg-sky-50';
|
|
|
|
|
} else if (item.href.includes('pricing')) {
|
|
|
|
|
Icon = Sparkles;
|
|
|
|
|
iconColor = 'text-amber-600';
|
|
|
|
|
iconBg = 'bg-amber-50';
|
|
|
|
|
} else if (item.href.includes('trust')) {
|
|
|
|
|
Icon = ShieldCheck;
|
|
|
|
|
iconColor = 'text-emerald-600';
|
|
|
|
|
iconBg = 'bg-emerald-50';
|
|
|
|
|
}
|
|
|
|
|
|
2026-11-03 12:54:41 +05:30
|
|
|
return (
|
|
|
|
|
<Link
|
|
|
|
|
key={item.href}
|
|
|
|
|
href={item.href}
|
|
|
|
|
onClick={() => setMobileMenuOpen(false)}
|
2026-11-03 18:30:13 +05:30
|
|
|
aria-current={active ? 'page' : undefined}
|
2026-11-05 12:32:38 +05:30
|
|
|
className={`flex items-center justify-between px-4 py-3.5 rounded-2xl text-sm font-semibold transition-all border ${
|
2026-11-03 12:54:41 +05:30
|
|
|
active
|
2026-11-05 12:32:38 +05:30
|
|
|
? 'text-blue-700 bg-white border-blue-200 shadow-sm'
|
|
|
|
|
: 'text-slate-800 bg-white hover:bg-slate-50 border-slate-200/80 shadow-xs'
|
2026-11-03 12:54:41 +05:30
|
|
|
}`}
|
|
|
|
|
>
|
2026-11-05 12:32:38 +05:30
|
|
|
<div className="flex items-center gap-3">
|
|
|
|
|
<div className={`w-9 h-9 rounded-xl ${iconBg} flex items-center justify-center ${iconColor}`}>
|
|
|
|
|
<Icon className="w-4 h-4" />
|
|
|
|
|
</div>
|
|
|
|
|
<span className="text-sm font-bold">{resolveLocalised(item.label, currentLocale)}</span>
|
|
|
|
|
</div>
|
|
|
|
|
<ChevronRight className="w-4 h-4 text-slate-400" />
|
2026-11-03 12:54:41 +05:30
|
|
|
</Link>
|
|
|
|
|
);
|
|
|
|
|
})}
|
2026-11-03 14:30:31 +05:30
|
|
|
|
2026-11-05 12:32:38 +05:30
|
|
|
{/* Creative Suite Card */}
|
2026-11-03 12:54:41 +05:30
|
|
|
<Link
|
2026-11-03 13:16:16 +05:30
|
|
|
href="/#studio-suite"
|
2026-11-03 12:54:41 +05:30
|
|
|
onClick={() => setMobileMenuOpen(false)}
|
2026-11-05 12:32:38 +05:30
|
|
|
className="flex items-center justify-between px-4 py-3.5 rounded-2xl text-sm font-semibold text-blue-700 bg-blue-50/90 hover:bg-blue-100/90 border border-blue-200 transition-colors shadow-xs"
|
2026-11-03 12:54:41 +05:30
|
|
|
>
|
2026-11-05 12:32:38 +05:30
|
|
|
<div className="flex items-center gap-3">
|
|
|
|
|
<div className="w-9 h-9 rounded-xl bg-blue-600 text-white flex items-center justify-center shadow-xs">
|
|
|
|
|
<Layers className="w-4 h-4" />
|
|
|
|
|
</div>
|
|
|
|
|
<span className="text-sm font-bold">Creative Suite</span>
|
|
|
|
|
</div>
|
|
|
|
|
<ChevronRight className="w-4 h-4 text-blue-400" />
|
2026-11-03 12:54:41 +05:30
|
|
|
</Link>
|
|
|
|
|
</div>
|
|
|
|
|
|
2026-11-05 12:32:38 +05:30
|
|
|
{/* Bottom Primary Handoff Card */}
|
|
|
|
|
<div className="w-full max-w-md mx-auto pt-5 pb-3 border-t border-slate-200/90 mt-4 space-y-3">
|
2026-11-03 12:24:43 +05:30
|
|
|
<Link
|
|
|
|
|
href={config.nav.cta.href}
|
|
|
|
|
onClick={() => setMobileMenuOpen(false)}
|
2026-11-05 12:32:38 +05:30
|
|
|
className="flex items-center justify-center gap-2 w-full py-4 rounded-2xl text-sm font-bold text-white bg-gradient-to-r from-blue-600 via-indigo-600 to-blue-600 shadow-lg shadow-blue-500/25 active:scale-[0.98] transition-transform"
|
2026-11-03 12:24:43 +05:30
|
|
|
>
|
|
|
|
|
<Smartphone className="w-4 h-4" />
|
|
|
|
|
<span>{resolveLocalised(config.nav.cta.label, currentLocale)}</span>
|
2026-11-05 12:32:38 +05:30
|
|
|
<ArrowUpRight className="w-4 h-4 opacity-80" />
|
2026-11-03 12:24:43 +05:30
|
|
|
</Link>
|
2026-11-05 12:32:38 +05:30
|
|
|
<p className="text-center text-[11px] font-medium text-slate-500">
|
|
|
|
|
Zero Photo Retention • 100% Client-Side Privacy
|
|
|
|
|
</p>
|
2026-11-03 12:24:43 +05:30
|
|
|
</div>
|
2026-11-03 18:30:13 +05:30
|
|
|
</nav>
|
2026-11-03 12:24:43 +05:30
|
|
|
)}
|
|
|
|
|
</header>
|
|
|
|
|
);
|
|
|
|
|
}
|