fix: restrain white gradient to left, add subtle bottom fade, make navbar fixed & solid with exact config links, and fix our tools section on mobile
This commit is contained in:
@@ -13,28 +13,9 @@ interface NavbarProps {
|
||||
}
|
||||
|
||||
export function Navbar({ config, currentLocale }: NavbarProps) {
|
||||
const [isScrolled, setIsScrolled] = useState(false);
|
||||
const [mobileMenuOpen, setMobileMenuOpen] = useState(false);
|
||||
const pathname = usePathname();
|
||||
|
||||
// Fast, scroll-aware navbar transformation:
|
||||
// - Homepage at rest (scrollY <= 25): Transparent text buttons over dark hero
|
||||
// - As soon as scrolled (scrollY > 25) or on any other page: Transforms into solid navbar
|
||||
useEffect(() => {
|
||||
if (pathname !== '/') {
|
||||
setIsScrolled(true);
|
||||
return;
|
||||
}
|
||||
|
||||
const checkScroll = () => {
|
||||
setIsScrolled(window.scrollY > 25);
|
||||
};
|
||||
|
||||
checkScroll();
|
||||
window.addEventListener('scroll', checkScroll, { passive: true });
|
||||
return () => window.removeEventListener('scroll', checkScroll);
|
||||
}, [pathname]);
|
||||
|
||||
// Close mobile menu on Escape key
|
||||
useEffect(() => {
|
||||
if (!mobileMenuOpen) return;
|
||||
@@ -60,26 +41,15 @@ export function Navbar({ config, currentLocale }: NavbarProps) {
|
||||
};
|
||||
}, [mobileMenuOpen]);
|
||||
|
||||
// Whether we are at top of homepage on the dark hero
|
||||
const isHeroTransparent = pathname === '/' && !isScrolled;
|
||||
|
||||
return (
|
||||
<header
|
||||
className={`fixed top-0 left-0 right-0 w-full z-50 transition-[background-color,border-color,padding] duration-200 pointer-events-auto ${
|
||||
mobileMenuOpen
|
||||
? 'bg-[#FAF8F5] border-b border-slate-200/90 shadow-2xs'
|
||||
: isHeroTransparent
|
||||
? 'bg-transparent border-b border-transparent py-2.5 sm:py-3.5'
|
||||
: 'bg-[#FAF8F5]/96 border-b border-slate-200/80 shadow-2xs py-2 sm:py-2.5'
|
||||
}`}
|
||||
>
|
||||
<header className="fixed top-0 left-0 right-0 w-full z-50 bg-[#FAF8F5]/96 backdrop-blur-sm border-b border-slate-200/90 shadow-2xs py-2.5 sm:py-3 transition-colors duration-200 pointer-events-auto">
|
||||
<div className="max-w-[1640px] mx-auto px-4 sm:px-6 lg:px-10 flex items-center justify-between">
|
||||
{/* Brand Logo */}
|
||||
<div className="relative z-20 flex-shrink-0">
|
||||
<BrandLogo size="md" />
|
||||
</div>
|
||||
|
||||
{/* Center Navigation Links: Clean text buttons */}
|
||||
{/* Center Navigation Links: Clean text buttons matching site.config.json */}
|
||||
<nav className="hidden md:flex items-center gap-6 lg:gap-8 relative z-20">
|
||||
<Link
|
||||
href="/"
|
||||
@@ -92,13 +62,6 @@ export function Navbar({ config, currentLocale }: NavbarProps) {
|
||||
Home
|
||||
</Link>
|
||||
|
||||
<Link
|
||||
href="/#pricing"
|
||||
className="text-sm font-semibold text-slate-800 hover:text-blue-600 transition-colors"
|
||||
>
|
||||
Pricing
|
||||
</Link>
|
||||
|
||||
<Link
|
||||
href="/tools"
|
||||
className={`text-sm font-semibold transition-colors ${
|
||||
@@ -122,8 +85,23 @@ export function Navbar({ config, currentLocale }: NavbarProps) {
|
||||
</Link>
|
||||
|
||||
<Link
|
||||
href="/#home-faqs"
|
||||
className="text-sm font-semibold text-slate-800 hover:text-blue-600 transition-colors"
|
||||
href="/pricing"
|
||||
className={`text-sm font-semibold transition-colors ${
|
||||
pathname.startsWith('/pricing')
|
||||
? 'text-blue-600 font-bold'
|
||||
: 'text-slate-800 hover:text-blue-600'
|
||||
}`}
|
||||
>
|
||||
Pricing
|
||||
</Link>
|
||||
|
||||
<Link
|
||||
href="/trust"
|
||||
className={`text-sm font-semibold transition-colors ${
|
||||
pathname.startsWith('/trust')
|
||||
? 'text-blue-600 font-bold'
|
||||
: 'text-slate-800 hover:text-blue-600'
|
||||
}`}
|
||||
>
|
||||
Trust & Privacy
|
||||
</Link>
|
||||
@@ -181,7 +159,7 @@ export function Navbar({ config, currentLocale }: NavbarProps) {
|
||||
: 'text-slate-800 bg-white hover:bg-slate-50 border-slate-200/80 shadow-xs'
|
||||
}`}
|
||||
>
|
||||
<span>All AI Photo Tools</span>
|
||||
<span>Tools</span>
|
||||
</Link>
|
||||
|
||||
<Link
|
||||
@@ -193,13 +171,29 @@ export function Navbar({ config, currentLocale }: NavbarProps) {
|
||||
: 'text-slate-800 bg-white hover:bg-slate-50 border-slate-200/80 shadow-xs'
|
||||
}`}
|
||||
>
|
||||
<span>Mobile Apps Suite</span>
|
||||
<span>Apps</span>
|
||||
</Link>
|
||||
|
||||
<Link
|
||||
href="/#home-faqs"
|
||||
href="/pricing"
|
||||
onClick={() => setMobileMenuOpen(false)}
|
||||
className="flex items-center justify-between px-4 py-3.5 rounded-2xl text-sm font-semibold text-slate-800 bg-white hover:bg-slate-50 border border-slate-200/80 shadow-xs transition-all"
|
||||
className={`flex items-center justify-between px-4 py-3.5 rounded-2xl text-sm font-semibold transition-all border ${
|
||||
pathname.startsWith('/pricing')
|
||||
? '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'
|
||||
}`}
|
||||
>
|
||||
<span>Pricing</span>
|
||||
</Link>
|
||||
|
||||
<Link
|
||||
href="/trust"
|
||||
onClick={() => setMobileMenuOpen(false)}
|
||||
className={`flex items-center justify-between px-4 py-3.5 rounded-2xl text-sm font-semibold transition-all border ${
|
||||
pathname.startsWith('/trust')
|
||||
? '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'
|
||||
}`}
|
||||
>
|
||||
<span>Trust & Privacy</span>
|
||||
</Link>
|
||||
|
||||
Reference in New Issue
Block a user