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:
@@ -283,11 +283,13 @@ export function HeroSection({
|
|||||||
decoding="async"
|
decoding="async"
|
||||||
/>
|
/>
|
||||||
</picture>
|
</picture>
|
||||||
{/* White / Cream Gradient Overlay for Radiant Light Aesthetic */}
|
{/* White / Cream Gradient Overlay: Restrained to left side so background artwork & glowing ribbons stay clearly visible */}
|
||||||
<div className="absolute inset-0 bg-gradient-to-r from-[#FAF8F5] via-[#FAF8F5]/90 to-transparent sm:from-[#FAF8F5] sm:via-[#FAF8F5]/80 sm:to-transparent pointer-events-none" />
|
<div className="absolute inset-0 bg-gradient-to-r from-[#FAF8F5]/90 via-[#FAF8F5]/40 via-30% to-transparent to-55% sm:via-30% sm:to-55% pointer-events-none" />
|
||||||
|
{/* Soft Bottom Fade to Seamlessly Blend with Upcoming Scroll Content */}
|
||||||
|
<div className="absolute inset-x-0 bottom-0 h-16 sm:h-20 bg-gradient-to-t from-[#FAF8F5] to-transparent pointer-events-none" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Zero-Overhead Scroll Sentinel for Navbar Transformation */}
|
{/* Zero-Overhead Scroll Sentinel */}
|
||||||
<div id="hero-sentinel" className="absolute bottom-28 left-0 w-full h-1 pointer-events-none opacity-0" aria-hidden="true" />
|
<div id="hero-sentinel" className="absolute bottom-28 left-0 w-full h-1 pointer-events-none opacity-0" aria-hidden="true" />
|
||||||
|
|
||||||
{/* 2. Left-Aligned Content Container */}
|
{/* 2. Left-Aligned Content Container */}
|
||||||
|
|||||||
@@ -177,12 +177,10 @@ function ShiftableRow({ items }: { items: ToolMediaItem[] }) {
|
|||||||
key={item.id}
|
key={item.id}
|
||||||
onMouseEnter={() => setHoveredId(item.id)}
|
onMouseEnter={() => setHoveredId(item.id)}
|
||||||
onMouseLeave={() => setHoveredId(null)}
|
onMouseLeave={() => setHoveredId(null)}
|
||||||
|
className="w-[82vw] max-w-[320px] md:max-w-none md:w-auto shrink-0 md:shrink md:flex-1 snap-start transition-[flex-grow] duration-700 ease-[cubic-bezier(0.16,1,0.3,1)] flex flex-col min-w-0"
|
||||||
style={{
|
style={{
|
||||||
flexGrow: flexGrowValue,
|
flexGrow: flexGrowValue,
|
||||||
flexShrink: 1,
|
|
||||||
flexBasis: '0%',
|
|
||||||
}}
|
}}
|
||||||
className="w-[82vw] sm:w-[320px] md:w-full shrink-0 md:shrink snap-start transition-[flex-grow] duration-1000 ease-[cubic-bezier(0.16,1,0.3,1)] will-change-[flex-grow] flex flex-col min-w-0"
|
|
||||||
>
|
>
|
||||||
{/* Window Container with strictly locked pixel height & landscape aspect */}
|
{/* Window Container with strictly locked pixel height & landscape aspect */}
|
||||||
{item.mediaType === 'comparison' ? (
|
{item.mediaType === 'comparison' ? (
|
||||||
@@ -465,7 +463,7 @@ function ToolWindowMedia({ item, isHovered }: { item: ToolMediaItem; isHovered:
|
|||||||
playsInline
|
playsInline
|
||||||
preload="auto"
|
preload="auto"
|
||||||
style={{ borderRadius: '28px' }}
|
style={{ borderRadius: '28px' }}
|
||||||
className="absolute inset-y-0 left-1/2 -translate-x-1/2 h-full w-[680px] max-w-none object-cover pointer-events-none [backface-visibility:hidden]"
|
className="absolute inset-0 w-full h-full md:inset-y-0 md:left-1/2 md:-translate-x-1/2 md:w-[680px] md:max-w-none object-cover pointer-events-none [backface-visibility:hidden]"
|
||||||
/>
|
/>
|
||||||
{/* GPU-composited overlay (opacity only) */}
|
{/* GPU-composited overlay (opacity only) */}
|
||||||
<div
|
<div
|
||||||
@@ -498,7 +496,7 @@ function ToolWindowMedia({ item, isHovered }: { item: ToolMediaItem; isHovered:
|
|||||||
src={item.afterUrl}
|
src={item.afterUrl}
|
||||||
alt="After"
|
alt="After"
|
||||||
style={{ borderRadius: '28px' }}
|
style={{ borderRadius: '28px' }}
|
||||||
className="absolute inset-y-0 left-1/2 -translate-x-1/2 h-full w-[680px] max-w-none object-cover pointer-events-none [backface-visibility:hidden]"
|
className="absolute inset-0 w-full h-full md:inset-y-0 md:left-1/2 md:-translate-x-1/2 md:w-[680px] md:max-w-none object-cover pointer-events-none [backface-visibility:hidden]"
|
||||||
loading="lazy"
|
loading="lazy"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
@@ -516,7 +514,7 @@ function ToolWindowMedia({ item, isHovered }: { item: ToolMediaItem; isHovered:
|
|||||||
src={item.beforeUrl}
|
src={item.beforeUrl}
|
||||||
alt="Before"
|
alt="Before"
|
||||||
style={{ borderRadius: '28px' }}
|
style={{ borderRadius: '28px' }}
|
||||||
className="absolute inset-y-0 left-1/2 -translate-x-1/2 h-full w-[680px] max-w-none object-cover pointer-events-none [backface-visibility:hidden]"
|
className="absolute inset-0 w-full h-full md:inset-y-0 md:left-1/2 md:-translate-x-1/2 md:w-[680px] md:max-w-none object-cover pointer-events-none [backface-visibility:hidden]"
|
||||||
loading="lazy"
|
loading="lazy"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
@@ -573,7 +571,7 @@ function ToolWindowMedia({ item, isHovered }: { item: ToolMediaItem; isHovered:
|
|||||||
src={item.imageUrl || item.afterUrl || item.beforeUrl || '/brand/og-default.png'}
|
src={item.imageUrl || item.afterUrl || item.beforeUrl || '/brand/og-default.png'}
|
||||||
alt={item.title}
|
alt={item.title}
|
||||||
style={{ borderRadius: '28px' }}
|
style={{ borderRadius: '28px' }}
|
||||||
className="absolute inset-y-0 left-1/2 -translate-x-1/2 h-full w-[680px] max-w-none object-cover pointer-events-none [backface-visibility:hidden]"
|
className="absolute inset-0 w-full h-full md:inset-y-0 md:left-1/2 md:-translate-x-1/2 md:w-[680px] md:max-w-none object-cover pointer-events-none [backface-visibility:hidden]"
|
||||||
loading="lazy"
|
loading="lazy"
|
||||||
/>
|
/>
|
||||||
{/* GPU-composited overlay (opacity only) */}
|
{/* GPU-composited overlay (opacity only) */}
|
||||||
|
|||||||
@@ -13,28 +13,9 @@ interface NavbarProps {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function Navbar({ config, currentLocale }: NavbarProps) {
|
export function Navbar({ config, currentLocale }: NavbarProps) {
|
||||||
const [isScrolled, setIsScrolled] = useState(false);
|
|
||||||
const [mobileMenuOpen, setMobileMenuOpen] = useState(false);
|
const [mobileMenuOpen, setMobileMenuOpen] = useState(false);
|
||||||
const pathname = usePathname();
|
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
|
// Close mobile menu on Escape key
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!mobileMenuOpen) return;
|
if (!mobileMenuOpen) return;
|
||||||
@@ -60,26 +41,15 @@ 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 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">
|
||||||
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'
|
|
||||||
}`}
|
|
||||||
>
|
|
||||||
<div className="max-w-[1640px] mx-auto px-4 sm:px-6 lg:px-10 flex items-center justify-between">
|
<div className="max-w-[1640px] mx-auto px-4 sm:px-6 lg:px-10 flex items-center justify-between">
|
||||||
{/* Brand Logo */}
|
{/* Brand Logo */}
|
||||||
<div className="relative z-20 flex-shrink-0">
|
<div className="relative z-20 flex-shrink-0">
|
||||||
<BrandLogo size="md" />
|
<BrandLogo size="md" />
|
||||||
</div>
|
</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">
|
<nav className="hidden md:flex items-center gap-6 lg:gap-8 relative z-20">
|
||||||
<Link
|
<Link
|
||||||
href="/"
|
href="/"
|
||||||
@@ -92,13 +62,6 @@ export function Navbar({ config, currentLocale }: NavbarProps) {
|
|||||||
Home
|
Home
|
||||||
</Link>
|
</Link>
|
||||||
|
|
||||||
<Link
|
|
||||||
href="/#pricing"
|
|
||||||
className="text-sm font-semibold text-slate-800 hover:text-blue-600 transition-colors"
|
|
||||||
>
|
|
||||||
Pricing
|
|
||||||
</Link>
|
|
||||||
|
|
||||||
<Link
|
<Link
|
||||||
href="/tools"
|
href="/tools"
|
||||||
className={`text-sm font-semibold transition-colors ${
|
className={`text-sm font-semibold transition-colors ${
|
||||||
@@ -122,8 +85,23 @@ export function Navbar({ config, currentLocale }: NavbarProps) {
|
|||||||
</Link>
|
</Link>
|
||||||
|
|
||||||
<Link
|
<Link
|
||||||
href="/#home-faqs"
|
href="/pricing"
|
||||||
className="text-sm font-semibold text-slate-800 hover:text-blue-600 transition-colors"
|
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
|
Trust & Privacy
|
||||||
</Link>
|
</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'
|
: '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>
|
||||||
|
|
||||||
<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'
|
: '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>
|
||||||
|
|
||||||
<Link
|
<Link
|
||||||
href="/#home-faqs"
|
href="/pricing"
|
||||||
onClick={() => setMobileMenuOpen(false)}
|
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>
|
<span>Trust & Privacy</span>
|
||||||
</Link>
|
</Link>
|
||||||
|
|||||||
Reference in New Issue
Block a user