feat(homepage+tools): redesign hero with Image_homepage, transparent text buttons navbar, semi-solid transformation, and sticky persistent tools filter

This commit is contained in:
2026-11-05 17:04:30 +05:30
parent b23bd8e066
commit 44cb60ecfe
5 changed files with 313 additions and 406 deletions
+142 -192
View File
@@ -3,19 +3,8 @@
import React, { useState, useEffect } from 'react';
import Link from 'next/link';
import { usePathname } from 'next/navigation';
import {
Menu,
X,
Smartphone,
Layers,
ArrowUpRight,
Home,
ChevronRight,
Wrench,
Sparkles,
ShieldCheck
} from 'lucide-react';
import { SiteConfig, resolveLocalised } from '@/types';
import { Menu, X } from 'lucide-react';
import { SiteConfig } from '@/types';
import { BrandLogo } from './BrandLogo';
interface NavbarProps {
@@ -28,21 +17,19 @@ export function Navbar({ config, currentLocale }: NavbarProps) {
const [mobileMenuOpen, setMobileMenuOpen] = useState(false);
const pathname = usePathname();
// Track scroll position: transforms from text buttons into semi-solid navbar
useEffect(() => {
let lastScrolled = window.scrollY > 20;
if (lastScrolled !== isScrolled) {
setIsScrolled(lastScrolled);
}
const handleScroll = () => {
const nextScrolled = window.scrollY > 20;
if (nextScrolled !== lastScrolled) {
lastScrolled = nextScrolled;
setIsScrolled(nextScrolled);
}
// On homepage, transform smoothly when scrolling towards the end of the hero image
const heroThreshold = typeof window !== 'undefined' ? Math.max(320, window.innerHeight * 0.7) : 450;
const threshold = pathname === '/' ? heroThreshold : 20;
setIsScrolled(window.scrollY > threshold);
};
handleScroll();
window.addEventListener('scroll', handleScroll, { passive: true });
return () => window.removeEventListener('scroll', handleScroll);
}, []);
}, [pathname]);
// Close mobile menu on Escape key
useEffect(() => {
@@ -54,7 +41,7 @@ export function Navbar({ config, currentLocale }: NavbarProps) {
return () => document.removeEventListener('keydown', closeOnEscape);
}, [mobileMenuOpen]);
// Lock body scroll on iOS/Mobile when mobile menu is open to prevent background bleed/scroll
// Lock body scroll on iOS/Mobile when mobile menu is open
useEffect(() => {
if (mobileMenuOpen) {
document.body.style.overflow = 'hidden';
@@ -69,115 +56,119 @@ 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-colors duration-200 ${
mobileMenuOpen
? 'bg-[#FAF8F5] pointer-events-auto border-b border-slate-200/90 shadow-sm'
: 'pointer-events-none'
<header
className={`fixed top-0 left-0 right-0 w-full z-50 transition-all duration-300 pointer-events-auto ${
mobileMenuOpen
? 'bg-[#FAF8F5] border-b border-slate-200/90 shadow-sm'
: isHeroTransparent
? 'bg-transparent border-b border-transparent py-2 sm:py-3'
: 'bg-[#FAF8F5]/92 backdrop-blur-md border-b border-slate-200/80 shadow-sm py-2 sm:py-2.5'
}`}
>
{/* 1. Ultra-Smooth High-Performance Gradient Blur Canopy (Active only when menu is closed) */}
{!mobileMenuOpen && (
<div className="absolute top-0 inset-x-0 h-16 sm:h-18 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) 70%, rgba(0,0,0,0) 100%)',
WebkitMaskImage: 'linear-gradient(to bottom, rgba(0,0,0,1) 0%, rgba(0,0,0,1) 70%, rgba(0,0,0,0) 100%)',
}}
/>
<div
className="absolute inset-0 bg-gradient-to-b from-[#FAF8F5] via-[#FAF8F5]/90 to-transparent pointer-events-none"
/>
<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" isDark={isHeroTransparent} />
</div>
)}
{/* 2. Top Prismatic Micro-Highlight */}
{!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" />
)}
{/* Center Navigation Links:
- On Hero: Clean white text buttons only (matching reference image)
- Scrolled: Subtle semi-solid pill links */}
<nav className="hidden md:flex items-center gap-6 lg:gap-8 relative z-20">
<Link
href="/"
className={`text-sm font-semibold transition-colors ${
isHeroTransparent
? 'text-white hover:text-blue-300'
: pathname === '/'
? 'text-blue-600 font-bold'
: 'text-slate-800 hover:text-blue-600'
}`}
>
Home
</Link>
{/* 3. Main Aligned Edge-to-Edge Navigation Bar */}
<div className="relative z-30 pointer-events-auto py-3 sm:py-3.5">
<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>
<Link
href="/#pricing"
className={`text-sm font-semibold transition-colors ${
isHeroTransparent
? 'text-white/90 hover:text-white'
: 'text-slate-800 hover:text-blue-600'
}`}
>
Pricing
</Link>
{/* Center Navigation Links - Protected Optical Floating Pill (Desktop only) */}
<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">
{/* Dedicated Top Home Button */}
<Link
href="/"
aria-current={pathname === '/' ? 'page' : undefined}
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)] ${
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>
<Link
href="/tools"
className={`text-sm font-semibold transition-colors ${
isHeroTransparent
? 'text-white/90 hover:text-white'
: pathname.startsWith('/tools')
? 'text-blue-600 font-bold'
: 'text-slate-800 hover:text-blue-600'
}`}
>
Tools
</Link>
{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-[background-color,color,box-shadow] duration-200 ease-[cubic-bezier(0.16,1,0.3,1)] ${
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>
);
})}
<Link
href="/apps"
className={`text-sm font-semibold transition-colors ${
isHeroTransparent
? 'text-white/90 hover:text-white'
: pathname.startsWith('/apps')
? 'text-blue-600 font-bold'
: 'text-slate-800 hover:text-blue-600'
}`}
>
Apps
</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>
<Link
href="/#home-faqs"
className={`text-sm font-semibold transition-colors ${
isHeroTransparent
? 'text-white/90 hover:text-white'
: 'text-slate-800 hover:text-blue-600'
}`}
>
Trust & Privacy
</Link>
</nav>
{/* Right CTA Button (Desktop only) */}
<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-[transform,opacity,box-shadow] duration-300 ease-[cubic-bezier(0.16,1,0.3,1)] 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>
{/* Right CTA Button: Blue "Get the App" pill button */}
<div className="hidden md:flex items-center space-x-3 relative z-20 flex-shrink-0">
<Link
href="/apps"
className="px-5 py-2.5 rounded-full text-xs sm:text-sm font-bold text-white bg-blue-600 hover:bg-blue-500 shadow-md shadow-blue-500/30 transition-all duration-200 hover:scale-105 active:scale-95"
>
Get the App
</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.5 rounded-xl text-slate-800 bg-white hover:bg-slate-50 border border-slate-200/90 shadow-sm transition-colors active:scale-95"
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>
{/* Mobile Menu Trigger */}
<div className="flex md:hidden items-center space-x-2 relative z-20">
<button
onClick={() => setMobileMenuOpen(!mobileMenuOpen)}
className={`p-2.5 rounded-xl border transition-colors active:scale-95 ${
isHeroTransparent && !mobileMenuOpen
? 'text-white bg-white/10 hover:bg-white/20 border-white/20'
: 'text-slate-800 bg-white hover:bg-slate-50 border-slate-200/90 shadow-sm'
}`}
aria-label={mobileMenuOpen ? 'Close navigation menu' : 'Open navigation menu'}
aria-expanded={mobileMenuOpen}
>
{mobileMenuOpen ? <X className="w-5 h-5 text-blue-600" /> : <Menu className="w-5 h-5" />}
</button>
</div>
</div>
{/* Mobile Solid Opaque Drawer (100% Solid Warm Canvas - Zero Transparency Bleed or Text Collision) */}
{/* Mobile Drawer */}
{mobileMenuOpen && (
<nav
id="mobile-navigation"
@@ -185,100 +176,59 @@ export function Navbar({ config, currentLocale }: NavbarProps) {
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"
>
<div className="w-full max-w-md mx-auto space-y-2.5">
{/* Home Card */}
<Link
href="/"
onClick={() => setMobileMenuOpen(false)}
aria-current={pathname === '/' ? 'page' : undefined}
className={`flex items-center justify-between px-4 py-3.5 rounded-2xl text-sm font-semibold transition-all border ${
pathname === '/'
? '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'
}`}
>
<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" />
<span>Home</span>
</Link>
{/* Header Navigation Cards */}
{config.nav.header.map((item) => {
const active = pathname === item.href || (item.href !== '/' && pathname.startsWith(`${item.href}/`));
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';
}
return (
<Link
key={item.href}
href={item.href}
onClick={() => setMobileMenuOpen(false)}
aria-current={active ? 'page' : undefined}
className={`flex items-center justify-between px-4 py-3.5 rounded-2xl text-sm font-semibold transition-all border ${
active
? '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'
}`}
>
<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" />
</Link>
);
})}
{/* Creative Suite Card */}
<Link
href="/#studio-suite"
href="/tools"
onClick={() => setMobileMenuOpen(false)}
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"
className={`flex items-center justify-between px-4 py-3.5 rounded-2xl text-sm font-semibold transition-all border ${
pathname.startsWith('/tools')
? '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'
}`}
>
<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" />
<span>All AI Photo Tools</span>
</Link>
<Link
href="/apps"
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('/apps')
? '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>Mobile Apps Suite</span>
</Link>
<Link
href="/#home-faqs"
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"
>
<span>Trust & Privacy</span>
</Link>
</div>
{/* 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">
<div className="w-full max-w-md mx-auto pt-6 border-t border-slate-200/80">
<Link
href={config.nav.cta.href}
href="/apps"
onClick={() => setMobileMenuOpen(false)}
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"
className="w-full inline-flex items-center justify-center py-3.5 rounded-full text-sm font-bold text-white bg-blue-600 hover:bg-blue-700 shadow-md shadow-blue-500/25"
>
<Smartphone className="w-4 h-4" />
<span>{resolveLocalised(config.nav.cta.label, currentLocale)}</span>
<ArrowUpRight className="w-4 h-4 opacity-80" />
Get the App
</Link>
<p className="text-center text-[11px] font-medium text-slate-500">
Zero Photo Retention • 100% Client-Side Privacy
</p>
</div>
</nav>
)}