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
Binary file not shown.

After

Width:  |  Height:  |  Size: 702 KiB

+79 -124
View File
@@ -263,149 +263,104 @@ export function HeroSection({
// ------------------------------------------------------------- // -------------------------------------------------------------
// 3. Pure Front Page Hero View (for homepage /): // 3. Pure Front Page Hero View (for homepage /):
// Ultra-refined Typography, Optical Crystal Prism & Ambient Particles // Matching User Reference Image: Image_homepage.jpg background,
// Left-aligned typography, pill buttons, and glass telemetry capsule
// ------------------------------------------------------------- // -------------------------------------------------------------
return ( return (
<section className="relative isolate min-h-[96vh] flex flex-col justify-center items-center text-center overflow-hidden bg-[#FAF8F5] pt-28 pb-20 px-4 sm:px-6 md:px-8 lg:px-12"> <section className="relative min-h-[92vh] sm:min-h-screen flex items-center overflow-hidden bg-black pt-20 sm:pt-24 pb-14 sm:pb-20">
{/* 1. MagicUI Ambient Floating Particles (Desktop only, 0% CPU on mobile/tablets) */} {/* 1. Background Image with Left Dark Gradient Overlay */}
<Particles <div className="absolute inset-0 z-0">
className="absolute inset-0 -z-20 opacity-40 pointer-events-none" <img
quantity={15} src="/management/pages/home/Image_homepage.jpg"
color="#3b82f6" alt="CRE AI Photo Magic"
size={0.7} className="w-full h-full object-cover object-[75%_center] sm:object-right-top select-none pointer-events-none"
/> loading="eager"
decoding="async"
{/* 2. Interactive 3D WebGL Crystal Prism Canvas (Desktop Only - Completely Removed on Phones & Mobile Devices) */} />
<div className="hidden lg:flex absolute inset-0 -z-10 items-center justify-center pointer-events-none select-none overflow-hidden"> {/* Dark Gradient Overlay for Maximum Text Readability */}
<div className="w-[1000px] h-[1000px] lg:w-[1300px] lg:h-[1300px] opacity-85 transform-gpu transition-opacity duration-1000"> <div className="absolute inset-0 bg-gradient-to-r from-black/95 via-black/75 to-black/30 sm:via-black/55 sm:to-transparent" />
<Hero3DCanvas className="w-full h-full" /> {/* Smooth Bottom Blend to Section Below */}
</div> <div className="absolute inset-x-0 bottom-0 h-28 bg-gradient-to-t from-[#FAF8F5] via-[#FAF8F5]/70 to-transparent pointer-events-none" />
</div> </div>
{/* 3. Radiant Multidimensional Chromatic Glow Mesh */} {/* 2. Left-Aligned Content Container */}
<div <div className="relative z-10 max-w-[1640px] w-full mx-auto px-4 sm:px-8 lg:px-14 flex flex-col justify-center min-h-[90vh] sm:min-h-[92vh]">
className="absolute inset-0 -z-30 pointer-events-none" <div className="max-w-2xl sm:max-w-3xl">
style={{ {/* Masterpiece Headline */}
background: 'radial-gradient(circle at 50% 36%, rgba(59,130,246,0.12) 0%, rgba(99,102,241,0.08) 32%, rgba(6,182,212,0.04) 55%, transparent 75%)', <h1 className="text-4xl sm:text-6xl md:text-7xl lg:text-[5.2rem] font-display font-extrabold tracking-[-0.03em] leading-[1.06] text-left">
}} <span className="block text-white">
/>
<div
className="absolute inset-0 -z-30 pointer-events-none opacity-50"
style={{
background: 'radial-gradient(ellipse at 78% 22%, rgba(236,72,153,0.06) 0%, transparent 50%), radial-gradient(ellipse at 22% 68%, rgba(16,185,129,0.05) 0%, transparent 50%)',
}}
/>
<div className="absolute inset-x-0 bottom-0 h-40 bg-gradient-to-t from-[#FAF8F5] via-[#FAF8F5]/80 to-transparent -z-10 pointer-events-none" />
{/* 4. Center Hero Typography & Visual Atmosphere */}
<div className="relative z-10 max-w-6xl mx-auto flex flex-col items-center justify-center w-full">
{/* Grand Headline: Masterpiece Proportions, Zero Awkward Wraps */}
<h1 className="text-3xl sm:text-5xl md:text-6xl lg:text-[5.2rem] xl:text-[5.8rem] font-display font-extrabold tracking-[-0.035em] leading-[1.08] max-w-6xl mx-auto text-balance">
<span className="block text-slate-950 pb-1 sm:pb-2">
<TextAnimate animation="slideLeft" by="word">
Imagine. Transform. Imagine. Transform.
</TextAnimate> </span>
</span> <span className="block mt-1 sm:mt-2 bg-gradient-to-r from-blue-400 via-indigo-300 to-pink-400 bg-clip-text text-transparent">
<span className="block mt-1 sm:mt-2 text-blue-600 pb-3 sm:whitespace-nowrap font-black">
<TextAnimate animation="slideLeft" by="word" delay={0.06}>
Create the Impossible. Create the Impossible.
</TextAnimate>
</span>
</h1>
{/* Inspiring, Refined Editorial Subtitle */}
<p className="mt-6 sm:mt-7 text-base sm:text-lg md:text-xl text-slate-600/90 max-w-2xl sm:max-w-3xl mx-auto font-sans leading-relaxed tracking-[-0.01em] text-balance">
<TextAnimate animation="fadeIn" by="word" delay={0.12}>
Turn ordinary moments into extraordinary visual art. Instant, effortless, and private photo magic right in your browser.
</TextAnimate>
</p>
{/* Luxury CTA Action Buttons */}
<div className="mt-9 sm:mt-10 flex flex-wrap items-center justify-center gap-4 sm:gap-5">
<a
href={primaryCtaHref}
className="group relative inline-flex items-center gap-3 rounded-full bg-slate-950 px-8 sm:px-9 py-4 text-xs sm:text-sm font-semibold tracking-tight text-white border border-white/10 shadow-[0_4px_20px_-4px_rgba(15,23,42,0.3),0_0_0_1px_rgba(255,255,255,0.08)_inset] hover:shadow-[0_8px_30px_-6px_rgba(37,99,235,0.4),0_0_0_1px_rgba(59,130,246,0.3)] transition-all duration-300 ease-out hover:scale-[1.03] active:scale-[0.98] cursor-pointer"
>
<span>{primaryCtaLabel}</span>
<span className="w-6 h-6 rounded-full bg-white/10 flex items-center justify-center group-hover:bg-blue-600 transition-colors duration-300">
<ArrowDown className="w-3.5 h-3.5 transition-transform duration-300 ease-out group-hover:translate-y-0.5" />
</span> </span>
</a> </h1>
<a {/* Subtitle */}
href={secondaryCtaHref} <p className="mt-5 sm:mt-7 text-sm sm:text-base md:text-lg text-slate-200/90 max-w-xl text-left font-sans leading-relaxed">
className="group inline-flex items-center gap-2.5 rounded-full border border-slate-200/90 bg-white/80 hover:bg-white backdrop-blur-xl px-7 sm:px-8 py-4 text-xs sm:text-sm font-semibold tracking-tight text-slate-800 hover:text-slate-950 shadow-[0_4px_16px_-4px_rgba(15,23,42,0.06)] hover:shadow-[0_8px_24px_-6px_rgba(15,23,42,0.1)] hover:border-blue-400/60 transition-all duration-300 ease-out hover:scale-[1.03] active:scale-[0.98] cursor-pointer" Turn ordinary moments into extraordinary visual art, Instant, effortless, and private photo magic right in your browser.
> </p>
<Smartphone className="w-4 h-4 text-blue-600 group-hover:scale-110 transition-transform duration-300" />
<span>{secondaryCtaLabel}</span>
<span className="px-1.5 py-0.5 rounded text-[10px] font-mono font-bold bg-blue-50 text-blue-700 border border-blue-200/60">
iOS / Android
</span>
</a>
</div>
{/* Floating Glass Telemetry & Capability Capsule */} {/* Action Buttons */}
<div className="mt-14 sm:mt-16 w-full max-w-4xl mx-auto rounded-2xl sm:rounded-full bg-white/85 backdrop-blur-2xl border border-slate-900/[0.08] shadow-[0_16px_40px_-16px_rgba(15,23,42,0.08),0_0_0_1px_rgba(255,255,255,0.8)_inset] p-4 sm:py-5 sm:px-8 grid grid-cols-2 sm:flex sm:items-center sm:justify-around gap-4 sm:gap-6 text-center transform-gpu"> <div className="mt-8 sm:mt-10 flex flex-wrap items-center gap-3 sm:gap-4">
{/* Metric 1 */} <a
<div className="flex flex-col items-center justify-center p-2 sm:p-0"> href={primaryCtaHref}
<div className="text-2xl sm:text-3xl font-display font-black tracking-tight bg-gradient-to-b from-slate-950 via-slate-900 to-slate-700 bg-clip-text text-transparent"> className="px-7 sm:px-8 py-3.5 sm:py-4 rounded-full text-xs sm:text-sm font-bold text-white bg-blue-600 hover:bg-blue-500 shadow-lg shadow-blue-600/35 transition-all duration-200 hover:scale-105 active:scale-95 cursor-pointer"
1.4M+ >
</div> Explore Our Tools
<div className="text-[11px] font-mono font-semibold uppercase tracking-wider text-slate-500 mt-1"> </a>
Photos Transformed
</div> <a
href={secondaryCtaHref}
className="px-7 sm:px-8 py-3.5 sm:py-4 rounded-full text-xs sm:text-sm font-bold text-slate-950 bg-white hover:bg-slate-100 shadow-md transition-all duration-200 hover:scale-105 active:scale-95 cursor-pointer"
>
Recommended Apps
</a>
</div> </div>
<div className="hidden sm:block w-px h-10 bg-gradient-to-b from-transparent via-slate-200 to-transparent" /> {/* Glass Metrics Pill Capsule */}
<div className="mt-12 sm:mt-16 w-full max-w-2xl sm:max-w-3xl rounded-3xl sm:rounded-full bg-white/[0.06] backdrop-blur-xl border border-white/20 p-4 sm:py-4 sm:px-8 grid grid-cols-2 sm:grid-cols-4 gap-4 sm:gap-6 shadow-2xl">
{/* Metric 2 */} {/* Metric 1 */}
<div className="flex flex-col items-center justify-center p-2 sm:p-0"> <div className="flex flex-col text-left">
<div className="text-2xl sm:text-3xl font-display font-black tracking-tight bg-gradient-to-r from-blue-600 to-cyan-500 bg-clip-text text-transparent"> <span className="text-xl sm:text-2xl font-display font-black tracking-tight text-blue-400">
&lt; 0.8s 1.4M+
</span>
<span className="text-[11px] sm:text-xs text-slate-300 font-sans mt-0.5">
Photo Tranformed
</span>
</div> </div>
<div className="text-[11px] font-mono font-semibold uppercase tracking-wider text-slate-500 mt-1">
Instant Inference
</div>
</div>
<div className="hidden sm:block w-px h-10 bg-gradient-to-b from-transparent via-slate-200 to-transparent" /> {/* Metric 2 */}
<div className="flex flex-col text-left">
{/* Metric 3 */} <span className="text-xl sm:text-2xl font-display font-black tracking-tight text-indigo-300">
<div className="flex flex-col items-center justify-center p-2 sm:p-0"> &lt;0.8s
<div className="text-2xl sm:text-3xl font-display font-black tracking-tight bg-gradient-to-r from-emerald-600 to-teal-500 bg-clip-text text-transparent"> </span>
100% <span className="text-[11px] sm:text-xs text-slate-300 font-sans mt-0.5">
Instant Interene
</span>
</div> </div>
<div className="text-[11px] font-mono font-semibold uppercase tracking-wider text-slate-500 mt-1">
Client-Side Privacy
</div>
</div>
<div className="hidden sm:block w-px h-10 bg-gradient-to-b from-transparent via-slate-200 to-transparent" /> {/* Metric 3 */}
<div className="flex flex-col text-left">
{/* Metric 4 */} <span className="text-xl sm:text-2xl font-display font-black tracking-tight text-indigo-400">
<div className="flex flex-col items-center justify-center p-2 sm:p-0"> 100%
<div className="text-2xl sm:text-3xl font-display font-black tracking-tight bg-gradient-to-r from-indigo-600 via-purple-600 to-pink-500 bg-clip-text text-transparent"> </span>
4K UHD <span className="text-[11px] sm:text-xs text-slate-300 font-sans mt-0.5">
Client side privacy
</span>
</div> </div>
<div className="text-[11px] font-mono font-semibold uppercase tracking-wider text-slate-500 mt-1">
Studio Resolution {/* Metric 4 */}
<div className="flex flex-col text-left">
<span className="text-xl sm:text-2xl font-display font-black tracking-tight bg-gradient-to-r from-blue-300 via-indigo-300 to-pink-400 bg-clip-text text-transparent">
4K UHD
</span>
<span className="text-[11px] sm:text-xs text-slate-300 font-sans mt-0.5">
Studio Resolution
</span>
</div> </div>
</div> </div>
</div> </div>
{/* Subtle Luxury Scroll Cue */}
<a
href="#our-tools"
aria-label="Scroll to our tools"
className="mt-8 sm:mt-10 inline-flex flex-col items-center gap-2 text-[10px] font-mono uppercase tracking-widest text-slate-400 hover:text-blue-600 transition-colors group cursor-pointer"
>
<span className="font-semibold tracking-widest text-slate-400 group-hover:text-blue-600 transition-colors">
Scroll to Explore
</span>
<span className="w-4 h-7 rounded-full border border-slate-300 group-hover:border-blue-400 flex justify-center p-1 transition-colors">
<span className="w-1 h-1.5 rounded-full bg-blue-600 animate-bounce" />
</span>
</a>
</div> </div>
</section> </section>
); );
+87 -87
View File
@@ -359,103 +359,103 @@ export function ToolGridSection({
</div> </div>
)} )}
{/* Elegant Non-Sticky Category Hub & Search (Zero obstruction, no sticky bar under topbar) */} {/* Persistent Sticky Search & Category Hub - Never disappears when scrolling */}
{(showCategoryFilter || showSearch) && ( {(showCategoryFilter || showSearch) && (
<div className="mb-8 sm:mb-12 space-y-4"> <div className="sticky top-[52px] sm:top-[58px] z-30 -mx-4 sm:-mx-6 lg:-mx-8 px-4 sm:px-6 lg:px-8 py-2.5 sm:py-3 bg-[#FAF8F5]/95 backdrop-blur-md border-b border-slate-200/80 shadow-xs mb-8 sm:mb-12 transition-all">
{/* Search Bar - Center Aligned */} <div className="max-w-7xl mx-auto flex flex-col md:flex-row items-center justify-between gap-2.5 sm:gap-4">
{showSearch && ( {/* Category Navigation Pills */}
<div className="max-w-md mx-auto relative px-1"> {showCategoryFilter && (
<Search className="w-4 h-4 absolute left-4 top-1/2 -translate-y-1/2 text-slate-400 pointer-events-none" /> <div className="w-full md:w-auto flex items-center justify-start md:justify-center overflow-x-auto no-scrollbar scroll-smooth py-0.5">
<input <div className="flex items-center gap-1.5 sm:gap-2">
type="text" {/* All Categories Pill */}
placeholder="Search AI photo tools..." <button
value={searchQuery} onClick={() => {
onChange={(e) => setSearchQuery(e.target.value)} setSelectedCategory('all');
className="w-full pl-10 pr-9 py-2.5 rounded-full text-xs sm:text-sm border border-slate-200/90 bg-white text-slate-900 placeholder-slate-400 focus:outline-none focus:border-blue-500 focus:ring-2 focus:ring-blue-500/20 shadow-sm" if (searchQuery) setSearchQuery('');
/> }}
{searchQuery && ( className={`shrink-0 flex items-center gap-1.5 sm:gap-2 px-3 sm:px-3.5 py-1.5 sm:py-2 rounded-full text-xs font-bold transition-all duration-200 shadow-sm cursor-pointer ${
<button
onClick={() => setSearchQuery('')}
className="absolute right-4 top-1/2 -translate-y-1/2 text-slate-400 hover:text-slate-600 cursor-pointer"
>
<X className="w-3.5 h-3.5" />
</button>
)}
</div>
)}
{/* Category Navigation Dock:
- On desktop: Centered floating glass pill capsule dock
- On mobile: Smooth edge-padded horizontal touch rail */}
{showCategoryFilter && (
<div className="flex items-center justify-center">
<div className="flex items-center gap-1.5 sm:gap-2 overflow-x-auto no-scrollbar scroll-smooth py-1 px-2 max-w-full touch-pan-x sm:p-1.5 sm:bg-white/80 sm:backdrop-blur-md sm:rounded-full sm:border sm:border-slate-200/90 sm:shadow-sm">
{/* All Categories Pill */}
<button
onClick={() => {
setSelectedCategory('all');
if (searchQuery) setSearchQuery('');
}}
className={`shrink-0 flex items-center gap-1.5 sm:gap-2 px-3.5 sm:px-4 py-2 rounded-full text-xs font-bold transition-all duration-200 shadow-sm cursor-pointer ${
selectedCategory === 'all' && !searchQuery
? 'bg-blue-600 text-white shadow-blue-500/25 ring-2 ring-blue-500/30 scale-[1.02]'
: 'bg-white text-slate-700 hover:text-slate-900 hover:bg-slate-50 border border-slate-200/90 sm:border-transparent'
}`}
>
<Layers className="w-3.5 h-3.5" />
<span>All Tools</span>
<span
className={`text-[10px] font-mono px-1.5 py-0.2 rounded-full ${
selectedCategory === 'all' && !searchQuery selectedCategory === 'all' && !searchQuery
? 'bg-white/20 text-white' ? 'bg-blue-600 text-white shadow-blue-500/25 ring-2 ring-blue-500/30 scale-[1.02]'
: 'bg-slate-100 text-slate-600' : 'bg-white text-slate-700 hover:text-slate-900 hover:bg-slate-50 border border-slate-200/90'
}`} }`}
> >
{tools.length} <Layers className="w-3.5 h-3.5" />
</span> <span>All Tools</span>
</button> <span
className={`text-[10px] font-mono px-1.5 py-0.2 rounded-full ${
{/* Category Pills */} selectedCategory === 'all' && !searchQuery
{categorizedTools.map((group) => { ? 'bg-white/20 text-white'
const isSelected = : 'bg-slate-100 text-slate-600'
selectedCategory === group.id && !searchQuery;
const catName = group.category
? resolveLocalised(group.category.name, locale)
: group.id;
const theme = CATEGORY_THEMES[group.id];
return (
<button
key={group.id}
onClick={() => {
setSelectedCategory(group.id);
if (searchQuery) setSearchQuery('');
}}
className={`shrink-0 flex items-center gap-1.5 sm:gap-2 px-3 sm:px-3.5 py-2 rounded-full text-xs font-bold transition-all duration-200 shadow-sm cursor-pointer ${
isSelected
? 'bg-blue-600 text-white shadow-blue-500/25 ring-2 ring-blue-500/30 scale-[1.02]'
: 'bg-white text-slate-700 hover:text-slate-900 hover:bg-slate-50 border border-slate-200/90 sm:border-transparent'
}`} }`}
> >
<span className={isSelected ? 'text-white' : ''}> {tools.length}
{theme?.icon || <Wand2 className="w-4 h-4" />} </span>
</span> </button>
<span>{catName}</span>
<span {/* Category Pills */}
className={`text-[10px] font-mono px-1.5 py-0.2 rounded-full ${ {categorizedTools.map((group) => {
const isSelected =
selectedCategory === group.id && !searchQuery;
const catName = group.category
? resolveLocalised(group.category.name, locale)
: group.id;
const theme = CATEGORY_THEMES[group.id];
return (
<button
key={group.id}
onClick={() => {
setSelectedCategory(group.id);
if (searchQuery) setSearchQuery('');
}}
className={`shrink-0 flex items-center gap-1.5 sm:gap-2 px-3 sm:px-3.5 py-1.5 sm:py-2 rounded-full text-xs font-bold transition-all duration-200 shadow-sm cursor-pointer ${
isSelected isSelected
? 'bg-white/20 text-white' ? 'bg-blue-600 text-white shadow-blue-500/25 ring-2 ring-blue-500/30 scale-[1.02]'
: 'bg-slate-100 text-slate-600' : 'bg-white text-slate-700 hover:text-slate-900 hover:bg-slate-50 border border-slate-200/90'
}`} }`}
> >
{group.tools.length} <span className={isSelected ? 'text-white' : ''}>
</span> {theme?.icon || <Wand2 className="w-4 h-4" />}
</button> </span>
); <span>{catName}</span>
})} <span
className={`text-[10px] font-mono px-1.5 py-0.2 rounded-full ${
isSelected
? 'bg-white/20 text-white'
: 'bg-slate-100 text-slate-600'
}`}
>
{group.tools.length}
</span>
</button>
);
})}
</div>
</div> </div>
</div> )}
)}
{/* Search Bar */}
{showSearch && (
<div className="w-full md:w-64 lg:w-72 relative shrink-0">
<Search className="w-3.5 h-3.5 sm:w-4 sm:h-4 absolute left-3 top-1/2 -translate-y-1/2 text-slate-400 pointer-events-none" />
<input
type="text"
placeholder="Search AI photo tools..."
value={searchQuery}
onChange={(e) => setSearchQuery(e.target.value)}
className="w-full pl-8 sm:pl-9 pr-7 sm:pr-8 py-1.5 sm:py-2 rounded-full text-xs sm:text-sm border border-slate-200/90 bg-white text-slate-900 placeholder-slate-400 focus:outline-none focus:border-blue-500 focus:ring-2 focus:ring-blue-500/20 shadow-sm"
/>
{searchQuery && (
<button
onClick={() => setSearchQuery('')}
className="absolute right-2.5 top-1/2 -translate-y-1/2 text-slate-400 hover:text-slate-600 cursor-pointer"
>
<X className="w-3.5 h-3.5" />
</button>
)}
</div>
)}
</div>
</div> </div>
)} )}
+5 -3
View File
@@ -6,6 +6,7 @@ interface BrandLogoProps {
showWordmark?: boolean; showWordmark?: boolean;
className?: string; className?: string;
asLink?: boolean; asLink?: boolean;
isDark?: boolean;
} }
export function BrandLogo({ export function BrandLogo({
@@ -13,6 +14,7 @@ export function BrandLogo({
showWordmark = true, showWordmark = true,
className = '', className = '',
asLink = true, asLink = true,
isDark = false,
}: BrandLogoProps) { }: BrandLogoProps) {
const iconDimensions = { const iconDimensions = {
sm: { w: 34, h: 34, textScale: 'text-base', subText: 'text-[7px]' }, sm: { w: 34, h: 34, textScale: 'text-base', subText: 'text-[7px]' },
@@ -168,14 +170,14 @@ export function BrandLogo({
{showWordmark && ( {showWordmark && (
<div className="flex flex-col"> <div className="flex flex-col">
<div className="flex items-center tracking-tight leading-none"> <div className="flex items-center tracking-tight leading-none">
<span className={`font-display font-black text-transparent bg-clip-text bg-gradient-to-r from-blue-700 via-indigo-600 to-cyan-600 tracking-[0.1em] text-3d-gradient ${iconDimensions.textScale}`}> <span className={`font-display font-black text-transparent bg-clip-text bg-gradient-to-r from-blue-400 via-indigo-300 to-cyan-400 tracking-[0.1em] text-3d-gradient ${iconDimensions.textScale}`}>
CRE CRE
</span> </span>
<span className={`font-display font-bold text-slate-900 tracking-[0.16em] ml-1.5 text-3d-chiseled ${iconDimensions.textScale}`}> <span className={`font-display font-bold ${isDark ? 'text-white' : 'text-slate-900'} tracking-[0.16em] ml-1.5 transition-colors duration-200 ${iconDimensions.textScale}`}>
INNOVATIONS INNOVATIONS
</span> </span>
</div> </div>
<span className={`font-mono text-blue-600 tracking-[0.25em] uppercase font-semibold mt-0.5 ${iconDimensions.subText}`}> <span className={`font-mono ${isDark ? 'text-blue-400' : 'text-blue-600'} tracking-[0.25em] uppercase font-semibold mt-0.5 transition-colors duration-200 ${iconDimensions.subText}`}>
Neural Vision Studio Neural Vision Studio
</span> </span>
</div> </div>
+142 -192
View File
@@ -3,19 +3,8 @@
import React, { useState, useEffect } from 'react'; import React, { useState, useEffect } from 'react';
import Link from 'next/link'; import Link from 'next/link';
import { usePathname } from 'next/navigation'; import { usePathname } from 'next/navigation';
import { import { Menu, X } from 'lucide-react';
Menu, import { SiteConfig } from '@/types';
X,
Smartphone,
Layers,
ArrowUpRight,
Home,
ChevronRight,
Wrench,
Sparkles,
ShieldCheck
} from 'lucide-react';
import { SiteConfig, resolveLocalised } from '@/types';
import { BrandLogo } from './BrandLogo'; import { BrandLogo } from './BrandLogo';
interface NavbarProps { interface NavbarProps {
@@ -28,21 +17,19 @@ export function Navbar({ config, currentLocale }: NavbarProps) {
const [mobileMenuOpen, setMobileMenuOpen] = useState(false); const [mobileMenuOpen, setMobileMenuOpen] = useState(false);
const pathname = usePathname(); const pathname = usePathname();
// Track scroll position: transforms from text buttons into semi-solid navbar
useEffect(() => { useEffect(() => {
let lastScrolled = window.scrollY > 20;
if (lastScrolled !== isScrolled) {
setIsScrolled(lastScrolled);
}
const handleScroll = () => { const handleScroll = () => {
const nextScrolled = window.scrollY > 20; // On homepage, transform smoothly when scrolling towards the end of the hero image
if (nextScrolled !== lastScrolled) { const heroThreshold = typeof window !== 'undefined' ? Math.max(320, window.innerHeight * 0.7) : 450;
lastScrolled = nextScrolled; const threshold = pathname === '/' ? heroThreshold : 20;
setIsScrolled(nextScrolled); setIsScrolled(window.scrollY > threshold);
}
}; };
handleScroll();
window.addEventListener('scroll', handleScroll, { passive: true }); window.addEventListener('scroll', handleScroll, { passive: true });
return () => window.removeEventListener('scroll', handleScroll); return () => window.removeEventListener('scroll', handleScroll);
}, []); }, [pathname]);
// Close mobile menu on Escape key // Close mobile menu on Escape key
useEffect(() => { useEffect(() => {
@@ -54,7 +41,7 @@ export function Navbar({ config, currentLocale }: NavbarProps) {
return () => document.removeEventListener('keydown', closeOnEscape); return () => document.removeEventListener('keydown', closeOnEscape);
}, [mobileMenuOpen]); }, [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(() => { useEffect(() => {
if (mobileMenuOpen) { if (mobileMenuOpen) {
document.body.style.overflow = 'hidden'; document.body.style.overflow = 'hidden';
@@ -69,115 +56,119 @@ export function Navbar({ config, currentLocale }: NavbarProps) {
}; };
}, [mobileMenuOpen]); }, [mobileMenuOpen]);
// Whether we are at top of homepage on the dark hero
const isHeroTransparent = pathname === '/' && !isScrolled;
return ( return (
<header <header
className={`fixed top-0 left-0 right-0 w-full z-50 transition-colors duration-200 ${ className={`fixed top-0 left-0 right-0 w-full z-50 transition-all duration-300 pointer-events-auto ${
mobileMenuOpen mobileMenuOpen
? 'bg-[#FAF8F5] pointer-events-auto border-b border-slate-200/90 shadow-sm' ? 'bg-[#FAF8F5] border-b border-slate-200/90 shadow-sm'
: 'pointer-events-none' : 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) */} <div className="max-w-[1640px] mx-auto px-4 sm:px-6 lg:px-10 flex items-center justify-between">
{!mobileMenuOpen && ( {/* Brand Logo */}
<div className="absolute top-0 inset-x-0 h-16 sm:h-18 pointer-events-none overflow-hidden select-none"> <div className="relative z-20 flex-shrink-0">
<div <BrandLogo size="md" isDark={isHeroTransparent} />
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> </div>
)}
{/* 2. Top Prismatic Micro-Highlight */} {/* Center Navigation Links:
{!mobileMenuOpen && ( - On Hero: Clean white text buttons only (matching reference image)
<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" /> - 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 */} <Link
<div className="relative z-30 pointer-events-auto py-3 sm:py-3.5"> href="/#pricing"
<div className="max-w-[1640px] mx-auto px-4 sm:px-6 lg:px-10 flex items-center justify-between"> className={`text-sm font-semibold transition-colors ${
{/* Brand Logo */} isHeroTransparent
<div className="relative z-20 flex-shrink-0"> ? 'text-white/90 hover:text-white'
<BrandLogo size="md" /> : 'text-slate-800 hover:text-blue-600'
</div> }`}
>
Pricing
</Link>
{/* Center Navigation Links - Protected Optical Floating Pill (Desktop only) */} <Link
<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"> href="/tools"
{/* Dedicated Top Home Button */} className={`text-sm font-semibold transition-colors ${
<Link isHeroTransparent
href="/" ? 'text-white/90 hover:text-white'
aria-current={pathname === '/' ? 'page' : undefined} : pathname.startsWith('/tools')
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)] ${ ? 'text-blue-600 font-bold'
pathname === '/' : 'text-slate-800 hover:text-blue-600'
? 'text-blue-700 bg-white shadow-sm border border-slate-900/[0.06]' }`}
: 'text-slate-800 hover:text-slate-950 hover:bg-white/60' >
}`} Tools
> </Link>
<Home className="w-3.5 h-3.5" />
<span>Home</span>
</Link>
{config.nav.header.map((item) => { <Link
const active = pathname === item.href || (item.href !== '/' && pathname.startsWith(`${item.href}/`)); href="/apps"
return ( className={`text-sm font-semibold transition-colors ${
<Link isHeroTransparent
key={item.href} ? 'text-white/90 hover:text-white'
href={item.href} : pathname.startsWith('/apps')
aria-current={active ? 'page' : undefined} ? 'text-blue-600 font-bold'
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)] ${ : 'text-slate-800 hover:text-blue-600'
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' Apps
}`} </Link>
>
{resolveLocalised(item.label, currentLocale)}
</Link>
);
})}
{/* Direct Anchor to Studio Suite */} <Link
<Link href="/#home-faqs"
href="/#studio-suite" className={`text-sm font-semibold transition-colors ${
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" isHeroTransparent
> ? 'text-white/90 hover:text-white'
<Layers className="w-3.5 h-3.5 text-blue-600" /> : 'text-slate-800 hover:text-blue-600'
<span>Creative Suite</span> }`}
</Link> >
</nav> Trust & Privacy
</Link>
</nav>
{/* Right CTA Button (Desktop only) */} {/* 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"> <div className="hidden md:flex items-center space-x-3 relative z-20 flex-shrink-0">
<Link <Link
href={config.nav.cta.href} href="/apps"
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" 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"
> >
<Smartphone className="w-3.5 h-3.5 lg:w-4 lg:h-4 text-white group-hover:rotate-6 transition-transform" /> Get the App
<span>{resolveLocalised(config.nav.cta.label, currentLocale)}</span> </Link>
<ArrowUpRight className="w-3.5 h-3.5 opacity-80 group-hover:translate-x-0.5 group-hover:-translate-y-0.5 transition-transform" /> </div>
</Link>
</div>
{/* Mobile Menu Trigger */} {/* Mobile Menu Trigger */}
<div className="flex md:hidden items-center space-x-2 relative z-20"> <div className="flex md:hidden items-center space-x-2 relative z-20">
<button <button
onClick={() => setMobileMenuOpen(!mobileMenuOpen)} 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" className={`p-2.5 rounded-xl border transition-colors active:scale-95 ${
aria-label={mobileMenuOpen ? 'Close navigation menu' : 'Open navigation menu'} isHeroTransparent && !mobileMenuOpen
aria-expanded={mobileMenuOpen} ? 'text-white bg-white/10 hover:bg-white/20 border-white/20'
aria-controls="mobile-navigation" : 'text-slate-800 bg-white hover:bg-slate-50 border-slate-200/90 shadow-sm'
> }`}
{mobileMenuOpen ? <X className="w-5 h-5 text-blue-600" /> : <Menu className="w-5 h-5" />} aria-label={mobileMenuOpen ? 'Close navigation menu' : 'Open navigation menu'}
</button> aria-expanded={mobileMenuOpen}
</div> >
{mobileMenuOpen ? <X className="w-5 h-5 text-blue-600" /> : <Menu className="w-5 h-5" />}
</button>
</div> </div>
</div> </div>
{/* Mobile Solid Opaque Drawer (100% Solid Warm Canvas - Zero Transparency Bleed or Text Collision) */} {/* Mobile Drawer */}
{mobileMenuOpen && ( {mobileMenuOpen && (
<nav <nav
id="mobile-navigation" 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" 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"> <div className="w-full max-w-md mx-auto space-y-2.5">
{/* Home Card */}
<Link <Link
href="/" href="/"
onClick={() => setMobileMenuOpen(false)} 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 ${ className={`flex items-center justify-between px-4 py-3.5 rounded-2xl text-sm font-semibold transition-all border ${
pathname === '/' pathname === '/'
? 'text-blue-700 bg-white border-blue-200 shadow-sm' ? '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' : 'text-slate-800 bg-white hover:bg-slate-50 border-slate-200/80 shadow-xs'
}`} }`}
> >
<div className="flex items-center gap-3"> <span>Home</span>
<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" />
</Link> </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 <Link
href="/#studio-suite" href="/tools"
onClick={() => setMobileMenuOpen(false)} 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"> <span>All AI Photo Tools</span>
<div className="w-9 h-9 rounded-xl bg-blue-600 text-white flex items-center justify-center shadow-xs"> </Link>
<Layers className="w-4 h-4" />
</div> <Link
<span className="text-sm font-bold">Creative Suite</span> href="/apps"
</div> onClick={() => setMobileMenuOpen(false)}
<ChevronRight className="w-4 h-4 text-blue-400" /> 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> </Link>
</div> </div>
{/* Bottom Primary Handoff Card */} <div className="w-full max-w-md mx-auto pt-6 border-t border-slate-200/80">
<div className="w-full max-w-md mx-auto pt-5 pb-3 border-t border-slate-200/90 mt-4 space-y-3">
<Link <Link
href={config.nav.cta.href} href="/apps"
onClick={() => setMobileMenuOpen(false)} 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" /> Get the App
<span>{resolveLocalised(config.nav.cta.label, currentLocale)}</span>
<ArrowUpRight className="w-4 h-4 opacity-80" />
</Link> </Link>
<p className="text-center text-[11px] font-medium text-slate-500">
Zero Photo Retention • 100% Client-Side Privacy
</p>
</div> </div>
</nav> </nav>
)} )}