checkpoint2

This commit is contained in:
2026-11-06 10:53:55 +05:30
parent 7f1e77ad6d
commit 69d4195718
20 changed files with 1306 additions and 2963 deletions
+92 -183
View File
@@ -4,15 +4,10 @@ import React, { useState, useEffect } from 'react';
import QRCode from 'qrcode';
import {
Smartphone,
QrCode,
Copy,
Check,
Gift,
ExternalLink,
Sparkles,
Zap,
ShieldCheck,
Star
ShieldCheck
} from 'lucide-react';
import { AppItem, ToolItem, resolveLocalised } from '@/types';
@@ -53,17 +48,17 @@ export function AppHandoffSection({
useEffect(() => {
if (showQr) {
QRCode.toDataURL(targetUrl, {
width: 240,
width: 220,
margin: 1,
color: {
dark: '#020617',
light: '#ffffff',
dark: '#141E28',
light: '#F8F9FA',
},
})
.then(setQrDataUrl)
.catch(console.error);
.then((url) => setQrDataUrl(url))
.catch(() => {});
}
}, [targetUrl, showQr]);
}, [showQr, targetUrl]);
const copyPromo = () => {
navigator.clipboard.writeText(bonusCode);
@@ -71,7 +66,7 @@ export function AppHandoffSection({
setTimeout(() => setCopiedPromo(false), 2000);
};
const copyTargetUrl = () => {
const copyLink = () => {
navigator.clipboard.writeText(targetUrl);
setCopiedLink(true);
setTimeout(() => setCopiedLink(false), 2000);
@@ -81,206 +76,120 @@ export function AppHandoffSection({
const appTagline = resolveLocalised(app.tagline, locale);
return (
<section
id="app-handoff"
className="py-16 sm:py-24 bg-gradient-to-b from-[#FAF8F5] via-white to-[#FAF8F5] border-t border-slate-900/[0.08] relative overflow-hidden scroll-mt-24"
>
{/* Ambient background glow */}
<div className="absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-full max-w-7xl h-96 bg-gradient-to-r from-blue-500/[0.04] via-indigo-500/[0.05] to-teal-500/[0.04] blur-3xl pointer-events-none -z-10" />
<section id="app-handoff" className="py-16 sm:py-24 bg-paper border-b border-rule relative">
<div className="max-w-container mx-auto px-4 sm:px-6 lg:px-8 space-y-10">
{/* Section Header */}
<div className="max-w-2xl space-y-2 border-b border-rule pb-5">
<h2 className="text-3xl sm:text-4xl font-display font-bold text-ink tracking-tight">
Continue on mobile
</h2>
<p className="text-sm sm:text-base text-ink-2 font-body text-pretty">
Handoff this tool directly to your iOS or Android phone with 50 bonus credits.
</p>
</div>
<div className="max-w-6xl mx-auto px-4 sm:px-6 lg:px-8 relative z-10">
<div className="bg-white rounded-[2.5rem] p-8 sm:p-12 lg:p-14 border border-slate-900/[0.09] shadow-cinematic-3d flex flex-col lg:flex-row items-center justify-between gap-10 lg:gap-14">
{/* Left Column: Copy, Bonus & Clickable Store Buttons */}
<div className="space-y-6 max-w-xl">
{/* Header Badge */}
<div className="flex flex-wrap items-center gap-2.5">
<span className="inline-flex items-center gap-2 px-3.5 py-1.5 rounded-full bg-blue-50 border border-blue-200/80 text-xs font-mono font-bold text-blue-700 shadow-2xs">
<Smartphone className="w-3.5 h-3.5 text-blue-600" />
<span>NATIVE IOS & ANDROID APP</span>
</span>
{app.rating && (
<span className="inline-flex items-center gap-1.5 px-3 py-1.5 rounded-full bg-amber-50 border border-amber-200 text-xs font-bold text-amber-800 shadow-2xs">
<Star className="w-3.5 h-3.5 fill-amber-400 text-amber-400" />
<span>{app.rating.value}</span>
<span className="text-[11px] font-mono text-amber-700 font-normal">
({(app.rating.count / 1000).toFixed(0)}k+ creators)
</span>
</span>
)}
</div>
{/* Main Headline */}
<div>
<h2 className="text-2xl sm:text-3xl lg:text-4xl font-display font-black text-slate-900 tracking-tight leading-snug">
{tool
? `Continue in ${appName} with 4K Lossless Export`
: `Download ${appName}`}
</h2>
<p className="mt-2 text-xs sm:text-sm text-slate-600 font-normal leading-relaxed">
Experience zero-latency hardware-accelerated neural processing, batch photoshoot enhancement, fine-tuning sliders, and uncompressed 4K export directly on your phone.
<div className="grid grid-cols-1 lg:grid-cols-12 gap-8 items-start">
{/* Left Column: App Specifications & Store Buttons */}
<div className="lg:col-span-7 studio-sheet p-6 sm:p-8 crop-marked space-y-6">
<div className="border-b border-rule pb-5 space-y-2">
<span className="text-xs text-muted font-body">Dedicated companion client</span>
<h3 className="text-2xl font-display font-bold text-ink">
{appName}
</h3>
<p className="text-sm text-ink-2 font-body leading-relaxed">
{appTagline}
</p>
</div>
{/* Key Feature Perks List */}
<div className="grid grid-cols-1 sm:grid-cols-2 gap-2.5 pt-1 text-xs text-slate-700">
<div className="flex items-center gap-2">
<div className="w-5 h-5 rounded-full bg-emerald-50 border border-emerald-200 flex items-center justify-center shrink-0">
<Check className="w-3 h-3 text-emerald-600" />
</div>
<span className="font-medium">4K Lossless Uncompressed Export</span>
</div>
<div className="flex items-center gap-2">
<div className="w-5 h-5 rounded-full bg-blue-50 border border-blue-200 flex items-center justify-center shrink-0">
<Zap className="w-3 h-3 text-blue-600" />
</div>
<span className="font-medium">On-Device Neural Engine Acceleration</span>
</div>
<div className="flex items-center gap-2">
<div className="w-5 h-5 rounded-full bg-indigo-50 border border-indigo-200 flex items-center justify-center shrink-0">
<Sparkles className="w-3 h-3 text-indigo-600" />
</div>
<span className="font-medium">Batch Multi-Photo Enhancement</span>
</div>
<div className="flex items-center gap-2">
<div className="w-5 h-5 rounded-full bg-emerald-50 border border-emerald-200 flex items-center justify-center shrink-0">
<ShieldCheck className="w-3 h-3 text-emerald-600" />
</div>
<span className="font-medium">Offline Private Mode (100% Private)</span>
</div>
</div>
{/* Welcome Bonus Promo Banner */}
{/* Promo Voucher */}
{showBonus && (
<div className="p-4 sm:p-5 rounded-2xl bg-gradient-to-r from-amber-500/10 via-amber-400/5 to-amber-500/10 border border-amber-300/80 flex items-center justify-between gap-4 shadow-sm">
<div className="flex items-center gap-3.5">
<div className="w-11 h-11 rounded-2xl bg-amber-100 border border-amber-300 flex items-center justify-center text-amber-700 shrink-0 shadow-sm">
<Gift className="w-5 h-5" />
</div>
<div>
<p className="text-xs sm:text-sm font-display font-bold text-slate-900">
{app.welcomeBonus?.title || '50 Free 4K HD Export Credits'}
</p>
<p className="text-[11px] font-mono text-slate-600">
Claim promo code on first mobile launch
</p>
</div>
<div className="p-4 bg-paper-2 border border-rule rounded-card flex flex-col sm:flex-row items-start sm:items-center justify-between gap-3">
<div className="space-y-0.5">
<span className="text-xs font-body font-semibold text-ink">
50 Free credits voucher code
</span>
<p className="text-xs text-muted font-body">
Enter during installation for complimentary batch runs.
</p>
</div>
<div className="flex items-center gap-2">
<span className="font-body text-sm font-semibold text-accent px-2.5 py-1 bg-paper-hi border border-rule rounded">
{bonusCode}
</span>
<button
type="button"
onClick={copyPromo}
className="btn-secondary text-xs px-2.5 py-1"
aria-label="Copy voucher code"
>
{copiedPromo ? <Check className="w-3.5 h-3.5 text-accent" aria-hidden="true" /> : <Copy className="w-3.5 h-3.5 text-muted" aria-hidden="true" />}
</button>
</div>
<button
type="button"
onClick={copyPromo}
className="inline-flex items-center gap-1.5 px-3.5 py-2 rounded-xl text-xs font-mono font-bold bg-white border border-amber-300 text-amber-900 hover:bg-amber-100 shadow-sm transition-all active:scale-95 shrink-0"
title="Click to copy promo code"
>
{copiedPromo ? <Check className="w-3.5 h-3.5 text-emerald-600" /> : <Copy className="w-3.5 h-3.5 text-amber-700" />}
<span>{copiedPromo ? 'COPIED!' : bonusCode}</span>
</button>
</div>
)}
{/* Official Clickable App Store & Google Play Buttons */}
<div className="pt-2 space-y-2">
<p className="text-[11px] font-mono uppercase tracking-wider text-slate-500 font-semibold">
Available now for instant install:
</p>
<div className="flex flex-wrap items-center gap-3.5">
{/* Apple App Store Official Badge Button */}
{/* Official Store Buttons */}
<div className="pt-2 space-y-3">
<span className="text-xs text-muted font-body block">Direct store installation</span>
<div className="flex flex-wrap gap-3">
<a
href={app.stores?.ios?.url || `/go/${tool?.slug || 'explore'}/${app.slug}`}
target="_blank"
rel="noopener noreferrer"
className="px-6 py-3 rounded-2xl text-white bg-slate-950 hover:bg-black border border-slate-800 shadow-md hover:shadow-xl hover:-translate-y-0.5 active:translate-y-0 transition-all flex items-center gap-3.5 group"
className="btn-secondary"
>
<svg className="w-6 h-6 fill-white group-hover:scale-110 transition-transform" viewBox="0 0 24 24">
<path d="M18.71 19.5c-.83 1.24-1.71 2.45-3.05 2.47-1.34.03-1.77-.79-3.29-.79-1.53 0-2 .77-3.27.82-1.31.05-2.3-1.32-3.14-2.53C4.25 17 2.94 12.45 4.7 9.39c.87-1.52 2.43-2.48 4.12-2.51 1.28-.02 2.5.87 3.29.87.78 0 2.26-1.07 3.81-.91.65.03 2.47.26 3.64 1.98-.09.06-2.17 1.28-2.15 3.81.03 3.02 2.65 4.03 2.68 4.04-.03.07-.42 1.44-1.38 2.83M15.97 6.37c.62-.75 1.04-1.8 0.92-2.87-.9.04-2 .6-2.65 1.36-.58.67-1.08 1.74-.95 2.78 1.01.08 2.05-.52 2.68-1.27z" />
</svg>
<div className="text-left leading-tight">
<span className="block text-[9.5px] uppercase font-mono tracking-wider text-slate-400">Download on the</span>
<span className="block text-sm font-bold text-white font-display">Apple App Store</span>
</div>
<ExternalLink className="w-3.5 h-3.5 text-slate-400 group-hover:text-white transition-colors ml-1" />
<Smartphone className="w-4 h-4 text-accent" aria-hidden="true" />
<span>Apple App Store</span>
<ExternalLink className="w-3 h-3 text-muted ml-1" aria-hidden="true" />
</a>
{/* Google Play Store Official Badge Button */}
<a
href={app.stores?.android?.url || `/go/${tool?.slug || 'explore'}/${app.slug}`}
target="_blank"
rel="noopener noreferrer"
className="px-6 py-3 rounded-2xl text-white bg-slate-950 hover:bg-black border border-slate-800 shadow-md hover:shadow-xl hover:-translate-y-0.5 active:translate-y-0 transition-all flex items-center gap-3.5 group"
className="btn-secondary"
>
<svg className="w-5 h-5 group-hover:scale-110 transition-transform" viewBox="0 0 24 24">
<path fill="#4285F4" d="M3.609 1.814L13.792 12 3.61 22.186c-.378-.344-.61-.853-.61-1.436V3.25c0-.583.232-1.092.61-1.436z" />
<path fill="#FBBC04" d="M17.156 8.636l-3.364 3.364 3.364 3.364 3.805-2.174c.773-.442.773-1.162 0-1.604l-3.805-2.95z" />
<path fill="#EA4335" d="M13.792 12L3.609 1.814c.31-.282.72-.454 1.171-.454.407 0 .807.14 1.157.34l11.219 6.936-3.364 3.364z" />
<path fill="#34A853" d="M13.792 12l3.364 3.364-11.219 6.936c-.35.2-.75.34-1.157.34-.451 0-.861-.172-1.171-.454L13.792 12z" />
</svg>
<div className="text-left leading-tight">
<span className="block text-[9.5px] uppercase font-mono tracking-wider text-slate-400">GET IT ON</span>
<span className="block text-sm font-bold text-white font-display">Google Play</span>
</div>
<ExternalLink className="w-3.5 h-3.5 text-slate-400 group-hover:text-white transition-colors ml-1" />
<Smartphone className="w-4 h-4 text-accent" aria-hidden="true" />
<span>Google Play</span>
<ExternalLink className="w-3 h-3 text-muted ml-1" aria-hidden="true" />
</a>
</div>
</div>
{/* Disclaimer */}
<p className="text-[11px] font-mono text-slate-400 italic">
{resolveLocalised(app.creditsNote, locale, 'Credits and in-app purchases are specific to this app.')}
</p>
</div>
{/* Right Column: High-Tech Futuristic QR Code Scanner Card */}
{showQr && qrDataUrl && (
<div className="relative group text-center p-6 sm:p-8 rounded-3xl bg-slate-950 border border-slate-800 shadow-2xl shrink-0 overflow-hidden w-full sm:w-auto flex flex-col items-center">
{/* Ambient Glow */}
<div className="absolute -inset-1 bg-gradient-to-tr from-blue-600/30 via-indigo-600/25 to-teal-500/30 rounded-3xl blur-2xl opacity-40 group-hover:opacity-70 transition-opacity pointer-events-none" />
{/* Animated Futuristic Laser Reticle Corners */}
<span className="absolute top-3 left-3 w-4 h-4 border-t-2 border-l-2 border-blue-400 rounded-tl-sm pointer-events-none" />
<span className="absolute top-3 right-3 w-4 h-4 border-t-2 border-r-2 border-blue-400 rounded-tr-sm pointer-events-none" />
<span className="absolute bottom-3 left-3 w-4 h-4 border-b-2 border-l-2 border-blue-400 rounded-bl-sm pointer-events-none" />
<span className="absolute bottom-3 right-3 w-4 h-4 border-b-2 border-r-2 border-blue-400 rounded-br-sm pointer-events-none" />
{/* QR Code Presentation Canvas */}
<div className="relative z-10 p-3.5 bg-white rounded-2xl shadow-xl inline-block border border-white/20 transition-transform duration-300 group-hover:scale-[1.02]">
{/* eslint-disable-next-line @next/next/no-img-element */}
<img
src={qrDataUrl}
alt="Scan QR code to install app"
className="w-40 h-40 sm:w-44 sm:h-44 object-contain rounded-lg"
/>
</div>
{/* Status Beacon & Camera Target */}
<div className="relative z-10 mt-4 flex items-center justify-center gap-2">
<span className="relative flex h-2 w-2">
<span className="animate-ping absolute inline-flex h-full w-full rounded-full bg-emerald-400 opacity-75"></span>
<span className="relative inline-flex rounded-full h-2 w-2 bg-emerald-500"></span>
</span>
<span className="text-xs font-mono font-bold tracking-wider uppercase text-slate-200">
Point Camera to Scan
</span>
</div>
<p className="relative z-10 text-[11px] font-mono text-slate-400 mt-1 max-w-[210px] mx-auto">
Opens app store listing instantly with promo code pre-applied
</p>
{/* Quick Copy Link Action */}
<div className="relative z-10 mt-3 pt-3 border-t border-slate-800/80 w-full flex justify-center">
<button
type="button"
onClick={copyTargetUrl}
className="inline-flex items-center gap-1.5 px-3.5 py-1.5 rounded-lg text-[11px] font-mono text-slate-400 hover:text-white bg-slate-900 border border-slate-800 hover:border-slate-700 transition-colors shadow-2xs active:scale-95"
onClick={copyLink}
className="btn-secondary"
aria-label="Copy direct deep link"
>
{copiedLink ? <Check className="w-3.5 h-3.5 text-emerald-400" /> : <Copy className="w-3.5 h-3.5" />}
<span>{copiedLink ? 'Copied Link!' : 'Copy Mobile Link'}</span>
{copiedLink ? <Check className="w-4 h-4 text-accent" aria-hidden="true" /> : <Copy className="w-4 h-4 text-muted" aria-hidden="true" />}
<span>{copiedLink ? 'Link copied' : 'Copy link'}</span>
</button>
</div>
</div>
)}
<div className="pt-2 text-xs text-muted font-body">
{resolveLocalised(app.creditsNote, locale, 'Credits and in-app purchases are specific to this app.')}
</div>
</div>
{/* Right Column: Clean QR Code Card */}
{showQr && qrDataUrl && (
<div className="lg:col-span-5 studio-sheet p-6 sm:p-8 crop-marked text-center flex flex-col items-center">
<span className="text-xs text-muted font-body mb-4">Scan with phone camera</span>
<div className="p-3 bg-paper-hi border border-rule rounded-card inline-block shadow-sm">
<img
src={qrDataUrl}
alt="Scan QR code to install app"
className="w-44 h-44 object-contain rounded"
/>
</div>
<div className="mt-4 space-y-1 text-xs font-body text-muted">
<p className="font-medium text-ink">Instant mobile handoff</p>
<p>Directs to App Store or Google Play with {bonusCode} applied automatically.</p>
</div>
</div>
)}
</div>
</div>
</section>
+25 -42
View File
@@ -1,9 +1,8 @@
'use client';
import React, { useState } from 'react';
import { ChevronDown, HelpCircle } from 'lucide-react';
import { ChevronDown } from 'lucide-react';
import { resolveLocalised } from '@/types';
import { TextAnimate } from '@/components/magicui/text-animate';
interface FaqSectionProps {
title?: any;
@@ -15,86 +14,70 @@ interface FaqSectionProps {
}
export function FaqSection({
title = 'Frequently Asked Questions',
title = 'Frequently asked questions',
items = [],
locale = 'en',
}: FaqSectionProps) {
const [openIndex, setOpenIndex] = useState<number | null>(0);
const resolvedTitle = resolveLocalised(title, locale) || 'Frequently Asked Questions';
const resolvedTitle = resolveLocalised(title, locale) || 'Frequently asked questions';
const defaultItems = [
{
q: 'Do you store or retain uploaded user photos?',
a: 'Never. CRE Innovations enforces a strict Zero-Retention Policy. All photo inferences occur synchronously in volatile GPU memory and the enhanced image is streamed straight back to your browser session. No images are saved on disk or remote servers.',
a: 'Never. CRE Innovations enforces a strict zero-retention policy. All photo inferences occur synchronously in volatile GPU memory and the enhanced image is streamed straight back to your browser session. No images are saved on disk or remote servers.',
},
{
q: 'Can I try all tools free on the web without an account?',
a: 'Yes! Every visitor gets 5 free trials each day per tool without registering or providing an email address. For high volume batch editing and unlimited processing, download our native mobile apps.',
a: 'Yes. Every visitor gets 5 free trials each day per tool without registering or providing an email address. For high volume batch editing and unlimited processing, download our native mobile apps.',
},
{
q: 'How does the handoff to the mobile app work?',
a: 'Each tool has a dedicated Home Mobile App. When you want to continue editing on your phone, click "Get the App" or scan the dynamically generated QR code on desktop to jump directly into the app with a 50 free credit welcome bonus.',
a: 'Each tool has a dedicated home mobile app. When you want to continue editing on your phone, click "Get the App" or scan the dynamically generated QR code on desktop to jump directly into the app with a 50 free credit welcome bonus.',
},
{
q: 'What image formats and file sizes are supported?',
a: 'We accept JPEG, PNG, and WebP images up to 12MB. The engine performs lossless reconstruction returning studio-quality 4K resolutions.',
a: 'We accept JPEG, PNG, and WebP images up to 12MB. The engine performs lossless reconstruction returning studio-quality resolutions.',
},
];
const displayItems = items && items.length > 0 ? items : defaultItems;
return (
<section id="faq" className="py-14 sm:py-20 bg-[#FAF8F5] border-t border-slate-900/[0.06] relative overflow-hidden">
{/* Symbolic Elemental Ambient Highlights */}
<div
className="absolute inset-0 pointer-events-none -z-10"
style={{
background: 'radial-gradient(circle at 50% 30%, rgba(37,99,235,0.04) 0%, transparent 60%)',
}}
/>
<div className="max-w-5xl mx-auto px-4 sm:px-6 md:px-8 lg:px-10">
<div className="text-center max-w-3xl mx-auto mb-14 space-y-3">
<div className="inline-flex items-center gap-2 px-3.5 py-1.5 rounded-full bg-blue-50 border border-blue-200 text-xs font-mono font-semibold text-blue-700">
<HelpCircle className="w-3.5 h-3.5 text-blue-600" />
<span>TRANSPARENCY & ASSURANCE</span>
</div>
<h2 className="text-3xl sm:text-5xl font-display font-extrabold text-slate-900 tracking-tight text-balance">
<TextAnimate animation="slideLeft" by="word">
{resolvedTitle}
</TextAnimate>
<section id="faq" className="py-16 sm:py-24 bg-paper border-b border-rule relative">
<div className="max-w-3xl mx-auto px-4 sm:px-6 lg:px-8 space-y-10">
{/* Section Header */}
<div className="space-y-2 border-b border-rule pb-5">
<h2 className="text-3xl sm:text-4xl font-display font-bold text-ink tracking-tight">
{resolvedTitle}
</h2>
<p className="text-sm sm:text-base text-slate-600 font-sans text-pretty">
<TextAnimate animation="fadeIn" by="word" delay={0.06}>
Everything you need to know about our browser trial and privacy guarantees.
</TextAnimate>
<p className="text-sm sm:text-base text-ink-2 font-body text-pretty">
Technical details regarding zero-storage privacy, format limits, and mobile client handoff.
</p>
</div>
<div className="space-y-4">
{/* Ruled Accordion List */}
<div className="border-t border-rule divide-y divide-rule">
{displayItems.map((item, idx) => {
const isOpen = openIndex === idx;
return (
<div
key={idx}
className="rounded-2xl border border-slate-200/90 bg-white overflow-hidden shadow-cream-sm hover:border-blue-300 transition-[border-color] duration-300 ease-[cubic-bezier(0.16,1,0.3,1)]"
>
<div key={idx} className="py-4">
<button
type="button"
onClick={() => setOpenIndex(isOpen ? null : idx)}
className="w-full p-6 text-left flex items-center justify-between gap-4 font-bold text-slate-900 hover:text-blue-600 transition-colors duration-200"
className="w-full text-left flex items-center justify-between gap-4 font-body font-semibold text-base text-ink hover:text-accent transition-colors"
aria-expanded={isOpen}
>
<span className="text-base sm:text-lg font-display">{item.q}</span>
<span>{item.q}</span>
<ChevronDown
className={`w-5 h-5 text-slate-400 shrink-0 transition-transform duration-300 ease-[cubic-bezier(0.16,1,0.3,1)] ${
isOpen ? 'rotate-180 text-blue-600' : ''
className={`w-4 h-4 text-muted shrink-0 transition-transform duration-150 ${
isOpen ? 'rotate-180 text-accent' : ''
}`}
aria-hidden="true"
/>
</button>
{isOpen && (
<div className="px-6 pb-6 text-sm text-slate-600 leading-relaxed border-t border-slate-100 pt-4 font-sans font-normal animate-fadeIn">
<div className="mt-3 text-sm text-ink-2 leading-relaxed font-body pr-8">
{item.a}
</div>
)}
+110 -279
View File
@@ -1,31 +1,11 @@
'use client';
import React, { useState, useEffect, useRef } from 'react';
import React, { useState } from 'react';
import Link from 'next/link';
import dynamic from 'next/dynamic';
const Hero3DCanvas = dynamic(
() => import('@/components/3d/HeroCrystalCanvas').then((mod) => mod.HeroCrystalCanvas),
{ ssr: false, loading: () => null }
);
import {
Sparkles,
ArrowRight,
Smartphone,
ArrowDown,
ShieldCheck,
LockKeyhole,
Check,
Zap,
SlidersHorizontal,
UploadCloud,
QrCode
} from 'lucide-react';
import { ArrowRight, Smartphone, SlidersHorizontal, UploadCloud } from 'lucide-react';
import { ToolItem, VariantSpec, resolveLocalised } from '@/types';
import { TextAnimate } from '@/components/magicui/text-animate';
import { Particles } from '@/components/magicui/particles';
import { TryItWidget } from './TryItWidget';
import { GrainTransformShowcase } from '@/components/ui/GrainTransformShowcase';
import { CardBeforeAfterSlider } from '@/components/ui/CardBeforeAfterSlider';
interface HeroSectionProps {
title?: Record<string, string> | string;
@@ -53,16 +33,13 @@ export function HeroSection({
locale = 'en',
}: HeroSectionProps) {
const [mobileTab, setMobileTab] = useState<'upload' | 'compare'>('upload');
const resolvedBadge = resolveLocalised(badge, locale) || 'Next-Gen Creative Vision AI';
const primaryCtaLabel = resolveLocalised(primaryCta?.label, locale, 'Explore the Magic');
const primaryCtaLabel = resolveLocalised(primaryCta?.label, locale, 'Explore our tools');
const primaryCtaHref = primaryCta?.href || '#our-tools';
const secondaryCtaLabel = resolveLocalised(secondaryCta?.label, locale, 'Native mobile apps');
const secondaryCtaHref = secondaryCta?.href || '/apps';
const secondaryCtaLabel = resolveLocalised(secondaryCta?.label, locale, 'Mobile App Studio');
const secondaryCtaHref = secondaryCta?.href || '#recommended-apps';
// 1. Dedicated Tool Detail Page Hero (when viewing /tools/[slug] with variant='toolHero')
// 1. Tool Detail Page Hero (/tools/[slug])
if (variant === 'toolHero' && tool) {
const appName = homeApp ? resolveLocalised(homeApp.name, locale) : 'Mobile App';
const toolMedia = (tool as any).media;
const primaryExample = tool.content?.examples?.[0] || {
before: toolMedia?.before || `/management/pages/tools/${tool.slug}/media/before.jpg`,
@@ -71,189 +48,94 @@ export function HeroSection({
};
return (
<section className="relative overflow-hidden bg-[#FAF8F5] border-b border-slate-900/[0.08] pt-24 sm:pt-28 pb-14 sm:pb-20 px-4 sm:px-6 lg:px-10">
<div className="max-w-[1640px] mx-auto">
<section className="relative bg-paper border-b border-rule pt-8 pb-16 px-4 sm:px-6 lg:px-8">
<div className="max-w-container mx-auto">
{/* Breadcrumb Navigation */}
<nav className="flex items-center gap-2 text-xs font-mono text-slate-500 mb-8">
<Link href="/" className="hover:text-blue-700 transition-colors">Home</Link>
<nav className="flex items-center gap-2 text-xs font-body text-muted mb-6">
<Link href="/" className="hover:text-ink transition-colors">Home</Link>
<span>/</span>
<Link href="/tools" className="hover:text-blue-700 transition-colors">Tools</Link>
<Link href="/tools" className="hover:text-ink transition-colors">Tools</Link>
<span>/</span>
<span className="text-slate-900 font-semibold">{resolveLocalised(tool.name, locale)}</span>
<span className="text-ink font-medium">{resolveLocalised(tool.name, locale)}</span>
</nav>
{/* Heading & Subtitle */}
<div className="text-center max-w-4xl mx-auto mb-10 sm:mb-12">
<div className="inline-flex items-center gap-2 px-3 py-1 rounded-full text-xs font-mono font-semibold tracking-wider uppercase text-blue-700 bg-blue-50 border border-blue-200 shadow-2xs">
<Sparkles className="w-3.5 h-3.5 text-blue-600" />
<span>Studio Neural Tool</span>
</div>
<h1 className="mt-4 text-3xl sm:text-5xl lg:text-6xl font-display font-black tracking-tight text-slate-900 leading-[1.08]">
<TextAnimate animation="slideLeft" by="word">{resolveLocalised(tool.name, locale)}</TextAnimate>
{/* Heading Block */}
<div className="max-w-3xl mb-10">
<h1 className="text-3xl sm:text-5xl font-display font-bold text-ink tracking-tight">
{resolveLocalised(tool.name, locale)}
</h1>
<p className="mt-4 text-base sm:text-lg leading-relaxed text-slate-600 max-w-2xl mx-auto font-sans">
<TextAnimate animation="fadeIn" by="word" delay={0.15}>{resolveLocalised(tool.summary, locale)}</TextAnimate>
<p className="mt-3 text-base sm:text-lg text-ink-2 font-body max-w-2xl leading-relaxed">
{resolveLocalised(tool.summary, locale)}
</p>
{/* Mobile Tab Switcher */}
<div className="mt-7 flex lg:hidden items-center justify-center">
<div className="inline-flex p-1.5 rounded-2xl bg-slate-200/80 border border-slate-300 shadow-inner">
<button
type="button"
onClick={() => setMobileTab('upload')}
className={`flex items-center gap-2 px-5 py-2.5 rounded-xl text-xs font-bold transition-all ${
mobileTab === 'upload'
? 'bg-white text-blue-600 shadow-sm'
: 'text-slate-600 hover:text-slate-900'
}`}
>
<UploadCloud className="w-3.5 h-3.5" />
<span>Upload Photo</span>
</button>
<button
type="button"
onClick={() => setMobileTab('compare')}
className={`flex items-center gap-2 px-5 py-2.5 rounded-xl text-xs font-bold transition-all ${
mobileTab === 'compare'
? 'bg-blue-600 text-white shadow-sm'
: 'text-slate-600 hover:text-slate-900'
}`}
>
<SlidersHorizontal className="w-3.5 h-3.5" />
<span>Transform Result</span>
</button>
</div>
</div>
</div>
{/* Intelligent Side-by-Side Tool Studio */}
<div className="grid grid-cols-1 lg:grid-cols-12 gap-8 items-stretch max-w-7xl mx-auto" id="tool-studio">
{/* Column 1: Spacious, Prominent Upload Studio (lg:col-span-7) */}
<div className={`lg:col-span-7 flex flex-col ${mobileTab === 'upload' ? 'block' : 'hidden lg:flex'}`}>
{/* Studio Workspace: Counter Layout (Upload Studio on Left, Comparison Proof on Right) */}
<div className="grid grid-cols-1 lg:grid-cols-12 gap-8 items-start">
{/* Upload Studio */}
<div className="lg:col-span-6 bg-paper-hi border border-rule rounded-card p-6 shadow-sheet">
<div className="border-b border-rule pb-3 mb-6 flex items-center justify-between">
<span className="studio-label">Proof studio</span>
<span className="text-xs text-muted font-body">Zero server retention</span>
</div>
<TryItWidget
tool={tool}
homeApp={homeApp}
variants={variants}
locale={locale}
className="h-full flex flex-col justify-between"
onSwitchToCompare={() => setMobileTab('compare')}
/>
</div>
{/* Column 2: Sleeker, Focused Neural Transformation Preview (lg:col-span-5) */}
<div className={`lg:col-span-5 flex flex-col ${mobileTab === 'compare' ? 'block' : 'hidden lg:flex'}`}>
<div className="h-full rounded-3xl overflow-hidden border border-slate-900/[0.1] shadow-cinematic-3d bg-slate-950 flex flex-col justify-between min-h-[380px] sm:min-h-[460px]">
<GrainTransformShowcase
beforeUrl={primaryExample.before}
afterUrl={primaryExample.after}
beforeLabel="BEFORE"
afterLabel="AFTER"
/>
</div>
{/* Mobile Jump to Upload (Only on small screens) */}
<div className="mt-3 lg:hidden">
<button
type="button"
onClick={() => setMobileTab('upload')}
className="w-full py-3 px-4 rounded-xl text-xs font-bold text-white bg-blue-600 hover:bg-blue-700 flex items-center justify-center gap-2 shadow-sm"
>
<UploadCloud className="w-4 h-4" />
<span>Upload Your Photo to Try</span>
</button>
{/* Comparison Proof Sheet */}
<div className="lg:col-span-6">
<div className="studio-sheet p-4 crop-marked">
<div className="mb-3 flex items-center justify-between text-xs text-muted font-body">
<span>Transformation specimen</span>
<span>Drag slider to inspect</span>
</div>
<div className="aspect-[4/3] rounded-card overflow-hidden bg-paper-2">
<CardBeforeAfterSlider
beforeUrl={primaryExample.before}
afterUrl={primaryExample.after}
title={resolveLocalised(tool.name, locale)}
slug={tool.slug}
aspectRatio="aspect-[4/3]"
/>
</div>
<div className="mt-3 text-xs text-muted font-body text-center">
Full 4K batch processing available in the {homeApp ? resolveLocalised(homeApp.name, locale) : 'mobile app'}.
</div>
</div>
</div>
</div>
{/* Clean Trust Indicators & Clickable App Links */}
<div className="mt-10 flex flex-wrap items-center justify-center gap-3 sm:gap-4 text-xs font-medium text-slate-600">
<span className="inline-flex items-center gap-1.5 px-3.5 py-2 rounded-full bg-slate-100 text-slate-700">
<ShieldCheck className="h-3.5 w-3.5 text-emerald-600" />
<span>Zero Storage</span>
</span>
<span className="inline-flex items-center gap-1.5 px-3.5 py-2 rounded-full bg-slate-100 text-slate-700">
<LockKeyhole className="h-3.5 w-3.5 text-blue-600" />
<span>Private Processing</span>
</span>
<span className="inline-flex items-center gap-1.5 px-3.5 py-2 rounded-full bg-slate-100 text-slate-700">
<Check className="h-3.5 w-3.5 text-indigo-600" />
<span>Lossless Quality</span>
</span>
{/* Clickable Mobile App Button Link */}
{homeApp && (
<a
href="#app-handoff"
className="inline-flex items-center gap-2 px-4 py-2 rounded-full bg-blue-50 hover:bg-blue-100 border border-blue-200 text-blue-700 font-bold shadow-2xs hover:scale-105 active:scale-95 transition-all group"
>
<Smartphone className="h-4 w-4 text-blue-600 group-hover:scale-110 transition-transform" />
<span>Available in {appName} App</span>
<span className="text-[10px] font-mono bg-blue-600 text-white px-2 py-0.5 rounded-full font-bold">
50 Bonus Credits &amp; 4K ↗
</span>
</a>
)}
{/* Clickable QR Code Trigger Pill */}
{homeApp && (
<a
href="#app-handoff"
className="inline-flex items-center gap-1.5 text-xs font-mono font-semibold text-slate-700 hover:text-slate-950 bg-white hover:bg-slate-50 border border-slate-200 px-3.5 py-2 rounded-full shadow-2xs transition-all hover:scale-105 active:scale-95"
title="Scan QR Code to install mobile app"
>
<QrCode className="w-3.5 h-3.5 text-blue-600" />
<span>Scan QR</span>
</a>
)}
</div>
</div>
</section>
);
}
// 2. Centered Directory & Info Page Hero (for /tools, /apps, /pricing, /trust, /privacy, /terms)
// 2. Centered Directory Hero (for /tools, /apps, /pricing, /trust)
if (variant === 'centered') {
const resolvedTitle = resolveLocalised(title, locale) || 'Creative Studio';
const resolvedTitle = resolveLocalised(title, locale) || 'Creative studio';
const resolvedSubtitle = resolveLocalised(subtitle, locale);
return (
<section className="relative overflow-hidden pt-28 pb-16 sm:pt-36 sm:pb-20 text-center bg-[#FAF8F5] border-b border-slate-900/[0.07]">
<div className="absolute top-0 left-1/2 -translate-x-1/2 w-full max-w-7xl h-96 bg-gradient-to-b from-blue-500/[0.04] to-transparent blur-3xl pointer-events-none -z-10" />
<div className="max-w-4xl mx-auto px-4 sm:px-6 lg:px-8 space-y-6 relative z-10">
{resolvedBadge && (
<div className="inline-flex items-center gap-2 px-4 py-1.5 rounded-full bg-blue-50 border border-blue-200 text-xs font-mono font-semibold text-blue-700 shadow-sm">
<Sparkles className="w-3.5 h-3.5 text-blue-600" />
<span>{resolvedBadge}</span>
</div>
)}
<h1 className="text-4xl sm:text-5xl lg:text-6xl font-display font-black text-slate-900 tracking-tight leading-tight">
<section className="relative pt-16 pb-14 text-center bg-paper border-b border-rule">
<div className="max-w-3xl mx-auto px-4 sm:px-6 lg:px-8 space-y-4">
<h1 className="text-3xl sm:text-5xl font-display font-bold text-ink tracking-tight">
{resolvedTitle}
</h1>
{resolvedSubtitle && (
<p className="text-base sm:text-lg text-slate-600 max-w-2xl mx-auto leading-relaxed font-sans">
<p className="text-base sm:text-lg text-ink-2 font-body max-w-xl mx-auto leading-relaxed">
{resolvedSubtitle}
</p>
)}
<div className="flex flex-wrap items-center justify-center gap-4 pt-3">
<Link
href="/#our-tools"
className="inline-flex items-center gap-2 px-6 py-3 rounded-full font-bold text-xs sm:text-sm text-white bg-slate-950 hover:bg-blue-600 shadow-sm transition-all hover:scale-105 active:scale-95"
>
<span>Explore Studio Suite</span>
<ArrowRight className="w-4 h-4" />
<div className="flex flex-wrap items-center justify-center gap-3 pt-2">
<Link href="/#our-tools" className="btn-primary">
Browse tools
</Link>
<Link
href="/apps"
className="inline-flex items-center gap-2 px-6 py-3 rounded-full font-bold text-xs sm:text-sm text-slate-700 bg-white border border-slate-200 hover:bg-slate-50 transition-colors shadow-sm"
>
<Smartphone className="w-4 h-4 text-blue-600" />
<span>Mobile Apps Suite</span>
<Link href="/apps" className="btn-secondary">
Mobile apps
</Link>
</div>
</div>
@@ -261,118 +143,67 @@ export function HeroSection({
);
}
// -------------------------------------------------------------
// 3. Pure Front Page Hero View (for homepage /):
// Matching User Specifications:
// - Slightly dimmer background image (opacity-85 brightness-[0.88])
// - Extended white/cream gradient to the right (~75% width)
// - Perfect bottom fade (h-28 sm:h-36) seamlessly blending with content below
// -------------------------------------------------------------
// 3. Homepage Hero (Narrative Workflow shape, Counter posture)
return (
<section id="hero-section" className="relative min-h-[92vh] sm:min-h-screen flex items-center overflow-hidden bg-[#FAF8F5] pt-20 sm:pt-24 pb-20 sm:pb-28 lg:pb-32">
{/* 1. Background Image with Responsive Ultra-Fast Loading */}
<div className="absolute inset-0 z-0 overflow-hidden">
<picture>
<source media="(max-width: 768px)" srcSet="/management/pages/home/hero_mobile.webp" type="image/webp" />
<source media="(max-width: 768px)" srcSet="/management/pages/home/hero_mobile.jpg" type="image/jpeg" />
<source srcSet="/management/pages/home/hero_desktop.webp" type="image/webp" />
<img
src="/management/pages/home/hero_desktop.jpg"
alt="CRE AI Photo Magic"
className="w-full h-full object-cover object-[72%_top] sm:object-right select-none pointer-events-none opacity-85 sm:opacity-90 brightness-[0.92] sm:brightness-[0.95] translate-y-0 sm:translate-y-8 sm:scale-[1.03]"
loading="eager"
fetchPriority="high"
decoding="sync"
/>
</picture>
{/* Top Gradient for Black Navbar Text Contrast */}
<div className="absolute inset-x-0 top-0 h-28 sm:h-32 lg:h-36 bg-gradient-to-b from-[#FAF8F5] from-35% via-[#FAF8F5]/85 via-65% to-transparent pointer-events-none" />
{/* Dynamic Desktop Gradient: Restrained to left text side (~55%) so complete image stays vibrant & visible */}
<div className="absolute inset-0 bg-gradient-to-r from-[#FAF8F5] via-[#FAF8F5]/65 via-30% to-transparent to-55% hidden sm:block pointer-events-none" />
{/* Dynamic Mobile Gradient: Left-to-right feathering to keep text razor sharp while keeping portrait vibrant & naturally framed */}
<div className="absolute inset-0 bg-gradient-to-r from-[#FAF8F5]/95 via-[#FAF8F5]/70 via-50% to-transparent to-85% sm:hidden pointer-events-none" />
{/* Soft Bottom Fade: Starts cleanly after the metrics section ends to blend into #our-tools */}
<div className="absolute inset-x-0 bottom-0 h-14 sm:h-16 lg:h-20 bg-gradient-to-t from-[#FAF8F5] via-[#FAF8F5]/75 via-40% to-transparent pointer-events-none" />
</div>
<section id="hero-section" className="relative bg-paper studio-proof-grid border-b border-rule pt-12 sm:pt-16 pb-16 sm:pb-20">
<div className="max-w-container mx-auto px-4 sm:px-6 lg:px-8">
<div className="grid grid-cols-1 lg:grid-cols-12 gap-10 lg:gap-12 items-center">
{/* Left Column: Content & Actions (Counter Posture) */}
<div className="lg:col-span-6 space-y-6">
<div className="space-y-3">
<h1 className="text-4xl sm:text-5xl lg:text-6xl font-display font-bold text-ink tracking-tight leading-[1.04]">
Photographic tools, built with precision.
</h1>
<p className="text-base sm:text-lg text-ink-2 font-body leading-relaxed max-w-xl">
Retouch portraits, extract cutouts, and restore archival prints directly in your browser.
</p>
</div>
{/* Hero End Sentinel for exact scroll position detection */}
<div id="hero-end-sentinel" className="absolute bottom-0 left-0 w-full h-2 pointer-events-none opacity-0" aria-hidden="true" />
{/* Actions */}
<div className="flex flex-wrap items-center gap-3 pt-1">
<a href={primaryCtaHref} className="btn-primary">
<span>{primaryCtaLabel}</span>
<ArrowRight className="w-4 h-4" aria-hidden="true" />
</a>
{/* 2. Left-Aligned Content Container */}
<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]">
<div className="max-w-2xl sm:max-w-3xl">
{/* Masterpiece Headline */}
<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-slate-950 font-black">
Imagine. Transform.
</span>
<span className="block mt-1 sm:mt-2 bg-gradient-to-r from-blue-600 via-indigo-600 to-pink-500 bg-clip-text text-transparent font-black">
Create the Impossible.
</span>
</h1>
<Link href={secondaryCtaHref} className="btn-secondary">
<Smartphone className="w-4 h-4 text-accent" aria-hidden="true" />
<span>{secondaryCtaLabel}</span>
</Link>
</div>
{/* Subtitle */}
<p className="mt-5 sm:mt-7 text-sm sm:text-base md:text-lg text-slate-800 sm:text-slate-600 max-w-xl text-left font-sans leading-relaxed font-medium">
Turn ordinary moments into extraordinary visual art, Instant, effortless, and private photo magic right in your browser.
</p>
{/* Action Buttons */}
<div className="mt-8 sm:mt-10 flex flex-wrap items-center gap-3 sm:gap-4">
<a
href={primaryCtaHref}
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-500/25 transition-all duration-200 hover:scale-105 active:scale-95 cursor-pointer"
>
Explore Our Tools
</a>
<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-900 bg-white hover:bg-slate-50 border border-slate-200/90 shadow-sm transition-all duration-200 hover:scale-105 active:scale-95 cursor-pointer"
>
Recommended Apps
</a>
{/* Proof Line */}
<div className="pt-2 flex items-center gap-6 text-xs text-muted font-body border-t border-rule">
<span>Zero server image retention</span>
<span>Hardware-accelerated neural models</span>
<span>Free browser trial</span>
</div>
</div>
{/* Glass Metrics Pill Capsule (0% CPU, Hardware-Accelerated) */}
<div className="mt-12 sm:mt-16 w-full max-w-2xl sm:max-w-3xl rounded-3xl sm:rounded-full bg-white/85 border border-slate-200/90 p-4 sm:py-4 sm:px-8 grid grid-cols-2 sm:grid-cols-4 gap-4 sm:gap-6 shadow-cream-sm">
{/* Metric 1 */}
<div className="flex flex-col text-left">
<span className="text-xl sm:text-2xl font-display font-black tracking-tight text-blue-600">
1.4M+
</span>
<span className="text-[11px] sm:text-xs text-slate-500 font-sans mt-0.5">
Photo Tranformed
</span>
</div>
{/* Right Column: Lead Interactive Specimen (Crop-Marked Before/After Loupe) */}
<div className="lg:col-span-6">
<div className="studio-sheet p-4 sm:p-5 crop-marked">
<div className="mb-3 flex items-center justify-between text-xs text-muted font-body">
<span className="font-medium text-ink">Skin & blemish retoucher</span>
<span>Drag to inspect sub-pore restoration</span>
</div>
{/* Metric 2 */}
<div className="flex flex-col text-left">
<span className="text-xl sm:text-2xl font-display font-black tracking-tight text-indigo-600">
&lt;0.8s
</span>
<span className="text-[11px] sm:text-xs text-slate-500 font-sans mt-0.5">
Instant Interene
</span>
</div>
<div className="aspect-[16/10] rounded-card overflow-hidden bg-paper-2 border border-rule">
<CardBeforeAfterSlider
beforeUrl="/management/pages/home/sections/our-tools/blemish-remover/before.jpg"
afterUrl="/management/pages/home/sections/our-tools/blemish-remover/after.jpg"
title="Skin & blemish retoucher"
slug="blemish-remover"
aspectRatio="aspect-[16/10]"
/>
</div>
{/* Metric 3 */}
<div className="flex flex-col text-left">
<span className="text-xl sm:text-2xl font-display font-black tracking-tight text-purple-600">
100%
</span>
<span className="text-[11px] sm:text-xs text-slate-500 font-sans mt-0.5">
Client side privacy
</span>
</div>
{/* 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-600 via-indigo-600 to-pink-500 bg-clip-text text-transparent">
4K UHD
</span>
<span className="text-[11px] sm:text-xs text-slate-500 font-sans mt-0.5">
Studio Resolution
</span>
<div className="mt-3 flex items-center justify-between text-xs text-muted font-body">
<span>Natural skin pore preservation</span>
<Link href="/tools/blemish-remover" className="text-accent hover:underline font-medium">
Open full tool studio
</Link>
</div>
</div>
</div>
</div>
+125 -453
View File
@@ -2,20 +2,13 @@
import React, { useState, useEffect, useRef } from 'react';
import {
Sparkles,
Wand2,
UploadCloud,
Cpu,
Download,
Heart,
ArrowRight,
PartyPopper,
CheckCircle2,
Play,
Pause,
ArrowDown,
Camera,
Check
Check,
ShieldCheck
} from 'lucide-react';
import { TextAnimate } from '@/components/magicui/text-animate';
interface HowItWorksSectionProps {
title?: string;
@@ -24,514 +17,193 @@ interface HowItWorksSectionProps {
}
export function HowItWorks3DSection({
title = 'Making Photo Magic is Super Simple',
badge = 'SUPER EASY AS 1-2-3',
subtitle = 'No complicated buttons or confusing settings. Just three friendly steps from your photo to pure magic!',
title = 'How the process works',
badge,
subtitle = 'Synchronous GPU inference in volatile memory, returning studio-quality exports in seconds.',
}: HowItWorksSectionProps) {
const [activeStep, setActiveStep] = useState<1 | 2 | 3>(1);
const [isPaused, setIsPaused] = useState(false);
const sectionRef = useRef<HTMLDivElement>(null);
// Auto-advance travelling image through cards with smart offscreen pause
// 100% safe on device battery and thermals: zero work when offscreen or tab hidden
useEffect(() => {
if (isPaused) return;
const section = sectionRef.current;
let isVisible = false;
let timer: any = null;
const runTimer = () => {
if (timer) clearInterval(timer);
timer = setInterval(() => {
if (isVisible && !document.hidden && !isPaused) {
setActiveStep((prev) => (prev === 3 ? 1 : ((prev + 1) as 1 | 2 | 3)));
}
}, 4500);
};
const observer = new IntersectionObserver(
([entry]) => {
isVisible = entry.isIntersecting;
if (isVisible) {
runTimer();
} else if (timer) {
clearInterval(timer);
timer = null;
}
},
{ threshold: 0.15 }
);
if (section) observer.observe(section);
const handleVisibility = () => {
if (document.hidden && timer) {
clearInterval(timer);
timer = null;
} else if (isVisible && !isPaused) {
runTimer();
}
};
document.addEventListener('visibilitychange', handleVisibility);
return () => {
if (timer) clearInterval(timer);
observer.disconnect();
document.removeEventListener('visibilitychange', handleVisibility);
};
}, [isPaused]);
return (
<section
id="how-it-works"
ref={sectionRef}
className="py-16 sm:py-24 px-4 sm:px-6 md:px-8 lg:px-10 bg-[#FAF8F5] relative overflow-hidden border-t border-slate-900/[0.06]"
className="py-16 sm:py-24 px-4 sm:px-6 md:px-8 lg:px-10 bg-paper border-b border-rule relative"
>
{/* Playful Ambient Background Highlights */}
<div
className="absolute inset-0 pointer-events-none -z-10"
style={{
background: 'radial-gradient(circle at 50% 30%, rgba(254,240,138,0.12) 0%, rgba(199,210,254,0.1) 40%, transparent 70%)',
}}
/>
<div className="max-w-[1640px] mx-auto space-y-10 sm:space-y-12">
{/* Playful & Warm Section Header with Quick Controls */}
<div className="text-center max-w-3xl mx-auto space-y-4">
<div className="inline-flex items-center gap-2 px-4 py-1.5 rounded-full text-xs font-display font-bold tracking-wider uppercase text-amber-900 bg-amber-100/80 border border-amber-300 shadow-sm">
<Sparkles className="w-4 h-4 text-amber-600" />
<span>{badge}</span>
</div>
<h2 className="text-3xl sm:text-5xl font-display font-black text-slate-900 tracking-tight text-balance">
<TextAnimate animation="slideLeft" by="word">
{title}
</TextAnimate>
<div className="max-w-container mx-auto space-y-12">
{/* Section Header */}
<div className="max-w-2xl space-y-2 border-b border-rule pb-5">
<h2 className="text-3xl sm:text-4xl font-display font-bold text-ink tracking-tight">
{title}
</h2>
<p className="text-base sm:text-lg text-slate-600 font-sans text-pretty">
<TextAnimate animation="fadeIn" by="word" delay={0.08}>
{subtitle}
</TextAnimate>
<p className="text-sm sm:text-base text-ink-2 font-body text-pretty">
{subtitle}
</p>
{/* Step Selector Pills & Auto-Play Toggle */}
<div className="pt-2 flex items-center justify-center flex-wrap gap-2 text-xs font-display font-bold">
{/* Step Selector Pills */}
<div className="pt-3 flex items-center gap-2 text-xs font-body">
<button
type="button"
onClick={() => setActiveStep(1)}
className={`flex items-center gap-1.5 px-4 py-2 rounded-full transition-all duration-300 ${
className={`px-3 py-1.5 rounded-pill transition-colors duration-100 ${
activeStep === 1
? 'bg-blue-600 text-white shadow-md shadow-blue-500/25 scale-105'
: 'bg-white text-slate-700 hover:bg-slate-100 border border-slate-200 shadow-xs'
? 'bg-ink text-paper-hi font-medium'
: 'bg-paper-2 text-ink-2 hover:bg-paper-3 border border-rule'
}`}
>
<span>📸 1. Pick Photo</span>
1. Upload photograph
</button>
<button
type="button"
onClick={() => setActiveStep(2)}
className={`flex items-center gap-1.5 px-4 py-2 rounded-full transition-all duration-300 ${
className={`px-3 py-1.5 rounded-pill transition-colors duration-100 ${
activeStep === 2
? 'bg-amber-500 text-white shadow-md shadow-amber-500/25 scale-105'
: 'bg-white text-slate-700 hover:bg-slate-100 border border-slate-200 shadow-xs'
? 'bg-ink text-paper-hi font-medium'
: 'bg-paper-2 text-ink-2 hover:bg-paper-3 border border-rule'
}`}
>
<span>🪄 2. AI Magic</span>
2. Neural processing
</button>
<button
type="button"
onClick={() => setActiveStep(3)}
className={`flex items-center gap-1.5 px-4 py-2 rounded-full transition-all duration-300 ${
className={`px-3 py-1.5 rounded-pill transition-colors duration-100 ${
activeStep === 3
? 'bg-emerald-600 text-white shadow-md shadow-emerald-500/25 scale-105'
: 'bg-white text-slate-700 hover:bg-slate-100 border border-slate-200 shadow-xs'
? 'bg-ink text-paper-hi font-medium'
: 'bg-paper-2 text-ink-2 hover:bg-paper-3 border border-rule'
}`}
>
<span>🎉 3. Masterpiece</span>
</button>
<button
type="button"
onClick={() => setIsPaused(!isPaused)}
className="p-2 rounded-full bg-white hover:bg-slate-100 border border-slate-200 text-slate-700 transition-colors shadow-xs ml-1"
title={isPaused ? 'Resume auto-advance' : 'Pause auto-advance'}
aria-label={isPaused ? 'Resume auto-advance' : 'Pause auto-advance'}
>
{isPaused ? <Play className="w-3.5 h-3.5" /> : <Pause className="w-3.5 h-3.5" />}
3. Studio export
</button>
</div>
</div>
{/* -------------------------------------------------------------
Three Connected Cards with Travelling Photo Journey Integrated Directly Within
------------------------------------------------------------- */}
<div className="relative">
{/* Desktop Connecting Conveyor Tracks Between the Cards */}
<div className="hidden lg:block absolute top-[138px] inset-x-[15%] h-1 bg-slate-200/80 rounded-full pointer-events-none -z-0">
{/* Travelling Active Pulse Energy Beam */}
<div
className="h-full bg-gradient-to-r from-blue-500 via-amber-400 to-emerald-500 rounded-full transition-all duration-700 ease-[cubic-bezier(0.16,1,0.3,1)] shadow-[0_0_8px_rgba(59,130,246,0.5)]"
style={{
width: activeStep === 1 ? '0%' : activeStep === 2 ? '50%' : '100%'
}}
/>
</div>
{/* 3 Step Process Cards */}
<div className="grid grid-cols-1 md:grid-cols-3 gap-6">
{/* Step 1 */}
<div className={`studio-sheet p-6 crop-marked flex flex-col justify-between ${
activeStep === 1 ? 'border-accent' : ''
}`}>
<div className="space-y-4">
<div className="flex items-center justify-between border-b border-rule pb-3">
<span className="text-xs text-muted font-body">Step 01</span>
<UploadCloud className="w-4 h-4 text-accent" aria-hidden="true" />
</div>
{/* Desktop Floating Transfer Arrow Cues */}
<div className="hidden lg:flex absolute top-[138px] left-[33.33%] -translate-x-1/2 -translate-y-1/2 z-20 pointer-events-none">
<div className={`w-8 h-8 rounded-full border flex items-center justify-center transition-all duration-500 ${
activeStep >= 2
? 'bg-amber-500 border-amber-300 text-white shadow-md scale-110'
: 'bg-white border-slate-200 text-slate-400'
}`}>
<ArrowRight className="w-4 h-4" />
<div>
<h3 className="text-lg font-body font-semibold text-ink">
Select your source photo
</h3>
<p className="mt-1.5 text-xs text-muted leading-relaxed font-body">
Drop any portrait, archive print, or product image into the studio widget. The engine validates JPEG, PNG, and WebP signatures client-side.
</p>
</div>
<ul className="space-y-1.5 text-xs text-ink-2 pt-2 border-t border-rule font-body">
<li className="flex items-center gap-2">
<Check className="w-3.5 h-3.5 text-accent shrink-0" aria-hidden="true" />
<span>Up to 12MB input resolution</span>
</li>
<li className="flex items-center gap-2">
<Check className="w-3.5 h-3.5 text-accent shrink-0" aria-hidden="true" />
<span>Presets available for immediate testing</span>
</li>
</ul>
</div>
</div>
<div className="hidden lg:flex absolute top-[138px] left-[66.66%] -translate-x-1/2 -translate-y-1/2 z-20 pointer-events-none">
<div className={`w-8 h-8 rounded-full border flex items-center justify-center transition-all duration-500 ${
activeStep === 3
? 'bg-emerald-600 border-emerald-300 text-white shadow-md scale-110'
: 'bg-white border-slate-200 text-slate-400'
}`}>
<ArrowRight className="w-4 h-4" />
<div className="mt-6 pt-3 border-t border-rule text-xs text-muted font-body">
Client validation passed
</div>
</div>
{/* 3 Step Cards Grid */}
<div className="grid grid-cols-1 lg:grid-cols-3 gap-6 sm:gap-8 items-stretch relative z-10">
{/* =========================================================
CARD 1: Pick Any Picture (Origin Dock)
========================================================= */}
<div
onClick={() => setActiveStep(1)}
className={`group relative flex flex-col justify-between rounded-[36px] bg-white border p-6 sm:p-7 shadow-cream-sm transition-all duration-500 cursor-pointer ${
activeStep === 1
? 'border-blue-500 ring-4 ring-blue-500/20 shadow-cream-lg -translate-y-1.5'
: 'border-slate-200/90 hover:border-blue-300 hover:shadow-cream-md'
}`}
>
{/* Step 2 */}
<div className={`studio-sheet p-6 crop-marked flex flex-col justify-between ${
activeStep === 2 ? 'border-accent' : ''
}`}>
<div className="space-y-4">
<div className="flex items-center justify-between border-b border-rule pb-3">
<span className="text-xs text-muted font-body">Step 02</span>
<Cpu className="w-4 h-4 text-accent" aria-hidden="true" />
</div>
<div>
{/* Step Badge */}
<div className="flex items-center justify-between mb-4">
<div className="inline-flex items-center gap-2 px-3.5 py-1 rounded-full bg-blue-50 border border-blue-200 text-blue-700 text-xs font-display font-bold uppercase tracking-wider">
{activeStep === 1 && <span className="w-2 h-2 rounded-full bg-blue-600 inline-block animate-ping" />}
<span>STEP 01</span>
</div>
<span className="text-xl">📸</span>
</div>
{/* VISUAL DOCK 1: Raw Photo Drop & Origin Departure */}
<div className="relative w-full h-[220px] rounded-3xl bg-gradient-to-b from-blue-50/70 to-indigo-50/40 border border-blue-100 overflow-hidden flex flex-col items-center justify-center p-3 select-none">
{/* Photo Frame with Transition */}
<div className={`relative w-44 h-32 rounded-2xl bg-white shadow-xl border-2 border-white overflow-hidden p-1.5 transition-all duration-700 ease-[cubic-bezier(0.16,1,0.3,1)] transform-gpu ${
activeStep === 1
? 'scale-100 rotate-[-1deg] opacity-100'
: 'scale-90 rotate-[0deg] opacity-40 translate-x-4'
}`}>
<img
src="/management/pages/home/sections/how-it-works/media/before.jpg"
alt="Your Photo"
className="w-full h-full object-cover rounded-xl"
/>
{/* Tag badge */}
<div className="absolute bottom-2 left-2 right-2 flex items-center justify-between pointer-events-none">
<span className="px-2 py-0.5 rounded-full text-[9px] font-mono font-bold uppercase tracking-wider bg-blue-600/90 text-white shadow-xs">
Raw Photo
</span>
{activeStep === 1 && (
<span className="text-xs">👇</span>
)}
</div>
</div>
{/* Flow cues */}
<div className="absolute top-2.5 left-3 px-2.5 py-0.5 rounded-full bg-white/95 shadow-xs border border-blue-100 text-[10px] font-bold text-blue-700 flex items-center gap-1">
<span>{activeStep === 1 ? 'Photo Loaded' : 'Sent to Step 2'}</span>
{activeStep > 1 && <Check className="w-3 h-3 text-emerald-600" />}
</div>
{activeStep === 1 && (
<div className="absolute bottom-2.5 right-3 px-2.5 py-0.5 rounded-full bg-blue-600 text-white shadow-xs text-[10px] font-bold flex items-center gap-1 animate-pulse">
<span>Travelling Next</span>
<ArrowRight className="w-3 h-3" />
</div>
)}
</div>
{/* Text Content */}
<h3 className="mt-5 text-xl sm:text-2xl font-display font-black text-slate-900 group-hover:text-blue-600 transition-colors">
1. Pick Any Picture
<h3 className="text-lg font-body font-semibold text-ink">
Synchronous neural inference
</h3>
<p className="mt-2 text-xs sm:text-sm text-slate-600 leading-relaxed font-sans">
Grab any photo from your phone or laptop. Selfies, family portraits, vintage prints, or vacation snaps—everything transforms in seconds!
<p className="mt-1.5 text-xs text-muted leading-relaxed font-body">
Inference executes inside isolated volatile GPU memory. The model separates alpha strands, removes blemishes, or interpolates sub-pixel details.
</p>
{/* Feature checkmarks */}
<ul className="mt-4 space-y-1.5 text-xs font-medium text-slate-600 border-t border-slate-100 pt-3">
<li className="flex items-center gap-2">
<CheckCircle2 className="w-3.5 h-3.5 text-emerald-500 shrink-0" />
<span>One-tap upload or drag & drop</span>
</li>
<li className="flex items-center gap-2">
<CheckCircle2 className="w-3.5 h-3.5 text-emerald-500 shrink-0" />
<span>No sign-up or credit card required</span>
</li>
</ul>
</div>
<div className="mt-5 pt-3 border-t border-slate-100 text-xs font-display font-bold text-blue-600 flex items-center justify-between">
<span>Instant upload</span>
<span>⚡ Easy & Private</span>
</div>
<ul className="space-y-1.5 text-xs text-ink-2 pt-2 border-t border-rule font-body">
<li className="flex items-center gap-2">
<Check className="w-3.5 h-3.5 text-accent shrink-0" aria-hidden="true" />
<span>Zero storage retention policy</span>
</li>
<li className="flex items-center gap-2">
<Check className="w-3.5 h-3.5 text-accent shrink-0" aria-hidden="true" />
<span>Sub-second turnaround time</span>
</li>
</ul>
</div>
{/* Mobile Vertical Flow Arrow 1 -> 2 */}
<div className="flex lg:hidden justify-center -my-3 z-20 pointer-events-none">
<div className={`w-8 h-8 rounded-full border flex items-center justify-center transition-all ${
activeStep >= 2 ? 'bg-amber-500 border-amber-300 text-white shadow-md' : 'bg-white border-slate-200 text-slate-400'
}`}>
<ArrowDown className="w-4 h-4" />
</div>
<div className="mt-6 pt-3 border-t border-rule text-xs text-muted font-body">
Volatile GPU stream
</div>
</div>
{/* Step 3 */}
<div className={`studio-sheet p-6 crop-marked flex flex-col justify-between ${
activeStep === 3 ? 'border-accent' : ''
}`}>
<div className="space-y-4">
<div className="flex items-center justify-between border-b border-rule pb-3">
<span className="text-xs text-muted font-body">Step 03</span>
<Download className="w-4 h-4 text-accent" aria-hidden="true" />
</div>
{/* =========================================================
CARD 2: Some Magic Happens! (Transformation Dock)
========================================================= */}
<div
onClick={() => setActiveStep(2)}
className={`group relative flex flex-col justify-between rounded-[36px] bg-white border p-6 sm:p-7 shadow-cream-sm transition-all duration-500 cursor-pointer ${
activeStep === 2
? 'border-amber-500 ring-4 ring-amber-500/20 shadow-cream-lg -translate-y-1.5'
: 'border-slate-200/90 hover:border-amber-300 hover:shadow-cream-md'
}`}
>
<div>
{/* Step Badge */}
<div className="flex items-center justify-between mb-4">
<div className="inline-flex items-center gap-2 px-3.5 py-1 rounded-full bg-amber-50 border border-amber-200 text-amber-800 text-xs font-display font-bold uppercase tracking-wider">
{activeStep === 2 && <span className="w-2 h-2 rounded-full bg-amber-500 inline-block animate-ping" />}
<span>STEP 02</span>
</div>
<span className="text-xl">🪄</span>
</div>
{/* VISUAL DOCK 2: In-Card Arrival, Laser Scan & Neural Crossfade */}
<div className="relative w-full h-[220px] rounded-3xl bg-gradient-to-b from-amber-50/80 via-purple-50/40 to-pink-50/50 border border-amber-200/80 overflow-hidden flex flex-col items-center justify-center p-3 select-none">
{/* Photo Frame Docked in Card 2 with Real-Time Crossfade */}
<div className={`relative w-44 h-32 rounded-2xl bg-white shadow-xl border-2 transition-all duration-700 ease-[cubic-bezier(0.16,1,0.3,1)] overflow-hidden p-1.5 transform-gpu ${
activeStep === 2
? 'scale-105 border-amber-400 shadow-amber-500/25 rotate-[0deg] opacity-100'
: activeStep === 3
? 'scale-90 border-slate-200 opacity-40 translate-x-4'
: 'scale-90 border-slate-200 opacity-30 -translate-x-4'
}`}>
{/* Before Image */}
<img
src="/management/pages/home/sections/how-it-works/media/before.jpg"
alt="Raw Photo Transforming"
className={`absolute inset-1.5 w-[calc(100%-12px)] h-[calc(100%-12px)] object-cover rounded-xl transition-opacity duration-700 ${
activeStep === 2 ? 'opacity-0' : 'opacity-100'
}`}
/>
{/* Transformed After Image */}
<img
src="/management/pages/home/sections/how-it-works/media/after.jpg"
alt="Transformed AI Image"
className={`absolute inset-1.5 w-[calc(100%-12px)] h-[calc(100%-12px)] object-cover rounded-xl transition-opacity duration-700 ${
activeStep >= 2 ? 'opacity-100' : 'opacity-0'
}`}
/>
{/* Neural Laser Scanner Beam during Step 2 */}
{activeStep === 2 && (
<div className="absolute inset-y-1.5 w-8 bg-gradient-to-r from-transparent via-cyan-400 to-transparent animate-laser-scan pointer-events-none z-20" />
)}
{/* Tag badge */}
<div className="absolute bottom-2 left-2 right-2 flex items-center justify-between pointer-events-none z-30">
<span className={`px-2 py-0.5 rounded-full text-[9px] font-mono font-bold uppercase tracking-wider text-white shadow-xs ${
activeStep === 2 ? 'bg-amber-600/95' : 'bg-slate-700/80'
}`}>
{activeStep === 2 ? 'AI Magic...' : activeStep === 3 ? 'Enhanced' : 'Awaiting'}
</span>
{activeStep === 2 && <span className="text-xs">✨</span>}
</div>
</div>
{/* Flow cues */}
<div className="absolute top-2.5 left-3 px-2.5 py-0.5 rounded-full bg-white/95 shadow-xs border border-amber-200 text-[10px] font-bold text-amber-900 flex items-center gap-1">
<span>{activeStep === 2 ? 'Pixels Processing' : activeStep === 3 ? 'Magic Applied' : 'Dock Ready'}</span>
{activeStep === 3 && <Check className="w-3 h-3 text-emerald-600" />}
</div>
{activeStep === 2 && (
<div className="absolute bottom-2.5 right-3 px-2.5 py-0.5 rounded-full bg-amber-500 text-white shadow-xs text-[10px] font-bold flex items-center gap-1 animate-pulse">
<span>Moving to 4K</span>
<ArrowRight className="w-3 h-3" />
</div>
)}
</div>
{/* Text Content */}
<h3 className="mt-5 text-xl sm:text-2xl font-display font-black text-slate-900 group-hover:text-amber-600 transition-colors">
2. Some Magic Happens!
<h3 className="text-lg font-body font-semibold text-ink">
Inspect & download result
</h3>
<p className="mt-2 text-xs sm:text-sm text-slate-600 leading-relaxed font-sans">
Our neural AI waves its magic wand—dusting away marks, clarifying pupils, restoring crisp textures, and balancing vibrant colors in under a second!
<p className="mt-1.5 text-xs text-muted leading-relaxed font-body">
Compare the output against the original with the interactive slider. Download the high-definition result directly or hand off to mobile for batch 4K.
</p>
{/* Feature checkmarks */}
<ul className="mt-4 space-y-1.5 text-xs font-medium text-slate-600 border-t border-slate-100 pt-3">
<li className="flex items-center gap-2">
<CheckCircle2 className="w-3.5 h-3.5 text-amber-500 shrink-0" />
<span>Preserves real pores & authentic facial features</span>
</li>
<li className="flex items-center gap-2">
<CheckCircle2 className="w-3.5 h-3.5 text-amber-500 shrink-0" />
<span>Automated neural enhancement with zero guesswork</span>
</li>
</ul>
</div>
<div className="mt-5 pt-3 border-t border-slate-100 text-xs font-display font-bold text-amber-700 flex items-center justify-between">
<span>Under 0.8 seconds</span>
<span>🪄 Neural Engine</span>
</div>
<ul className="space-y-1.5 text-xs text-ink-2 pt-2 border-t border-rule font-body">
<li className="flex items-center gap-2">
<Check className="w-3.5 h-3.5 text-accent shrink-0" aria-hidden="true" />
<span>Full fidelity download in browser</span>
</li>
<li className="flex items-center gap-2">
<Check className="w-3.5 h-3.5 text-accent shrink-0" aria-hidden="true" />
<span>Direct QR handoff to native apps</span>
</li>
</ul>
</div>
{/* Mobile Vertical Flow Arrow 2 -> 3 */}
<div className="flex lg:hidden justify-center -my-3 z-20 pointer-events-none">
<div className={`w-8 h-8 rounded-full border flex items-center justify-center transition-all ${
activeStep === 3 ? 'bg-emerald-600 border-emerald-300 text-white shadow-md' : 'bg-white border-slate-200 text-slate-400'
}`}>
<ArrowDown className="w-4 h-4" />
</div>
<div className="mt-6 pt-3 border-t border-rule text-xs text-muted font-body">
Production ready export
</div>
{/* =========================================================
CARD 3: Tada! Ready to Love (Arrival Masterpiece Dock)
========================================================= */}
<div
onClick={() => setActiveStep(3)}
className={`group relative flex flex-col justify-between rounded-[36px] bg-white border p-6 sm:p-7 shadow-cream-sm transition-all duration-500 cursor-pointer ${
activeStep === 3
? 'border-emerald-500 ring-4 ring-emerald-500/20 shadow-cream-lg -translate-y-1.5'
: 'border-slate-200/90 hover:border-emerald-300 hover:shadow-cream-md'
}`}
>
<div>
{/* Step Badge */}
<div className="flex items-center justify-between mb-4">
<div className="inline-flex items-center gap-2 px-3.5 py-1 rounded-full bg-emerald-50 border border-emerald-200 text-emerald-800 text-xs font-display font-bold uppercase tracking-wider">
{activeStep === 3 && <span className="w-2 h-2 rounded-full bg-emerald-500 inline-block animate-ping" />}
<span>STEP 03</span>
</div>
<span className="text-xl">🎉</span>
</div>
{/* VISUAL DOCK 3: Finished 4K Arrival & Download State */}
<div className="relative w-full h-[220px] rounded-3xl bg-gradient-to-b from-emerald-50/80 via-teal-50/40 to-cyan-50/50 border border-emerald-200/80 overflow-hidden flex flex-col items-center justify-center p-3 select-none">
{/* Masterpiece Photo Frame in Card 3 */}
<div className={`relative w-44 h-32 rounded-2xl bg-white shadow-xl border-2 transition-all duration-700 ease-[cubic-bezier(0.16,1,0.3,1)] overflow-hidden p-1.5 transform-gpu ${
activeStep === 3
? 'scale-105 border-emerald-400 shadow-emerald-500/25 rotate-[1deg] opacity-100'
: 'scale-90 border-slate-200 opacity-30 -translate-x-4'
}`}>
<img
src="/management/pages/home/sections/how-it-works/media/after.jpg"
alt="Finished 4K Masterpiece"
className="w-full h-full object-cover rounded-xl"
/>
{/* Celebration badges */}
<div className="absolute top-2 left-2 z-20">
<span className="px-2 py-0.5 rounded-full bg-emerald-600 text-white text-[9px] font-mono font-bold uppercase tracking-wider shadow-sm flex items-center gap-1">
<PartyPopper className="w-2.5 h-2.5" />
<span>Tada! Masterpiece</span>
</span>
</div>
<div className="absolute bottom-2 right-2 z-20">
<span className="px-2 py-0.5 rounded-full bg-white/95 text-slate-900 text-[9px] font-mono font-bold shadow-xs border border-slate-200 flex items-center gap-1">
<Download className="w-2.5 h-2.5 text-emerald-600" />
<span>4K Ready</span>
</span>
</div>
</div>
{/* Flow cues */}
<div className="absolute top-2.5 left-3 px-2.5 py-0.5 rounded-full bg-white/95 shadow-xs border border-emerald-200 text-[10px] font-bold text-emerald-900 flex items-center gap-1">
<span>{activeStep === 3 ? 'Masterpiece Ready!' : 'Waiting for Arrival'}</span>
{activeStep === 3 && <PartyPopper className="w-3 h-3 text-emerald-600" />}
</div>
{activeStep === 3 && (
<div className="absolute bottom-2.5 right-3 px-2.5 py-0.5 rounded-full bg-emerald-600 text-white shadow-xs text-[10px] font-bold flex items-center gap-1">
<span>Ready to Save</span>
<span>🎉</span>
</div>
)}
</div>
{/* Text Content */}
<h3 className="mt-5 text-xl sm:text-2xl font-display font-black text-slate-900 group-hover:text-emerald-600 transition-colors">
3. Tada! Ready to Love
</h3>
<p className="mt-2 text-xs sm:text-sm text-slate-600 leading-relaxed font-sans">
One tap to download your gorgeous new picture in crystal 4K resolution! No annoying watermarks, no compression artifacts, ready to share proudly.
</p>
{/* Feature checkmarks */}
<ul className="mt-4 space-y-1.5 text-xs font-medium text-slate-600 border-t border-slate-100 pt-3">
<li className="flex items-center gap-2">
<CheckCircle2 className="w-3.5 h-3.5 text-emerald-500 shrink-0" />
<span>Crisp high-definition 4K image export</span>
</li>
<li className="flex items-center gap-2">
<CheckCircle2 className="w-3.5 h-3.5 text-emerald-500 shrink-0" />
<span>Zero watermarks or hidden payment traps</span>
</li>
</ul>
</div>
<div className="mt-5 pt-3 border-t border-slate-100 text-xs font-display font-bold text-emerald-700 flex items-center justify-between">
<span>Instant Download</span>
<span>🎉 All Yours</span>
</div>
</div>
</div>
</div>
{/* Cheerful Bottom Reassurance Banner */}
<div className="rounded-3xl bg-gradient-to-r from-amber-50 via-white to-blue-50 border border-amber-200/80 p-5 sm:p-6 shadow-sm flex flex-col md:flex-row items-center justify-between gap-4 text-center md:text-left">
{/* Clean Privacy Reassurance Strip without emojis or middle dots */}
<div className="studio-sheet p-5 flex flex-col sm:flex-row items-center justify-between gap-4">
<div className="flex items-center gap-3">
<div className="w-10 h-10 rounded-2xl bg-amber-400 text-amber-950 flex items-center justify-center font-bold text-lg shadow-sm shrink-0">
🎈
</div>
<ShieldCheck className="w-5 h-5 text-accent shrink-0" aria-hidden="true" />
<div>
<h4 className="font-display font-bold text-slate-900 text-sm">
100% Free Trial • No Credit Card • No Sign-Up Needed
<h4 className="font-body font-semibold text-ink text-sm">
Zero photo retention and free browser trials
</h4>
<p className="text-xs text-slate-600 mt-0.5 font-sans">
Anyone can do it in seconds. Your photos stay completely private on your own device and are never stored.
<p className="text-xs text-muted mt-0.5 font-body">
All photos are processed in volatile GPU memory and immediately purged upon response delivery.
</p>
</div>
</div>
<a
href="#our-tools"
className="inline-flex items-center gap-2 px-6 py-3 rounded-full text-xs font-bold text-slate-900 bg-amber-400 hover:bg-amber-300 shadow-md transition-all hover:scale-105 active:scale-95 shrink-0"
>
<span>Try It Yourself Now</span>
<ArrowRight className="w-4 h-4" />
<a href="#our-tools" className="btn-primary shrink-0">
<span>Try tools now</span>
<ArrowRight className="w-3.5 h-3.5" aria-hidden="true" />
</a>
</div>
</div>
@@ -2,8 +2,7 @@
import React from 'react';
import Link from 'next/link';
import { Smartphone, Star, ArrowRight, Download, Sparkles, CheckCircle2 } from 'lucide-react';
import { TextAnimate } from '@/components/magicui/text-animate';
import { Smartphone, ArrowRight, Check } from 'lucide-react';
import { AppItem, resolveLocalised } from '@/types';
interface RecommendedAppsSectionProps {
@@ -19,149 +18,107 @@ const DEFAULT_RECOMMENDED_APPS = [
id: 'app-portrait',
slug: 'portrait-app',
name: 'Portrait Studio AI',
tagline: 'Sub-pore facial retouching & blemish cleaner',
category: 'Portrait & Beauty',
rating: '4.9',
reviews: '48K+ reviews',
gradient: 'from-blue-600 to-indigo-600',
tagline: 'Sub-pore facial retouching and blemish cleaning',
category: 'Portrait & beauty',
platforms: ['iOS', 'Android'],
features: ['Real-time 4K export', 'Sub-pore texture', '50 Free credits on install'],
features: ['Real-time 4K export', 'Natural skin texture preservation', 'Welcome bonus on install'],
storeUrl: '/apps/portrait-app',
},
{
id: 'app-enhancer',
slug: 'photo-enhancer-pro',
name: 'Enhance Ultra AI',
tagline: 'Generative 4K super-resolution & restoration',
category: 'Super Resolution',
rating: '4.9',
reviews: '62K+ reviews',
gradient: 'from-purple-600 to-indigo-600',
tagline: 'Generative 4K super-resolution and archival restoration',
category: 'Super resolution',
platforms: ['iOS', 'Android'],
features: ['Generative eye reconstruction', 'Old archival restore', 'No compression artifacts'],
features: ['Facial detail reconstruction', 'Old archival restoration', 'Lossless export quality'],
storeUrl: '/apps/photo-enhancer-pro',
},
{
id: 'app-cutout',
slug: 'bg-cleaner-app',
name: 'Magic Cutout Studio',
tagline: 'Sub-pixel P3M alpha matting & cutouts',
category: 'Background Cutout',
rating: '4.8',
reviews: '34K+ reviews',
gradient: 'from-teal-600 to-cyan-600',
tagline: 'Sub-pixel P3M alpha matting and background removal',
category: 'Background cutout',
platforms: ['iOS', 'Android'],
features: ['0.02px edge trim', 'Hair-strand boundary separation', 'E-commerce white studio'],
features: ['Precision edge feathering', 'Hair-strand boundary extraction', 'Ecommerce white studio mode'],
storeUrl: '/apps/bg-cleaner-app',
},
{
id: 'app-toonify',
slug: 'art-studio-app',
name: 'Toonify & Anime Studio',
tagline: 'Stylized CartoonGAN illustrations & avatars',
category: 'Creative Art',
rating: '4.9',
reviews: '29K+ reviews',
gradient: 'from-pink-600 to-rose-600',
tagline: 'Stylized CartoonGAN illustrations and artwork',
category: 'Creative art',
platforms: ['iOS', 'Android'],
features: ['30+ Anime art styles', 'Dynamic comic shading', 'Instant HD export'],
features: ['Curated styled filters', 'Dynamic line-art preservation', 'Fast local device processing'],
storeUrl: '/apps/art-studio-app',
},
];
export function RecommendedAppsSection({
title = 'Recommended Mobile Apps',
badge = 'DEDICATED NATIVE APPS',
subtitle = 'Get unlimited batch processing, offline inference, and full 4K output on iOS and Android.',
title = 'Mobile studio applications',
subtitle = 'Dedicated iOS and Android clients for hardware-accelerated offline batch processing.',
apps,
locale = 'en',
}: RecommendedAppsSectionProps) {
const displayApps = apps && apps.length > 0 ? apps : DEFAULT_RECOMMENDED_APPS;
return (
<section id="recommended-apps" className="py-14 sm:py-20 px-4 sm:px-6 md:px-8 lg:px-10 bg-[#FAF8F5] relative overflow-hidden border-t border-slate-900/[0.06]">
{/* Symbolic Elemental Ambient Highlights */}
<div
className="absolute inset-0 pointer-events-none -z-10"
style={{
background: 'radial-gradient(circle at 10% 20%, rgba(16,185,129,0.06) 0%, transparent 50%), radial-gradient(circle at 90% 80%, rgba(37,99,235,0.06) 0%, transparent 50%)',
}}
/>
<div className="max-w-[1640px] mx-auto space-y-10">
{/* Section Header with MagicUI TextAnimate */}
<div className="text-center max-w-3xl mx-auto space-y-4">
<div className="inline-flex items-center gap-2 px-3.5 py-1 rounded-full text-xs font-mono font-semibold tracking-wider uppercase text-blue-700 bg-blue-50 border border-blue-200">
<Smartphone className="w-3.5 h-3.5 text-blue-600" />
<span>{badge}</span>
</div>
<h2 className="text-3xl sm:text-5xl font-display font-extrabold text-slate-900 tracking-tight">
<TextAnimate animation="slideLeft" by="word">
{title}
</TextAnimate>
<section id="recommended-apps" className="py-16 sm:py-24 px-4 sm:px-6 md:px-8 lg:px-10 bg-paper border-b border-rule relative">
<div className="max-w-container mx-auto space-y-10">
{/* Section Header */}
<div className="max-w-2xl space-y-2 border-b border-rule pb-5">
<h2 className="text-3xl sm:text-4xl font-display font-bold text-ink tracking-tight">
{title}
</h2>
<p className="text-sm sm:text-base text-slate-600 font-sans text-pretty">
<TextAnimate animation="fadeIn" by="word" delay={0.08}>
{subtitle}
</TextAnimate>
<p className="text-sm sm:text-base text-ink-2 font-body text-pretty">
{subtitle}
</p>
</div>
{/* 4 App Cards Grid */}
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 sm:gap-8">
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6">
{displayApps.map((app: any) => {
const name = typeof app.name === 'string' ? app.name : resolveLocalised(app.name, locale);
const tagline = typeof app.tagline === 'string' ? app.tagline : resolveLocalised(app.tagline, locale);
const slug = app.slug || app.id;
const gradient = app.gradient || 'from-blue-600 to-indigo-600';
const ratingValue = typeof app.rating === 'object' && app.rating !== null ? app.rating.value : app.rating || '4.9';
return (
<div
key={slug}
className="group relative flex flex-col justify-between rounded-3xl bg-white border border-slate-200/90 p-7 shadow-cream-sm transition-[transform,border-color] duration-300 ease-[cubic-bezier(0.16,1,0.3,1)] hover:-translate-y-1 hover:border-blue-400/60 will-change-transform transform-gpu"
className="studio-sheet p-6 crop-marked flex flex-col justify-between"
>
{/* GPU Shadow Elevation Layer */}
<div
className="absolute -inset-px rounded-3xl shadow-cream-lg opacity-0 group-hover:opacity-100 transition-opacity duration-500 ease-[cubic-bezier(0.16,1,0.3,1)] pointer-events-none"
aria-hidden="true"
/>
<div>
{/* Top App Icon & Rating */}
<div className="flex items-center justify-between mb-5">
<div className={`w-12 h-12 rounded-2xl bg-gradient-to-br ${gradient} flex items-center justify-center text-white shadow-md shadow-blue-500/20 group-hover:scale-110 transition-transform`}>
<Smartphone className="w-6 h-6 text-white" />
</div>
<div className="flex items-center gap-1 px-3 py-1 rounded-full bg-amber-50 border border-amber-200/80 text-amber-800 text-xs font-bold">
<Star className="w-3.5 h-3.5 fill-amber-400 text-amber-400" />
<span>{ratingValue}</span>
<div className="space-y-4">
<div className="flex items-center justify-between border-b border-rule pb-3">
<div className="w-9 h-9 rounded-card bg-paper-2 border border-rule flex items-center justify-center text-ink">
<Smartphone className="w-4 h-4 text-accent" aria-hidden="true" />
</div>
<span className="text-xs text-muted font-body">Mobile suite</span>
</div>
{/* Name & Tagline */}
<h3 className="text-lg font-display font-bold text-slate-900 group-hover:text-blue-600 transition-colors">
{name}
</h3>
<p className="mt-1.5 text-xs text-slate-500 leading-relaxed min-h-[34px]">
{tagline}
</p>
{/* Platforms & Free bonus badge */}
<div className="mt-4 flex flex-wrap items-center gap-2 text-[11px] font-mono text-slate-600">
<span className="px-2.5 py-0.5 rounded-md bg-slate-100 font-semibold text-slate-700">iOS</span>
<span className="px-2.5 py-0.5 rounded-md bg-slate-100 font-semibold text-slate-700">Android</span>
<span className="px-2.5 py-0.5 rounded-md bg-emerald-50 text-emerald-700 font-semibold border border-emerald-200">
50 Credits Bonus
</span>
<div>
<h3 className="text-lg font-body font-semibold text-ink">
{name}
</h3>
<p className="mt-1 text-xs text-muted leading-relaxed min-h-[32px] font-body">
{tagline}
</p>
</div>
{/* Bullet Highlights */}
{/* Platforms */}
<div className="flex items-center gap-2 text-xs font-body text-ink-2">
<span className="px-2 py-0.5 rounded bg-paper-2 border border-rule">iOS</span>
<span className="px-2 py-0.5 rounded bg-paper-2 border border-rule">Android</span>
<span className="px-2 py-0.5 rounded bg-paper-2 text-accent border border-rule">50 credits free</span>
</div>
{/* Features */}
{app.features && (
<ul className="mt-5 space-y-2 text-xs text-slate-600 border-t border-slate-100 pt-4">
<ul className="space-y-1.5 text-xs text-ink-2 pt-2 border-t border-rule font-body">
{app.features.map((feat: string, fIdx: number) => (
<li key={fIdx} className="flex items-center gap-2">
<CheckCircle2 className="w-3.5 h-3.5 text-blue-600 flex-shrink-0" />
<Check className="w-3.5 h-3.5 text-accent shrink-0" aria-hidden="true" />
<span>{feat}</span>
</li>
))}
@@ -169,14 +126,13 @@ export function RecommendedAppsSection({
)}
</div>
{/* Bottom Action Button */}
<div className="pt-6 mt-5 border-t border-slate-100">
<div className="pt-6 mt-4 border-t border-rule">
<Link
href={`/apps/${slug}`}
className="w-full flex items-center justify-center gap-2 py-3.5 rounded-xl text-xs font-bold text-white bg-slate-950 group-hover:bg-blue-600 transition-colors duration-300 ease-[cubic-bezier(0.16,1,0.3,1)] shadow-sm"
className="btn-secondary w-full text-center"
>
<span>Get App & QR Code</span>
<ArrowRight className="w-3.5 h-3.5 transition-transform duration-300 ease-[cubic-bezier(0.16,1,0.3,1)] group-hover:translate-x-1" />
<span>View app & QR</span>
<ArrowRight className="w-3.5 h-3.5" aria-hidden="true" />
</Link>
</div>
</div>
+86 -193
View File
@@ -1,9 +1,8 @@
'use client';
import React, { useState, useEffect, useRef } from 'react';
import { Star, MessageSquareQuote, CheckCircle2 } from 'lucide-react';
import React from 'react';
import { Star } from 'lucide-react';
import { Marquee } from '@/components/magicui/marquee';
import { TextAnimate } from '@/components/magicui/text-animate';
interface ReviewsMarqueeSectionProps {
title?: string;
@@ -14,181 +13,131 @@ interface ReviewsMarqueeSectionProps {
const REVIEWS_ROW_1 = [
{
name: 'Elena Rostova',
username: '@elena_studios',
role: 'Editorial Portrait Photographer',
rating: 5,
avatar: 'ER',
body: 'The blemish remover is lightyears ahead of typical automated tools. It removes red spots and imperfections while keeping real pores and skin texture intact.',
tool: 'Blemish Remover',
role: 'Editorial portrait photographer',
body: 'The blemish remover removes spots and imperfections while keeping real pores and skin texture intact.',
tool: 'Skin & blemish retoucher',
},
{
name: 'Marcus Vance',
username: '@vance_commerce',
role: 'Shopify Store Owner',
rating: 5,
avatar: 'MV',
body: 'The P3M cutout matting saved my product photography workflow. Hair strands and glass reflections are perfectly separated in under a second.',
tool: 'Background Remover',
role: 'Store owner',
body: 'The P3M cutout matting separated flyaway hair strands and transparent glass reflections cleanly.',
tool: 'Background remover',
},
{
name: 'David Chen',
username: '@davidchen_art',
role: 'Digital Concept Artist',
rating: 5,
avatar: 'DC',
body: 'Zero-storage privacy was our #1 criteria. Knowing photos aren’t kept on a remote server gave our agency complete peace of mind.',
tool: 'Zero-Storage Policy',
role: 'Concept artist',
body: 'Zero-storage privacy was our main requirement. Knowing images are processed in volatile memory gave complete peace of mind.',
tool: 'Zero-storage policy',
},
{
name: 'Ananya Sharma',
username: '@ananya_design',
role: 'Fashion Creative Director',
rating: 5,
avatar: 'AS',
body: 'Super clean results without signing up for an account. I tried it right on desktop and immediately downloaded the iOS app for batch edits.',
tool: 'Portrait Studio App',
role: 'Creative director',
body: 'Clean results without account registration. Tested in browser and handed off to mobile for batch work.',
tool: 'Mobile studio suite',
},
];
const REVIEWS_ROW_2 = [
{
name: 'Liam O’Connor',
username: '@liam_restores',
role: 'Historical Archivist',
rating: 5,
avatar: 'LO',
body: 'I restored my grandparents’ 1942 wedding photo. The generative facial super-resolution restored the iris clarity and fine lace details amazingly.',
tool: 'Vintage Restorer',
role: 'Historical archivist',
body: 'Restored vintage portrait prints with natural iris clarity and fine fiber details intact.',
tool: 'Archival restorer',
},
{
name: 'Chloe Dubois',
username: '@chloe_visuals',
role: 'Social Media Creator',
rating: 5,
avatar: 'CD',
body: 'The anime avatar tool is genuinely viral. It doesn’t just blur your face with a cartoon filter, it genuinely reinterprets lineart.',
tool: 'CartoonGAN Studio',
role: 'Content creator',
body: 'The anime tool reinterprets lineart and shading rather than just applying a cheap filter blur.',
tool: 'Anime synthesis',
},
{
name: 'Vikram Malhotra',
username: '@vikram_ux',
role: 'Product Lead',
rating: 5,
avatar: 'VM',
body: 'Blazingly fast. No laggy loading screens, instantaneous before/after comparison slider, and crystal clear 4K export quality.',
tool: 'Photo Enhancer 4K',
role: 'Design engineer',
body: 'Instantaneous before/after comparison scrub with lossless 4K export quality directly in session.',
tool: 'Photo enhancer 4K',
},
{
name: 'Sophie Tanaka',
username: '@sophie_tanaka',
role: 'Commercial Retoucher',
rating: 5,
avatar: 'ST',
body: 'Teeth whitening without that artificial nuclear neon white look. It subtly brightens enamel while respecting natural gum tones.',
tool: 'Teeth Whitener AI',
role: 'Commercial retoucher',
body: 'Subtly brightens enamel while respecting natural gum tones and lighting reflections.',
tool: 'Teeth whitener',
},
];
export function ReviewsMarqueeSection({
title = 'Loved by Creators & Professionals',
badge = 'VERIFIED COMMUNITY FEEDBACK',
subtitle = 'Over 1.4 million photos processed with five-star ratings across web and mobile apps.',
title = 'Photographer & studio notes',
subtitle = 'Feedback from portrait photographers, archivists, and studio retouchers.',
}: ReviewsMarqueeSectionProps) {
const sectionRef = useRef<HTMLDivElement>(null);
const [isInView, setIsInView] = useState(false);
// Viewport-aware animation: Pauses CSS animation completely when section is offscreen
// Eliminates 100% idle CPU and GPU compositing when user is browsing other sections
useEffect(() => {
const el = sectionRef.current;
if (!el) return;
let isVisible = false;
const updateState = () => {
setIsInView(isVisible && !document.hidden);
};
const observer = new IntersectionObserver(
([entry]) => {
isVisible = entry.isIntersecting;
updateState();
},
{ threshold: 0.05 }
);
observer.observe(el);
const handleVisibility = () => {
updateState();
};
document.addEventListener('visibilitychange', handleVisibility);
return () => {
observer.disconnect();
document.removeEventListener('visibilitychange', handleVisibility);
};
}, []);
return (
<section
id="user-reviews"
ref={sectionRef}
className="py-14 sm:py-20 bg-[#FAF8F5] relative overflow-hidden border-t border-slate-900/[0.06]"
className="py-16 sm:py-24 bg-paper border-b border-rule relative overflow-hidden"
>
{/* Symbolic Elemental Ambient Highlights */}
<div
className="absolute inset-0 pointer-events-none -z-10"
style={{
background: 'radial-gradient(circle at 50% 50%, rgba(245,158,11,0.05) 0%, transparent 60%)',
}}
/>
<div className="max-w-[1640px] mx-auto px-4 sm:px-6 md:px-8 lg:px-10 space-y-10">
<div className="max-w-container mx-auto px-4 sm:px-6 md:px-8 lg:px-10 space-y-10">
{/* Section Header */}
<div className="text-center max-w-3xl mx-auto space-y-4">
<div className="inline-flex items-center gap-2 px-3.5 py-1 rounded-full text-xs font-mono font-semibold tracking-wider uppercase text-blue-700 bg-blue-50 border border-blue-200">
<MessageSquareQuote className="w-3.5 h-3.5 text-blue-600" />
<span>{badge}</span>
</div>
<h2 className="text-3xl sm:text-5xl font-display font-extrabold text-slate-900 tracking-tight text-balance">
<TextAnimate animation="slideLeft" by="word">
{title}
</TextAnimate>
<div className="max-w-2xl space-y-2 border-b border-rule pb-5">
<h2 className="text-3xl sm:text-4xl font-display font-bold text-ink tracking-tight">
{title}
</h2>
<p className="text-sm sm:text-base text-slate-600 font-sans text-pretty">
<TextAnimate animation="fadeIn" by="word" delay={0.08}>
{subtitle}
</TextAnimate>
<p className="text-sm sm:text-base text-ink-2 font-body text-pretty">
{subtitle}
</p>
</div>
{/* Marquee Container with Left & Right Gradient Feather Masks - Paused when offscreen */}
<div
className="relative flex w-full flex-col items-center justify-center overflow-hidden [mask-image:linear-gradient(to_right,transparent,black_10%,black_90%,transparent)]"
style={{
animationPlayState: isInView ? 'running' : 'paused',
}}
>
{/* Row 1: Leftward Marquee */}
<Marquee
pauseOnHover
className={`[--duration:35s] ${!isInView ? '[&>*]:[animation-play-state:paused]' : ''}`}
>
{REVIEWS_ROW_1.map((review, idx) => (
<ReviewCard key={idx} {...review} />
{/* Marquee Row 1 */}
<div className="space-y-4">
<Marquee pauseOnHover className="[--duration:40s]">
{REVIEWS_ROW_1.map((rev, i) => (
<div
key={i}
className="w-80 studio-sheet p-5 mx-2.5 crop-marked flex flex-col justify-between"
>
<div>
<div className="flex items-center justify-between border-b border-rule pb-2 mb-3">
<span className="text-xs font-body font-medium text-accent">{rev.tool}</span>
<div className="flex text-accent" aria-label="5 stars">
{[...Array(5)].map((_, s) => (
<Star key={s} className="w-3 h-3 fill-accent text-accent" aria-hidden="true" />
))}
</div>
</div>
<p className="text-xs text-ink-2 leading-relaxed font-body">
"{rev.body}"
</p>
</div>
<div className="mt-4 pt-2 border-t border-rule text-xs font-body">
<span className="font-semibold text-ink block">{rev.name}</span>
<span className="text-muted block text-[11px]">{rev.role}</span>
</div>
</div>
))}
</Marquee>
{/* Row 2: Rightward Reverse Marquee */}
<Marquee
reverse
pauseOnHover
className={`[--duration:40s] mt-4 ${!isInView ? '[&>*]:[animation-play-state:paused]' : ''}`}
>
{REVIEWS_ROW_2.map((review, idx) => (
<ReviewCard key={idx} {...review} />
{/* Marquee Row 2 */}
<Marquee reverse pauseOnHover className="[--duration:45s]">
{REVIEWS_ROW_2.map((rev, i) => (
<div
key={i}
className="w-80 studio-sheet p-5 mx-2.5 crop-marked flex flex-col justify-between"
>
<div>
<div className="flex items-center justify-between border-b border-rule pb-2 mb-3">
<span className="text-xs font-body font-medium text-accent">{rev.tool}</span>
<div className="flex text-accent" aria-label="5 stars">
{[...Array(5)].map((_, s) => (
<Star key={s} className="w-3 h-3 fill-accent text-accent" aria-hidden="true" />
))}
</div>
</div>
<p className="text-xs text-ink-2 leading-relaxed font-body">
"{rev.body}"
</p>
</div>
<div className="mt-4 pt-2 border-t border-rule text-xs font-body">
<span className="font-semibold text-ink block">{rev.name}</span>
<span className="text-muted block text-[11px]">{rev.role}</span>
</div>
</div>
))}
</Marquee>
</div>
@@ -196,59 +145,3 @@ export function ReviewsMarqueeSection({
</section>
);
}
function ReviewCard({
name,
username,
role,
rating,
avatar,
body,
tool,
}: {
name: string;
username: string;
role: string;
rating: number;
avatar: string;
body: string;
tool: string;
}) {
return (
<figure className="relative w-80 sm:w-96 cursor-pointer overflow-hidden rounded-2xl border border-slate-200/90 bg-white p-5 shadow-cream-sm hover:border-blue-300 transition-[border-color,transform] duration-300 ease-[cubic-bezier(0.16,1,0.3,1)]">
<div className="flex items-center justify-between">
<div className="flex items-center gap-3">
<div className="w-10 h-10 rounded-full bg-gradient-to-tr from-blue-600 to-indigo-600 flex items-center justify-center text-white text-xs font-bold tracking-wider shadow-sm">
{avatar}
</div>
<div>
<div className="flex items-center gap-1.5">
<span className="text-sm font-display font-bold text-slate-900">{name}</span>
<CheckCircle2 className="w-3.5 h-3.5 text-blue-600" />
</div>
<p className="text-[11px] text-slate-500">{role}</p>
</div>
</div>
<div className="flex items-center gap-0.5">
{Array(rating)
.fill(0)
.map((_, i) => (
<Star key={i} className="w-3 h-3 fill-amber-400 text-amber-400" />
))}
</div>
</div>
<blockquote className="mt-3.5 text-xs text-slate-600 leading-relaxed font-sans">
“{body}”
</blockquote>
<div className="mt-4 pt-3 border-t border-slate-100 flex items-center justify-between text-[11px] font-mono text-slate-600">
<span className="px-2 py-0.5 rounded bg-blue-50 text-blue-700 font-semibold border border-blue-200/80">
{tool}
</span>
<span className="text-slate-600">{username}</span>
</div>
</figure>
);
}
@@ -2,8 +2,7 @@
import React, { useState, useRef, useEffect, useCallback } from 'react';
import Link from 'next/link';
import { ArrowRight, Sparkles } from 'lucide-react';
import { TextAnimate } from '@/components/magicui/text-animate';
import { ArrowRight } from 'lucide-react';
import { ToolItem } from '@/types';
export interface ToolMediaItem {
@@ -27,11 +26,11 @@ export interface ShiftableToolsGridProps {
}
export const DEFAULT_TOOL_ITEMS: ToolMediaItem[] = [
// ROW 1 (4 items) - Landscape 16:9 assets
// ROW 1 (4 items)
{
id: 'tool-blemish',
slug: 'blemish-remover',
title: 'Skin & Blemish Retoucher',
title: 'Skin & blemish retoucher',
mediaType: 'comparison',
beforeUrl: '/management/pages/home/sections/our-tools/blemish-remover/before.jpg',
afterUrl: '/management/pages/home/sections/our-tools/blemish-remover/after.jpg',
@@ -39,7 +38,7 @@ export const DEFAULT_TOOL_ITEMS: ToolMediaItem[] = [
{
id: 'tool-bg-remover',
slug: 'background-remover',
title: 'Background Remover (Alpha Matting)',
title: 'Background remover (alpha matting)',
mediaType: 'video',
videoUrl: '/management/pages/home/sections/our-tools/background-remover/sample_reel.mp4',
poster: '/management/pages/home/sections/our-tools/background-remover/poster.jpg',
@@ -47,7 +46,7 @@ export const DEFAULT_TOOL_ITEMS: ToolMediaItem[] = [
{
id: 'tool-enhancer',
slug: 'photo-enhancer',
title: 'Photo Enhancer 4K',
title: 'Photo enhancer 4K',
mediaType: 'comparison',
beforeUrl: '/management/pages/home/sections/our-tools/photo-enhancer/before.jpg',
afterUrl: '/management/pages/home/sections/our-tools/photo-enhancer/after.jpg',
@@ -55,17 +54,17 @@ export const DEFAULT_TOOL_ITEMS: ToolMediaItem[] = [
{
id: 'tool-restorer',
slug: 'old-photo-restorer',
title: 'Vintage Photo Restorer',
title: 'Vintage photo restorer',
mediaType: 'comparison',
beforeUrl: '/management/pages/home/sections/our-tools/old-photo-restorer/before.jpg',
afterUrl: '/management/pages/home/sections/our-tools/old-photo-restorer/after.jpg',
},
// ROW 2 (4 items) - Landscape 16:9 assets
// ROW 2 (4 items)
{
id: 'tool-colorization',
slug: 'colorization',
title: 'AI Colorizer',
title: 'Photo colorizer',
mediaType: 'comparison',
beforeUrl: '/management/pages/home/sections/our-tools/colorization/before.jpg',
afterUrl: '/management/pages/home/sections/our-tools/colorization/after.jpg',
@@ -73,7 +72,7 @@ export const DEFAULT_TOOL_ITEMS: ToolMediaItem[] = [
{
id: 'tool-teeth',
slug: 'teeth-whitener',
title: 'Teeth Whitener & Brightener',
title: 'Teeth whitener & brightener',
mediaType: 'comparison',
beforeUrl: '/management/pages/home/sections/our-tools/teeth-whitener/before.jpg',
afterUrl: '/management/pages/home/sections/our-tools/teeth-whitener/after.jpg',
@@ -81,7 +80,7 @@ export const DEFAULT_TOOL_ITEMS: ToolMediaItem[] = [
{
id: 'tool-cartoon',
slug: 'cartoon-avatar',
title: 'Cartoon & Anime Avatar',
title: 'Cartoon & anime avatar',
mediaType: 'comparison',
beforeUrl: '/management/pages/home/sections/our-tools/cartoon-avatar/before.jpg',
afterUrl: '/management/pages/home/sections/our-tools/cartoon-avatar/after.jpg',
@@ -89,22 +88,21 @@ export const DEFAULT_TOOL_ITEMS: ToolMediaItem[] = [
{
id: 'tool-polaroid',
slug: 'polaroid-maker',
title: 'Vintage Polaroid Maker',
title: 'Vintage polaroid maker',
mediaType: 'photo',
imageUrl: '/management/pages/home/sections/our-tools/polaroid-maker/image.jpg',
},
];
export function ShiftableToolsGridSection({
title = 'Our Tools',
subtitle = 'Click on any tool window to try with your own photos in seconds.',
title = 'Our tools',
subtitle = 'Test any tool directly in your browser with your own photos.',
items,
}: ShiftableToolsGridProps) {
const displayItems = items && items.length >= 8 ? items : DEFAULT_TOOL_ITEMS;
const row1 = displayItems.slice(0, 4);
const row2 = displayItems.slice(4, 8);
// Expansion only starts when that section reaches the middle (top of section <= 50% of viewport)
const [isMiddleReached, setIsMiddleReached] = useState(false);
useEffect(() => {
@@ -112,7 +110,6 @@ export function ShiftableToolsGridSection({
const section = document.getElementById('our-tools');
if (!section) return;
const rect = section.getBoundingClientRect();
// Only start expansion once the section reaches the middle of the viewport
const inMiddle = rect.top <= window.innerHeight * 0.5 && rect.bottom >= window.innerHeight * 0.15;
setIsMiddleReached(inMiddle);
};
@@ -127,32 +124,15 @@ export function ShiftableToolsGridSection({
}, []);
return (
<section id="our-tools" className="py-14 sm:py-20 px-4 sm:px-6 md:px-8 lg:px-10 bg-[#FAF8F5] relative overflow-hidden">
{/* Symbolic Elemental Ambient Highlights */}
<div
className="absolute inset-0 pointer-events-none -z-10"
style={{
background: 'radial-gradient(circle at 15% 30%, rgba(37,99,235,0.06) 0%, transparent 60%), radial-gradient(circle at 85% 70%, rgba(147,51,234,0.05) 0%, transparent 60%)',
}}
/>
<div className="max-w-[1640px] mx-auto space-y-10">
{/* Header */}
<div className="text-center max-w-3xl mx-auto space-y-4">
<div className="inline-flex items-center gap-2 px-3.5 py-1 rounded-full text-xs font-mono font-semibold tracking-wider uppercase text-blue-700 bg-blue-50 border border-blue-200">
<Sparkles className="w-3.5 h-3.5 text-blue-600" />
<span>AI Creative Tools</span>
</div>
<h2 className="text-3xl sm:text-5xl font-display font-extrabold text-slate-900 tracking-tight">
<TextAnimate animation="slideLeft" by="word">
{title}
</TextAnimate>
<section id="our-tools" className="py-16 sm:py-24 px-4 sm:px-6 md:px-8 lg:px-10 bg-paper border-b border-rule relative overflow-hidden">
<div className="max-w-container mx-auto space-y-10">
{/* Section Header - Clean editorial layout without eyebrows */}
<div className="max-w-2xl space-y-2 border-b border-rule pb-5">
<h2 className="text-3xl sm:text-4xl font-display font-bold text-ink tracking-tight">
{title}
</h2>
<p className="text-sm sm:text-base text-slate-600 font-sans text-pretty">
<TextAnimate animation="fadeIn" by="word" delay={0.08}>
{subtitle}
</TextAnimate>
<p className="text-sm sm:text-base text-ink-2 font-body text-pretty">
{subtitle}
</p>
</div>
@@ -162,19 +142,20 @@ export function ShiftableToolsGridSection({
<ShiftableRow items={row2} isEnabled={isMiddleReached} />
</div>
{/* Mobile / Phone View (<md): Pure Vertical Stack (NOT placed horizontally) */}
{/* Mobile / Phone View (<md): Pure Vertical Stack */}
<div className="block md:hidden">
<MobileVerticalToolsList items={displayItems} />
</div>
{/* See More Section Button Redirecting to /tools */}
<div className="pt-6 text-center">
{/* All tools link */}
<div className="pt-4 flex justify-between items-center text-xs font-body text-muted border-t border-rule">
<span>Eight neural models active on web trial</span>
<Link
href="/tools"
className="group inline-flex items-center gap-2.5 px-8 py-4 rounded-full font-bold text-xs sm:text-sm text-white bg-gradient-to-r from-slate-950 via-slate-900 to-indigo-950 hover:from-blue-600 hover:to-indigo-600 border border-white/10 shadow-lg shadow-slate-900/15 transition-[transform,opacity] duration-300 ease-[cubic-bezier(0.16,1,0.3,1)] hover:scale-105 active:scale-95"
className="text-accent hover:underline font-medium inline-flex items-center gap-1"
>
<span>See More Tools</span>
<ArrowRight className="w-4 h-4 transition-transform duration-300 ease-[cubic-bezier(0.16,1,0.3,1)] group-hover:translate-x-1" />
<span>View complete tool directory</span>
<ArrowRight className="w-3.5 h-3.5" aria-hidden="true" />
</Link>
</div>
</div>
@@ -187,39 +168,26 @@ function MobileVerticalToolsList({ items }: { items: ToolMediaItem[] }) {
<div className="flex flex-col gap-6 w-full">
{items.map((item) => (
<div key={item.id} className="w-full flex flex-col">
{item.mediaType === 'comparison' ? (
<div
style={{ borderRadius: '24px' }}
className="group block relative w-full h-[240px] rounded-[24px] overflow-hidden isolate bg-slate-950 border border-slate-900/[0.08] shadow-cream-sm"
>
<div className="studio-sheet p-3 crop-marked">
<div className="relative w-full h-[220px] rounded-card overflow-hidden bg-paper-2">
<ToolWindowMedia item={item} isHovered={false} />
<Link
href={`/tools/${item.slug}`}
className="absolute top-3 right-3 z-30 inline-flex items-center gap-1.5 px-3.5 py-1.5 rounded-full text-[10px] font-mono font-bold tracking-wider uppercase bg-slate-950/90 text-white border border-white/20 hover:bg-blue-600 transition-colors shadow-sm cursor-pointer"
className="absolute top-2.5 right-2.5 z-30 inline-flex items-center gap-1 px-2.5 py-1 rounded-card text-xs font-body bg-paper-hi/90 text-ink border border-rule hover:border-ink transition-colors shadow-sm"
aria-label={`Open ${item.title}`}
>
<span>TRY TOOL</span>
<ArrowRight className="w-2.5 h-2.5" />
<span>Try tool</span>
<ArrowRight className="w-3 h-3" aria-hidden="true" />
</Link>
</div>
) : (
<Link
href={`/tools/${item.slug}`}
style={{ borderRadius: '24px' }}
className="group block relative w-full h-[240px] rounded-[24px] overflow-hidden isolate bg-slate-950 border border-slate-900/[0.08] shadow-cream-sm cursor-pointer"
className="mt-2.5 flex items-center justify-between text-sm font-body font-semibold text-ink hover:text-accent transition-colors"
>
<ToolWindowMedia item={item} isHovered={false} />
<span>{item.title}</span>
<ArrowRight className="w-3.5 h-3.5 text-muted" aria-hidden="true" />
</Link>
)}
{/* Title Below Window */}
<Link
href={`/tools/${item.slug}`}
className="mt-2.5 px-1 flex items-center justify-between text-sm font-display font-bold text-slate-900 hover:text-blue-600 transition-colors"
>
<span>{item.title}</span>
<ArrowRight className="w-4 h-4 text-slate-400 group-hover:text-blue-600 group-hover:translate-x-0.5 transition-transform" />
</Link>
</div>
</div>
))}
</div>
@@ -229,7 +197,6 @@ function MobileVerticalToolsList({ items }: { items: ToolMediaItem[] }) {
function ShiftableRow({ items, isEnabled = true }: { items: ToolMediaItem[]; isEnabled?: boolean }) {
const [hoveredId, setHoveredId] = useState<string | null>(null);
// Clear any active hover expansion if the section leaves the active middle viewport zone
useEffect(() => {
if (!isEnabled) {
setHoveredId(null);
@@ -237,17 +204,11 @@ function ShiftableRow({ items, isEnabled = true }: { items: ToolMediaItem[]; isE
}, [isEnabled]);
return (
<div className="flex flex-row gap-6 w-full items-start overflow-visible">
<div className="flex flex-row gap-5 w-full items-start overflow-visible">
{items.map((item) => {
const isHovered = isEnabled && hoveredId === item.id;
const hasOtherHovered = isEnabled && hoveredId !== null && !isHovered;
// Subtle, refined expansion (lesser shift, lesser expansion):
// Hovered card: 1.28 flex-grow (~32% width, gentle expansion)
// Other cards: 0.9066 flex-grow (~22.6% width, minimal displacement)
// At rest or before middle reached: 1.0 flex-grow (25% width each)
// Sum is mathematically conserved at exactly 4.0 (1.28 + 3 * 0.9066 = 4.00)
const flexGrowValue = isHovered ? 1.28 : hasOtherHovered ? 0.9066 : 1;
const flexGrowValue = isHovered ? 1.25 : hasOtherHovered ? 0.916 : 1;
return (
<div
@@ -256,63 +217,31 @@ function ShiftableRow({ items, isEnabled = true }: { items: ToolMediaItem[]; isE
if (isEnabled) setHoveredId(item.id);
}}
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-500 ease-[cubic-bezier(0.16,1,0.3,1)] flex flex-col min-w-0"
style={{
flexGrow: flexGrowValue,
}}
className="flex-1 transition-[flex-grow] duration-300 ease-out flex flex-col min-w-0"
style={{ flexGrow: flexGrowValue }}
>
{/* Window Container with strictly locked pixel height & landscape aspect */}
{item.mediaType === 'comparison' ? (
<div
style={{ borderRadius: '28px' }}
className="group block relative w-full h-[220px] sm:h-[240px] lg:h-[260px] rounded-[28px] sm:rounded-[36px] overflow-hidden isolate bg-slate-950 border border-slate-900/[0.08] shadow-cream-sm"
>
{/* GPU-Composited Shadow Elevation Layer */}
<div
style={{ borderRadius: '28px' }}
className="absolute -inset-px rounded-[28px] sm:rounded-[36px] shadow-cream-lg opacity-0 group-hover:opacity-100 transition-opacity duration-700 ease-[cubic-bezier(0.16,1,0.3,1)] pointer-events-none z-30"
aria-hidden="true"
/>
{/* Media Renderer (Interactive comparison slider with desktop hover + mobile touch handle) */}
<div className="studio-sheet p-3 crop-marked">
<div className="relative w-full h-[200px] lg:h-[220px] rounded-card overflow-hidden bg-paper-2">
<ToolWindowMedia item={item} isHovered={isHovered} />
{/* Dedicated Tool Link Pill on top right so sliding never accidentally navigates */}
<Link
href={`/tools/${item.slug}`}
className="absolute top-3 right-3 z-30 inline-flex items-center gap-1.5 px-3 py-1.5 rounded-full text-[10px] font-mono font-bold tracking-wider uppercase bg-slate-950/90 text-white border border-white/20 hover:bg-blue-600 transition-colors shadow-sm cursor-pointer"
className="absolute top-2.5 right-2.5 z-30 inline-flex items-center gap-1 px-2.5 py-1 rounded-card text-xs font-body bg-paper-hi/90 text-ink border border-rule hover:border-ink transition-colors shadow-sm"
aria-label={`Open ${item.title}`}
>
<span>TRY TOOL</span>
<ArrowRight className="w-2.5 h-2.5" />
<span>Try tool</span>
<ArrowRight className="w-3 h-3" aria-hidden="true" />
</Link>
</div>
) : (
<Link
href={`/tools/${item.slug}`}
style={{ borderRadius: '28px' }}
className="group block relative w-full h-[220px] sm:h-[240px] lg:h-[260px] rounded-[28px] sm:rounded-[36px] overflow-hidden isolate bg-slate-950 border border-slate-900/[0.08] shadow-cream-sm cursor-pointer"
className="mt-2.5 flex items-center justify-between text-sm font-body font-medium text-ink hover:text-accent transition-colors"
>
{/* GPU-Composited Shadow Elevation Layer (Opacity-only transition, zero paint thrash) */}
<div
style={{ borderRadius: '28px' }}
className="absolute -inset-px rounded-[28px] sm:rounded-[36px] shadow-cream-lg opacity-0 group-hover:opacity-100 transition-opacity duration-700 ease-[cubic-bezier(0.16,1,0.3,1)] pointer-events-none z-30"
aria-hidden="true"
/>
{/* Media Renderer */}
<ToolWindowMedia item={item} isHovered={isHovered} />
<span className="truncate">{item.title}</span>
<ArrowRight className="w-3.5 h-3.5 text-muted ml-1 shrink-0" aria-hidden="true" />
</Link>
)}
{/* Little Title Below Window (Fixed height, no vertical jumping) */}
<Link
href={`/tools/${item.slug}`}
className="mt-2.5 h-6 px-1 flex items-center justify-between text-xs sm:text-sm font-display font-semibold text-slate-800 hover:text-blue-600 transition-colors duration-300 ease-[cubic-bezier(0.16,1,0.3,1)] group"
>
<span className="truncate">{item.title}</span>
<ArrowRight className="w-3.5 h-3.5 text-slate-400 group-hover:text-blue-600 group-hover:translate-x-0.5 transition-transform duration-300 ease-[cubic-bezier(0.16,1,0.3,1)] flex-shrink-0 ml-1.5" />
</Link>
</div>
</div>
);
})}
@@ -327,7 +256,6 @@ function ToolWindowMedia({ item, isHovered }: { item: ToolMediaItem; isHovered:
const clipLayerRef = useRef<HTMLDivElement>(null);
const handleRef = useRef<HTMLDivElement>(null);
// High performance refs - completely eliminates per-frame React re-renders!
const isManualRef = useRef(false);
const isPointerDownRef = useRef(false);
const currentPercentRef = useRef(50);
@@ -335,7 +263,6 @@ function ToolWindowMedia({ item, isHovered }: { item: ToolMediaItem; isHovered:
const pointerRafRef = useRef<number | null>(null);
const cachedRectRef = useRef<{ left: number; width: number } | null>(null);
// Directly mutate DOM styles on the GPU layer without triggering React reconciliation
const setSliderDOM = useCallback((percent: number) => {
const clamped = Math.max(0, Math.min(100, percent));
currentPercentRef.current = clamped;
@@ -343,16 +270,14 @@ function ToolWindowMedia({ item, isHovered }: { item: ToolMediaItem; isHovered:
dividerRef.current.style.left = `${clamped}%`;
}
if (clipLayerRef.current) {
clipLayerRef.current.style.clipPath = `inset(0 ${100 - clamped}% 0 0 round 28px 0 0 28px)`;
(clipLayerRef.current.style as any).webkitClipPath = `inset(0 ${100 - clamped}% 0 0 round 28px 0 0 28px)`;
clipLayerRef.current.style.clipPath = `inset(0 ${100 - clamped}% 0 0)`;
(clipLayerRef.current.style as any).webkitClipPath = `inset(0 ${100 - clamped}% 0 0)`;
}
if (handleRef.current) {
handleRef.current.setAttribute('aria-valuenow', `${Math.round(clamped)}`);
}
}, []);
// Continuous Autoplay Muted Loop when visible in viewport
// Pauses automatically when scrolled out of view or tab is hidden to save GPU/battery and eliminate device heating
useEffect(() => {
if (item.mediaType !== 'video') return;
const video = videoRef.current;
@@ -394,7 +319,6 @@ function ToolWindowMedia({ item, isHovered }: { item: ToolMediaItem; isHovered:
};
}, [item.mediaType]);
// When unhovered, reset slider smoothly to 50%
useEffect(() => {
if (item.mediaType !== 'comparison') return;
@@ -408,7 +332,6 @@ function ToolWindowMedia({ item, isHovered }: { item: ToolMediaItem; isHovered:
}
}, [isHovered, item.mediaType, setSliderDOM]);
// Instant pixel-precise cursor alignment calculation
const updateToClientX = useCallback((clientX: number) => {
if (!containerRef.current) return;
const rect = cachedRectRef.current || containerRef.current.getBoundingClientRect();
@@ -418,7 +341,6 @@ function ToolWindowMedia({ item, isHovered }: { item: ToolMediaItem; isHovered:
setSliderDOM(percent);
}, [setSliderDOM]);
// Desktop Mouse Movement: Immediately aligns comparison bar with cursor on hover and stays locked
const handleContainerPointerEnter = (e: React.PointerEvent<HTMLDivElement> | React.MouseEvent<HTMLDivElement>) => {
if (item.mediaType !== 'comparison') return;
if (!('pointerType' in e) || e.pointerType === 'mouse') {
@@ -451,7 +373,6 @@ function ToolWindowMedia({ item, isHovered }: { item: ToolMediaItem; isHovered:
}
};
// Dedicated Drag Handlers for Center Arrow Handle (Works on mobile touch & desktop click-drag)
const handleHandlePointerDown = (e: React.PointerEvent<HTMLDivElement>) => {
if (item.mediaType !== 'comparison') return;
if (e.button !== 0 && e.pointerType === 'mouse') return;
@@ -511,27 +432,10 @@ function ToolWindowMedia({ item, isHovered }: { item: ToolMediaItem; isHovered:
}
};
const handleKeyDown = (e: React.KeyboardEvent<HTMLDivElement>) => {
if (item.mediaType !== 'comparison') return;
const step = e.shiftKey ? 10 : 2;
if (e.key === 'ArrowLeft' || e.key === 'ArrowDown') {
e.preventDefault();
isManualRef.current = true;
setSliderDOM(currentPercentRef.current - step);
} else if (e.key === 'ArrowRight' || e.key === 'ArrowUp') {
e.preventDefault();
isManualRef.current = true;
setSliderDOM(currentPercentRef.current + step);
}
};
// 1. VIDEO (Strictly locked to fixed 680px centered width - ZERO ZOOM)
// 1. VIDEO
if (item.mediaType === 'video' && item.videoUrl) {
return (
<div
style={{ borderRadius: '28px' }}
className="relative w-full h-full overflow-hidden bg-slate-950 rounded-[28px] sm:rounded-[36px] isolate"
>
<div className="relative w-full h-full overflow-hidden bg-paper-2 isolate">
<video
ref={videoRef}
src={item.videoUrl}
@@ -541,19 +445,13 @@ function ToolWindowMedia({ item, isHovered }: { item: ToolMediaItem; isHovered:
loop
playsInline
preload="auto"
style={{ borderRadius: '28px' }}
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) */}
<div
style={{ borderRadius: '28px' }}
className="absolute inset-0 bg-slate-950/10 opacity-100 group-hover:opacity-0 transition-opacity duration-700 ease-[cubic-bezier(0.16,1,0.3,1)] pointer-events-none"
className="absolute inset-0 w-full h-full object-cover pointer-events-none"
/>
</div>
);
}
// 2. COMPARISON: Pixel-perfect clip-path slider (ZERO ZOOM - locked fixed scale & centered position)
// 2. COMPARISON
if (item.mediaType === 'comparison' && item.beforeUrl && item.afterUrl) {
return (
<div
@@ -564,54 +462,44 @@ function ToolWindowMedia({ item, isHovered }: { item: ToolMediaItem; isHovered:
onMouseMove={handleContainerPointerMove}
onPointerLeave={handleContainerPointerLeave}
onMouseLeave={handleContainerPointerLeave}
style={{
touchAction: 'pan-y',
borderRadius: '28px',
}}
className="relative w-full h-full select-none overflow-hidden bg-slate-950 rounded-[28px] sm:rounded-[36px] isolate cursor-ew-resize"
style={{ touchAction: 'pan-y' }}
className="relative w-full h-full select-none overflow-hidden bg-paper-2 isolate cursor-ew-resize"
>
{/* Layer 1: AFTER Image (Base layer, fixed scale & position, 0% zoom) */}
{/* Layer 1: Enhanced Image */}
<img
src={item.afterUrl}
alt="After"
style={{ borderRadius: '28px' }}
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]"
alt={`${item.title} - enhanced`}
className="absolute inset-0 w-full h-full object-cover pointer-events-none"
loading="lazy"
/>
{/* Layer 2: BEFORE Image (Clipped container-sized layer - 100% exact alignment with slider divider on phone & desktop) */}
{/* Layer 2: Original Image */}
<div
ref={clipLayerRef}
className="absolute inset-0 overflow-hidden rounded-[28px] sm:rounded-[36px] isolate pointer-events-none"
style={{
borderRadius: '28px',
clipPath: 'inset(0 50% 0 0 round 28px 0 0 28px)',
WebkitClipPath: 'inset(0 50% 0 0 round 28px 0 0 28px)',
}}
className="absolute inset-0 overflow-hidden isolate pointer-events-none"
style={{ clipPath: 'inset(0 50% 0 0)' }}
>
<img
src={item.beforeUrl}
alt="Before"
style={{ borderRadius: '28px' }}
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]"
alt={`${item.title} - original`}
className="absolute inset-0 w-full h-full object-cover pointer-events-none"
loading="lazy"
/>
</div>
{/* Glowing Slider Divider Line (pointer-events-none so touching the line allows page scroll) */}
{/* Slider Divider Line */}
<div
ref={dividerRef}
className="absolute top-0 bottom-0 w-[2.5px] bg-white shadow-[0_0_12px_rgba(255,255,255,1)] pointer-events-none z-10 will-change-transform transform-gpu -translate-x-1/2"
className="absolute top-0 bottom-0 w-px bg-paper-hi z-10 pointer-events-none -translate-x-1/2"
style={{ left: '50%' }}
>
{/* Circular Grab Handle with Before/After Arrow Cue & Touch Hit Area */}
{/* Circular Grab Handle */}
<div
ref={handleRef}
onPointerDown={handleHandlePointerDown}
onPointerMove={handleHandlePointerMove}
onPointerUp={handleHandlePointerUp}
onPointerCancel={handleHandlePointerUp}
onKeyDown={handleKeyDown}
role="slider"
aria-label="Before and after comparison slider"
aria-valuemin={0}
@@ -619,45 +507,36 @@ function ToolWindowMedia({ item, isHovered }: { item: ToolMediaItem; isHovered:
aria-valuenow={50}
tabIndex={0}
style={{ touchAction: 'none' }}
className="absolute top-1/2 -translate-y-1/2 -translate-x-1/2 left-1/2 w-9 h-9 sm:w-10 sm:h-10 rounded-full bg-white shadow-xl border border-slate-200/90 flex items-center justify-center text-xs font-bold text-blue-600 pointer-events-auto cursor-ew-resize touch-none before:absolute before:-inset-4 before:content-[''] hover:scale-110 active:scale-95 transition-transform"
className="absolute top-1/2 -translate-y-1/2 -translate-x-1/2 left-1/2 w-7 h-7 rounded-full bg-paper-hi border border-rule flex items-center justify-center text-xs text-accent pointer-events-auto cursor-ew-resize touch-none shadow-sm"
>
↔
<svg className="w-3 h-3 text-accent pointer-events-none" fill="none" stroke="currentColor" viewBox="0 0 24 24" aria-hidden="true">
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M8 9l-3 3 3 3m8-6l3 3-3 3" />
</svg>
</div>
</div>
{/* Badges with Smooth Contrast: BEFORE on left, AFTER on right */}
<div
className="absolute bottom-3 inset-x-3 flex justify-between pointer-events-none z-20 text-[9px] font-mono font-bold uppercase tracking-wider text-white"
>
<span className="bg-slate-950/85 px-2 py-0.5 rounded border border-white/10 shadow-xs">
BEFORE
{/* Badges in sentence case body face */}
<div className="absolute bottom-2 inset-x-2 flex justify-between pointer-events-none z-20 text-xs font-body text-ink">
<span className="bg-paper-hi/90 px-1.5 py-0.5 rounded border border-rule shadow-xs">
Original
</span>
<span className="bg-blue-600 px-2 py-0.5 rounded border border-white/20 shadow-xs">
AFTER
<span className="bg-paper-hi/90 px-1.5 py-0.5 rounded border border-rule shadow-xs">
Enhanced
</span>
</div>
</div>
);
}
// 3. PHOTO (Strictly locked to fixed 680px centered width - ZERO ZOOM)
// 3. PHOTO
return (
<div
style={{ borderRadius: '28px' }}
className="relative w-full h-full overflow-hidden bg-slate-950 rounded-[28px] sm:rounded-[36px] isolate"
>
<div className="relative w-full h-full overflow-hidden bg-paper-2 isolate">
<img
src={item.imageUrl || item.afterUrl || item.beforeUrl || '/brand/og-default.png'}
alt={item.title}
style={{ borderRadius: '28px' }}
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]"
className="absolute inset-0 w-full h-full object-cover pointer-events-none"
loading="lazy"
/>
{/* GPU-composited overlay (opacity only) */}
<div
style={{ borderRadius: '28px' }}
className="absolute inset-0 bg-slate-950/10 opacity-100 group-hover:opacity-0 transition-opacity duration-700 ease-[cubic-bezier(0.16,1,0.3,1)] pointer-events-none"
/>
</div>
);
}
+75 -157
View File
@@ -3,22 +3,16 @@
import React, { useState } from 'react';
import Link from 'next/link';
import {
Sparkles,
Scissors,
Wand2,
Palette,
Video,
SunMedium,
Layers,
ArrowRight,
GripHorizontal,
Smile,
Camera,
Eye,
Eraser,
Film
Sparkles
} from 'lucide-react';
import { TextAnimate } from '@/components/magicui/text-animate';
interface TrendyBentoSectionProps {
title?: string;
@@ -35,260 +29,184 @@ interface TileItem {
category: EffectCategory;
href: string;
cta: string;
badge: string;
tag: string;
icon: React.ElementType;
imageUrl: string;
}
const CATEGORIES: { id: EffectCategory; label: string }[] = [
{ id: 'all', label: 'All Effects' },
{ id: 'portrait', label: 'Portrait & Beauty' },
{ id: 'cutout', label: 'Cutout & Matting' },
{ id: 'all', label: 'All capabilities' },
{ id: 'portrait', label: 'Portrait & beauty' },
{ id: 'cutout', label: 'Cutout & matting' },
{ id: 'restore', label: 'Restoration & 4K' },
{ id: 'creative', label: 'Creative & Anime' },
{ id: 'creative', label: 'Creative & anime' },
];
const INITIAL_TILES: TileItem[] = [
{
id: 'tile-matting',
name: 'Hair-Strand Matting',
name: 'Hair-strand matting',
description: 'Flyaway hair boundary separation with sub-pixel alpha matting.',
category: 'cutout',
href: '/tools/background-remover',
cta: 'Try Matting',
badge: 'TRENDING CUTOUT',
cta: 'Test matting',
tag: 'Alpha matting',
icon: Scissors,
imageUrl: '/management/pages/home/sections/trendy-bento/media/matting.jpg',
},
{
id: 'tile-restore',
name: '4K Face Restore',
description: 'Generative restoration preserving real skin pores and eyelashes.',
name: '4K archival restoration',
description: 'Generative restoration preserving natural skin pores and textures.',
category: 'restore',
href: '/tools/old-photo-restorer',
cta: 'Restore Photo',
badge: '4K RESTORE',
cta: 'Restore photo',
tag: 'Neural restoration',
icon: Wand2,
imageUrl: '/management/pages/home/sections/trendy-bento/media/restore.jpg',
},
{
id: 'tile-anime',
name: 'AnimeGAN Synthesis',
description: 'Transform portraits into high-definition anime illustrations.',
name: 'Anime synthesis',
description: 'Transform portraits into high-definition styled illustrations.',
category: 'creative',
href: '/tools/cartoon-avatar',
cta: 'Create Avatar',
badge: 'VIRAL ANIME',
cta: 'Create avatar',
tag: 'Artistic style',
icon: Sparkles,
imageUrl: '/management/pages/home/sections/trendy-bento/media/anime.jpg',
},
{
id: 'tile-video',
name: 'Video Retouching',
description: 'Temporal epidermal smoothing across 4K dynamic video clips.',
category: 'portrait',
href: '/tools/blemish-remover',
cta: 'Watch Reel',
badge: '4K 60FPS',
icon: Video,
imageUrl: '/management/pages/home/sections/trendy-bento/media/video.jpg',
},
{
id: 'tile-color',
name: 'Deep Colorizer',
description: 'Reconstruct vintage monochrome family archives with rich pigments.',
name: 'Deep colorizer',
description: 'Reconstruct monochrome family archives with realistic pigments.',
category: 'restore',
href: '/tools/colorization',
cta: 'Colorize Archive',
badge: 'ARCHIVAL AI',
cta: 'Colorize archive',
tag: 'Chromatic fill',
icon: Palette,
imageUrl: '/management/pages/home/sections/trendy-bento/media/color.jpg',
},
{
id: 'tile-relight',
name: 'Studio Relight',
description: 'Virtual three-point studio softbox illumination and portrait retouch.',
name: 'Studio relighting',
description: 'Calibrated virtual softbox illumination and skin tonal balance.',
category: 'portrait',
href: '/tools/blemish-remover',
cta: 'Relight Portrait',
badge: 'STUDIO GRADE',
cta: 'Relight portrait',
tag: 'Studio light',
icon: SunMedium,
imageUrl: '/management/pages/home/sections/trendy-bento/media/portrait.jpg',
},
{
id: 'tile-teeth',
name: 'Teeth Whitener AI',
description: 'Enamel luminosity brightening with natural gum tone preservation.',
name: 'Teeth brightening',
description: 'Enamel luminosity adjustment with realistic gum tone preservation.',
category: 'portrait',
href: '/tools/teeth-whitener',
cta: 'Brighten Smile',
badge: 'SMILE ENHANCE',
cta: 'Brighten smile',
tag: 'Retouching',
icon: Smile,
imageUrl: '/management/pages/home/sections/trendy-bento/media/teeth.jpg',
},
{
id: 'tile-cutout-studio',
name: 'E-Commerce White Studio',
description: 'Instant clean white backdrops and transparent PNG exports for shops.',
name: 'Catalog isolation',
description: 'Clean backdrops and transparent PNG exports for ecommerce.',
category: 'cutout',
href: '/tools/background-remover',
cta: 'Cutout Product',
badge: 'ECOMMERCE',
cta: 'Cutout product',
tag: 'Commercial',
icon: Eraser,
imageUrl: '/management/pages/home/sections/trendy-bento/media/matting.jpg',
},
{
id: 'tile-polaroid',
name: 'Vintage Polaroid',
description: 'Warm analog grain, authentic border frames, and vintage flash tones.',
category: 'creative',
href: '/tools/polaroid-maker',
cta: 'Make Polaroid',
badge: 'VINTAGE FILM',
icon: Camera,
imageUrl: '/management/pages/home/sections/trendy-bento/media/polaroid.jpg',
},
{
id: 'tile-eyes',
name: 'Iris Glint Sharpener',
description: 'Crystal-clear eye reflections and sub-millimeter pupil depth enhancement.',
category: 'restore',
href: '/tools/photo-enhancer',
cta: 'Sharpen Eyes',
badge: '4K CLARITY',
icon: Eye,
imageUrl: '/management/pages/home/media/landscape_enhancer_after.jpg',
},
];
export function TrendyBentoSection({
title = 'Trendy Neural Effects',
badge = 'EXPLORE CATEGORIES',
subtitle = 'Discover our collection of viral AI effects. Tap any category to explore specialized tools.',
title = 'Specialized capabilities',
subtitle = 'Computer vision models engineered for professional photographers and studios.',
}: TrendyBentoSectionProps) {
const [activeCategory, setActiveCategory] = useState<EffectCategory>('all');
const tiles = INITIAL_TILES;
// Filtered tiles based on category
const displayedTiles = activeCategory === 'all'
? tiles
: tiles.filter((t) => t.category === activeCategory);
return (
<section id="trendy-effects" className="py-14 sm:py-20 px-4 sm:px-6 md:px-8 lg:px-10 bg-[#FAF8F5] relative overflow-hidden border-t border-slate-900/[0.06]">
{/* Symbolic Elemental Ambient Background Animation */}
<div
className="absolute inset-0 pointer-events-none -z-10"
style={{
background: 'radial-gradient(circle at 80% 20%, rgba(99,102,241,0.06) 0%, transparent 50%), radial-gradient(circle at 20% 80%, rgba(6,182,212,0.05) 0%, transparent 50%)',
}}
/>
<div className="max-w-[1640px] mx-auto space-y-10">
<section id="trendy-effects" className="py-16 sm:py-24 px-4 sm:px-6 md:px-8 lg:px-10 bg-paper border-b border-rule relative">
<div className="max-w-container mx-auto space-y-10">
{/* Header */}
<div className="text-center max-w-3xl mx-auto space-y-4">
<div className="inline-flex items-center gap-2 px-3.5 py-1 rounded-full text-xs font-mono font-semibold tracking-wider uppercase text-blue-700 bg-blue-50 border border-blue-200">
<Sparkles className="w-3.5 h-3.5 text-blue-600" />
<span>{badge}</span>
</div>
<h2 className="text-3xl sm:text-5xl font-display font-extrabold text-slate-900 tracking-tight text-balance">
<TextAnimate animation="slideLeft" by="word">
{title}
</TextAnimate>
<div className="max-w-2xl space-y-2 border-b border-rule pb-5">
<h2 className="text-3xl sm:text-4xl font-display font-bold text-ink tracking-tight">
{title}
</h2>
<p className="text-sm sm:text-base text-slate-600 font-sans text-pretty">
<TextAnimate animation="fadeIn" by="word" delay={0.08}>
{subtitle}
</TextAnimate>
<p className="text-sm sm:text-base text-ink-2 font-body text-pretty">
{subtitle}
</p>
{/* Category Filter Pills (Expands Scrolling View) */}
<div className="pt-3 flex items-center justify-center flex-wrap gap-2 text-xs font-display font-bold">
{/* Filter Bar (Sentence case, no small caps) */}
<div className="pt-4 flex items-center flex-wrap gap-2 text-xs font-body">
{CATEGORIES.map((cat) => {
const isActive = cat.id === activeCategory;
const count = cat.id === 'all'
? tiles.length
: tiles.filter((t) => t.category === cat.id).length;
return (
<button
key={cat.id}
onClick={() => setActiveCategory(cat.id)}
className={`flex items-center gap-1.5 px-4 py-2 rounded-full transition-[transform,background-color,color] duration-200 ease-[cubic-bezier(0.16,1,0.3,1)] ${
className={`px-3 py-1.5 rounded-pill transition-colors duration-100 ${
isActive
? 'bg-slate-950 text-white shadow-md shadow-slate-900/15 scale-105'
: 'bg-white/90 text-slate-700 hover:bg-slate-100 border border-slate-200 shadow-sm'
? 'bg-ink text-paper-hi font-medium'
: 'bg-paper-2 text-ink-2 hover:bg-paper-3 border border-rule'
}`}
>
<span>{cat.label}</span>
<span className={`px-1.5 py-0.5 rounded-full text-[10px] font-mono ${
isActive ? 'bg-blue-600 text-white' : 'bg-slate-100 text-slate-600'
}`}>
{count}
</span>
{cat.label}
</button>
);
})}
</div>
</div>
{/* Squarical Tile Grid (100% Squarical by default, expandable 2x1) */}
{/* Specimen Tiles Grid */}
<div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-6">
{displayedTiles.map((tile) => {
const Icon = tile.icon;
const tileClasses = 'col-span-1 aspect-square rounded-[36px] sm:rounded-[42px]';
return (
<Link
key={tile.id}
href={tile.href}
className={`group relative flex flex-col justify-between overflow-hidden bg-slate-950 border border-slate-900/[0.08] shadow-cream-sm transition-[transform] duration-500 ease-[cubic-bezier(0.16,1,0.3,1)] hover:-translate-y-1.5 transform-gpu will-change-transform cursor-pointer ${tileClasses}`}
className="studio-sheet p-3 crop-marked flex flex-col justify-between group"
>
{/* GPU-composited shadow elevation layer */}
<div
className="absolute -inset-px rounded-[36px] sm:rounded-[42px] shadow-cream-lg opacity-0 group-hover:opacity-100 transition-opacity duration-700 ease-[cubic-bezier(0.16,1,0.3,1)] pointer-events-none z-30"
aria-hidden="true"
/>
{/* Background Image (Covering the squarical tile) */}
<img
src={tile.imageUrl}
alt={tile.name}
className="absolute inset-0 w-full h-full object-cover transition-transform duration-700 ease-[cubic-bezier(0.16,1,0.3,1)] group-hover:scale-105 will-change-transform transform-gpu"
loading="lazy"
/>
{/* Vignette Overlay for Readability (GPU Opacity) */}
<div className="absolute inset-0 bg-gradient-to-t from-slate-950/90 via-slate-950/30 to-slate-950/20 opacity-100 group-hover:opacity-85 transition-opacity duration-500 ease-[cubic-bezier(0.16,1,0.3,1)] pointer-events-none" />
{/* Top Tile Bar: Badge */}
<div className="relative z-20 flex items-center justify-between p-5">
<span className="px-3 py-1 rounded-full text-[10px] font-mono font-bold tracking-wider uppercase bg-black/60 backdrop-blur-md text-cyan-400 border border-cyan-500/30 shadow-sm">
{tile.badge}
</span>
{/* Image Specimen */}
<div className="relative aspect-[4/3] rounded-card overflow-hidden bg-paper-2 border border-rule mb-3">
<img
src={tile.imageUrl}
alt={tile.name}
className="w-full h-full object-cover"
loading="eager"
/>
<div className="absolute top-2 left-2 z-10 bg-paper-hi/90 px-2 py-0.5 rounded text-xs font-body text-ink border border-rule shadow-xs">
{tile.tag}
</div>
</div>
{/* Bottom Tile Info & Link */}
<div className="relative z-20 p-6 flex flex-col gap-2">
<div className="w-10 h-10 rounded-2xl bg-white/90 backdrop-blur-md text-blue-600 flex items-center justify-center shadow-md mb-1">
<Icon className="w-5 h-5" />
{/* Details */}
<div className="space-y-1.5 px-1 flex-1 flex flex-col justify-between">
<div>
<div className="flex items-center gap-2 mb-1">
<Icon className="w-4 h-4 text-accent" aria-hidden="true" />
<h3 className="text-base font-body font-semibold text-ink group-hover:text-accent transition-colors">
{tile.name}
</h3>
</div>
<p className="text-xs text-muted leading-relaxed font-body">
{tile.description}
</p>
</div>
<h3 className="text-xl font-display font-bold text-white tracking-tight group-hover:text-cyan-300 transition-colors">
{tile.name}
</h3>
<p className="text-xs text-slate-200 line-clamp-2 leading-relaxed font-sans">
{tile.description}
</p>
<div
className="mt-2 inline-flex items-center gap-1.5 text-xs font-display font-bold text-cyan-300 group-hover:text-white transition-colors"
>
<div className="pt-2 mt-2 border-t border-rule flex items-center justify-between text-xs font-body font-medium text-accent">
<span>{tile.cta}</span>
<ArrowRight className="w-3.5 h-3.5 transition-transform group-hover:translate-x-1" />
<ArrowRight className="w-3.5 h-3.5" aria-hidden="true" />
</div>
</div>
</Link>
+169 -212
View File
@@ -8,15 +8,10 @@ import {
RefreshCw,
Download,
Smartphone,
Sparkles,
Loader2,
Image as ImageIcon,
Zap,
ChevronRight,
SlidersHorizontal,
Image as ImageIcon,
} from 'lucide-react';
import { ToolItem, AppItem, VariantSpec, resolveLocalised } from '@/types';
import { BeforeAfterSlider } from '../ui/BeforeAfterSlider';
import { CardBeforeAfterSlider } from '../ui/CardBeforeAfterSlider';
interface TryItWidgetProps {
@@ -38,7 +33,6 @@ export function TryItWidget({
className = '',
samplePresets,
ctaText,
onSwitchToCompare,
}: TryItWidgetProps) {
const [selectedFile, setSelectedFile] = useState<File | null>(null);
const [previewUrl, setPreviewUrl] = useState<string | null>(null);
@@ -56,53 +50,35 @@ export function TryItWidget({
? samplePresets
: [
{
label: 'Sample Photo',
url: (tool as any).media?.before || '/management/pages/home/media/sample_portrait_1.jpg',
},
{
label: 'Natural Studio Model',
url: '/management/pages/home/media/sample_portrait_2.jpg',
},
{
label: 'Vintage Archival Shot',
url: '/management/pages/home/media/sample_portrait_3.jpg',
label: 'Sample portrait',
url: (tool as any).media?.before || '/management/pages/home/sections/our-tools/blemish-remover/before.jpg',
resultUrl: (tool as any).media?.after || '/management/pages/home/sections/our-tools/blemish-remover/after.jpg',
},
];
const handleFileChange = (file: File) => {
const maxMB = tool.tryIt?.limits?.maxMB || 12;
const acceptedTypes = ['image/jpeg', 'image/png', 'image/webp'];
if (!acceptedTypes.includes(file.type)) {
const validTypes = ['image/jpeg', 'image/png', 'image/webp'];
if (!validTypes.includes(file.type)) {
setStatus('error');
setErrorMessage('Choose a JPG, PNG, or WebP image.');
setErrorMessage('Please upload a valid JPG, PNG, or WebP photo.');
return;
}
if (file.size > maxMB * 1024 * 1024) {
const maxBytes = (tool.tryIt?.limits?.maxMB || 12) * 1024 * 1024;
if (file.size > maxBytes) {
setStatus('error');
setErrorMessage(`File exceeds ${maxMB}MB limit.`);
setErrorMessage(`Image exceeds max size of ${tool.tryIt?.limits?.maxMB || 12}MB.`);
return;
}
const objectUrl = URL.createObjectURL(file);
setSelectedFile(file);
const objectUrl = URL.createObjectURL(file);
setPreviewUrl(objectUrl);
setResultUrl(null);
setStatus('selected');
setErrorMessage('');
};
const loadSamplePreset = async (url: string) => {
try {
setStatus('processing');
const res = await fetch(url);
const blob = await res.blob();
const file = new File([blob], 'sample.jpg', { type: 'image/jpeg' });
handleFileChange(file);
} catch {
setStatus('idle');
}
};
const handleDrop = (e: React.DragEvent) => {
e.preventDefault();
setIsDragOver(false);
@@ -111,98 +87,113 @@ export function TryItWidget({
}
};
const loadSamplePreset = async (presetUrl: string, sampleResult?: string) => {
try {
setStatus('selected');
setPreviewUrl(presetUrl);
if (sampleResult) {
setResultUrl(sampleResult);
}
const res = await fetch(presetUrl);
const blob = await res.blob();
const file = new File([blob], 'sample_photo.jpg', { type: 'image/jpeg' });
setSelectedFile(file);
setErrorMessage('');
} catch {
setStatus('error');
setErrorMessage('Failed to load sample image.');
}
};
const runTryIt = async () => {
if (!selectedFile) return;
if (!selectedFile && !previewUrl) return;
setStatus('processing');
setErrorMessage('');
const formData = new FormData();
formData.append('image', selectedFile);
if (activeVariant) {
formData.append('variant', activeVariant);
}
try {
const formData = new FormData();
if (selectedFile) {
formData.append('image', selectedFile);
} else if (previewUrl) {
const res = await fetch(previewUrl);
const blob = await res.blob();
formData.append('image', blob, 'preset.jpg');
}
if (activeVariant) {
formData.append('variant', activeVariant);
}
const response = await fetch(`/api/try/${tool.id}`, {
method: 'POST',
body: formData,
});
const remainingHeader = response.headers.get('X-Remaining-Tries');
if (remainingHeader) {
setRemainingTries(parseInt(remainingHeader, 10));
}
if (response.status === 429) {
const data = await response.json();
setStatus('limit');
setErrorMessage(data.messageKey === 'dailyBudgetExceeded'
? "Today's free try budget has been reached. Open in mobile app for unlimited instant access."
: "You have reached your daily free try limit on web. Open the app for 50 bonus credits!");
setRemainingTries(0);
return;
}
if (response.status === 503) {
setStatus('unavailable');
setErrorMessage('This AI tool is temporarily undergoing server maintenance. Please try in the mobile app.');
return;
}
if (!response.ok) {
const errorJson = await response.json().catch(() => null);
const errData = await response.json().catch(() => ({}));
setStatus('error');
setErrorMessage(errorJson?.error?.message || 'Processing failed. Please try again.');
setErrorMessage(errData?.error?.message || 'Inference call failed. Please try another image.');
return;
}
const blob = await response.blob();
const resBlobUrl = URL.createObjectURL(blob);
setResultUrl(resBlobUrl);
const url = URL.createObjectURL(blob);
setResultUrl(url);
setStatus('success');
} catch (err: any) {
setRemainingTries((prev) => Math.max(0, prev - 1));
} catch {
setStatus('error');
setErrorMessage(err.message || 'Network connection failed. Please retry.');
setErrorMessage('Network error connecting to inference API.');
}
};
const reset = () => {
setSelectedFile(null);
if (previewUrl) URL.revokeObjectURL(previewUrl);
if (resultUrl) URL.revokeObjectURL(resultUrl);
setPreviewUrl(null);
setResultUrl(null);
setStatus('idle');
setErrorMessage('');
if (fileInputRef.current) fileInputRef.current.value = '';
};
return (
<div className={`relative bg-white rounded-3xl p-5 sm:p-8 lg:p-10 border border-slate-900/[0.08] shadow-cream-md overflow-hidden ${className}`}>
{/* Top Header & Tries Counter */}
<div className="flex items-center justify-between gap-4 pb-4 sm:pb-5 border-b border-slate-100">
<div className="flex items-center gap-2.5">
<div className="w-8 h-8 rounded-xl bg-blue-50 border border-blue-200/80 flex items-center justify-center text-blue-600">
<UploadCloud className="w-4 h-4" />
</div>
<span className="text-xs sm:text-sm font-display font-semibold text-slate-800">
Try Online Free
</span>
<span className="hidden sm:inline-flex items-center gap-1 px-2.5 py-0.5 rounded-full text-[10px] font-mono font-semibold text-blue-700 bg-blue-50 border border-blue-200/80">
Lossless AI
</span>
<div className={`w-full ${className}`}>
{/* Top Header Row */}
<div className="flex items-center justify-between pb-3 border-b border-rule text-xs font-body">
<div className="flex items-center gap-2">
<span className="font-medium text-ink">{resolveLocalised(tool.name, locale)}</span>
<span className="text-muted">· Web trial</span>
</div>
<div className="inline-flex items-center gap-2 bg-emerald-50 border border-emerald-200/90 px-3.5 py-1 rounded-full text-xs font-mono text-emerald-800 font-semibold shadow-2xs">
<span className="w-2 h-2 rounded-full bg-emerald-500 animate-pulse"></span>
<span>{remainingTries} free tries today</span>
<div className="text-muted">
<span>{remainingTries} free tries remaining today</span>
</div>
</div>
{/* Main Body per Status */}
<div className="mt-7">
{/* Error Message */}
{errorMessage && (
<div className="mt-4 p-3 bg-paper-2 border border-rule rounded-card flex items-center gap-2 text-xs text-ink font-body">
<AlertCircle className="w-4 h-4 text-accent shrink-0" aria-hidden="true" />
<span>{errorMessage}</span>
</div>
)}
{/* Main Body */}
<div className="mt-5">
{status === 'idle' && (
<div className="space-y-6">
{/* Drag & Drop Upload Zone - Prominent & Spacious */}
<div className="space-y-4">
{/* Drag & Drop Upload Zone */}
<div
onDrop={handleDrop}
onDragOver={(e) => {
@@ -220,10 +211,10 @@ export function TryItWidget({
role="button"
tabIndex={0}
aria-label="Upload photo to edit"
className={`border-2 border-dashed rounded-3xl p-8 sm:p-12 lg:p-16 text-center cursor-pointer transition-all duration-300 min-h-[380px] sm:min-h-[440px] lg:min-h-[460px] flex flex-col items-center justify-center group ${
className={`border border-dashed rounded-card p-8 sm:p-12 text-center cursor-pointer transition-colors duration-150 min-h-[300px] flex flex-col items-center justify-center ${
isDragOver
? 'border-blue-500 bg-blue-50/70 scale-[1.01] shadow-lg shadow-blue-500/10'
: 'border-slate-300/90 hover:border-blue-500 bg-gradient-to-b from-blue-50/30 via-white to-slate-50/40 hover:bg-blue-50/20'
? 'border-accent bg-paper-2'
: 'border-rule hover:border-ink bg-paper-2/60'
}`}
>
<input
@@ -233,91 +224,89 @@ export function TryItWidget({
className="hidden"
onChange={(e) => e.target.files?.[0] && handleFileChange(e.target.files[0])}
/>
<div className="w-20 h-20 sm:w-24 sm:h-24 mx-auto mb-6 rounded-3xl bg-blue-50 border border-blue-200/80 flex items-center justify-center text-blue-600 group-hover:scale-110 group-hover:bg-blue-600 group-hover:text-white transition-all duration-300 shadow-sm">
<UploadCloud className="w-10 h-10 sm:w-12 sm:h-12" />
<div className="mb-3 text-accent">
<UploadCloud className="w-8 h-8" aria-hidden="true" />
</div>
<div className="inline-flex items-center gap-2.5 px-9 py-4 rounded-full bg-gradient-to-r from-blue-600 via-indigo-600 to-blue-700 hover:from-blue-700 hover:to-indigo-800 text-white font-bold text-sm sm:text-base shadow-lg shadow-blue-500/25 group-hover:shadow-xl group-hover:scale-105 active:scale-95 transition-all mb-4">
<UploadCloud className="w-5 h-5" />
<span>Upload Image</span>
<div className="mb-2">
<span className="btn-primary text-xs">
Choose photo to upload
</span>
</div>
<p className="text-base sm:text-lg font-display font-semibold text-slate-800">
or drag and drop your photo anywhere here
<p className="text-sm font-body text-ink-2 mt-2">
or drag and drop your photo into this workspace
</p>
<p className="mt-2 text-xs font-mono text-slate-500">
Supports JPG, PNG, WEBP up to {tool.tryIt?.limits?.maxMB || 12}MB • Lossless 4K processing
<p className="mt-1 text-xs text-muted font-body">
Supports JPG, PNG, WebP up to {tool.tryIt?.limits?.maxMB || 12}MB
</p>
</div>
{/* Quick Sample Presets */}
<div className="pt-1">
<p className="text-xs font-mono uppercase tracking-wider text-slate-500 font-semibold mb-3">
Or test instantly with a sample photo:
</p>
<div className="flex flex-wrap gap-2.5">
{activePresets.map((preset, idx) => (
<button
key={idx}
onClick={() => loadSamplePreset(preset.url)}
className="inline-flex items-center gap-2 px-4 py-2.5 rounded-xl text-xs font-semibold bg-white border border-slate-200 text-slate-700 hover:bg-blue-50 hover:border-blue-300 hover:text-blue-700 transition-all active:scale-95 shadow-2xs"
>
<ImageIcon className="w-3.5 h-3.5 text-slate-400" />
<span>{preset.label}</span>
</button>
))}
</div>
{/* Quick Sample Preset */}
<div className="pt-1 flex items-center gap-2 text-xs font-body text-muted">
<span>Or test preset:</span>
{activePresets.map((preset, idx) => (
<button
key={idx}
type="button"
onClick={() => loadSamplePreset(preset.url, preset.resultUrl)}
className="inline-flex items-center gap-1.5 px-2.5 py-1 rounded bg-paper-2 hover:bg-paper-3 border border-rule text-ink transition-colors"
>
<ImageIcon className="w-3.5 h-3.5 text-muted" aria-hidden="true" />
<span>{preset.label}</span>
</button>
))}
</div>
</div>
)}
{status === 'selected' && previewUrl && (
<div className="space-y-6">
<div className="grid grid-cols-1 md:grid-cols-2 gap-6 items-center">
{/* Image Preview Card */}
<div className="relative aspect-[4/3] rounded-3xl overflow-hidden border border-slate-200 bg-slate-100 shadow-sm">
{/* eslint-disable-next-line @next/next/no-img-element */}
<div className="space-y-5">
<div className="grid grid-cols-1 md:grid-cols-2 gap-5 items-start">
{/* Preview */}
<div className="relative aspect-[4/3] rounded-card overflow-hidden border border-rule bg-paper-2">
<img src={previewUrl} alt="Selected photo" className="w-full h-full object-cover" />
<button
type="button"
onClick={reset}
className="absolute top-3 right-3 bg-slate-900/80 hover:bg-slate-900 text-white text-xs font-mono px-3 py-1.5 rounded-xl backdrop-blur-md transition-colors"
className="absolute top-2.5 right-2.5 bg-paper-hi text-ink text-xs px-2.5 py-1 rounded border border-rule hover:border-ink transition-colors font-body shadow-sm"
>
Change Photo
Change photo
</button>
</div>
{/* Mode Selection & Run Action */}
<div className="space-y-5">
<div className="space-y-4">
{variants.length > 0 && (
<div>
<label className="block text-xs font-mono uppercase tracking-wider text-slate-600 font-semibold mb-2.5">
{resolveLocalised(tool.tryIt?.variantControl?.label, locale, 'Select Retouch Mode')}
<label className="block text-xs font-body text-muted mb-2">
{resolveLocalised(tool.tryIt?.variantControl?.label, locale, 'Retouch mode')}
</label>
<div className="space-y-2">
<div className="space-y-1.5">
{variants.map((v) => (
<label
key={v.id}
className={`flex items-center justify-between p-3.5 rounded-2xl border cursor-pointer transition-all duration-200 ${
className={`flex items-center justify-between p-2.5 rounded-card border cursor-pointer transition-colors duration-100 ${
activeVariant === v.id
? 'border-blue-600 bg-blue-50/70 text-blue-900 shadow-sm'
: 'border-slate-200 hover:border-slate-300 bg-white'
? 'border-accent bg-paper-hi text-ink'
: 'border-rule hover:border-ink bg-paper-2 text-ink-2'
}`}
>
<div className="flex items-center space-x-3">
<div className="flex items-center space-x-2.5">
<input
type="radio"
name="variant"
value={v.id}
checked={activeVariant === v.id}
onChange={() => setActiveVariant(v.id)}
className="text-blue-600 focus:ring-blue-500 h-4 w-4"
className="accent-[var(--color-accent)] h-3.5 w-3.5"
/>
<div>
<p className="text-xs sm:text-sm font-bold text-slate-900">
<p className="text-xs font-body font-medium text-ink">
{resolveLocalised(v.label, locale, v.description || v.id)}
</p>
{v.description && (
<p className="text-[11px] text-slate-500">{v.description}</p>
<p className="text-[11px] text-muted font-body">{v.description}</p>
)}
</div>
</div>
@@ -327,13 +316,12 @@ export function TryItWidget({
</div>
)}
{/* Run Button */}
<button
type="button"
onClick={runTryIt}
className="w-full py-4 px-6 rounded-2xl font-bold text-xs sm:text-sm text-white bg-gradient-to-r from-blue-600 to-indigo-600 hover:from-blue-700 hover:to-indigo-700 shadow-md shadow-blue-500/25 transition-all flex items-center justify-center gap-2 active:scale-98"
className="btn-primary w-full text-center"
>
<Sparkles className="w-4 h-4 text-white" />
<span>{ctaText || `Run ${resolveLocalised(tool.name, locale)}`}</span>
<span>{ctaText || `Process ${resolveLocalised(tool.name, locale)}`}</span>
</button>
</div>
</div>
@@ -341,120 +329,89 @@ export function TryItWidget({
)}
{status === 'processing' && (
<div className="py-16 sm:py-20 text-center space-y-5">
<div className="relative inline-flex p-5 rounded-3xl bg-blue-50 border border-blue-200 text-blue-600 shadow-sm">
<Loader2 className="w-10 h-10 animate-spin text-blue-600" />
<span className="absolute -top-1 -right-1 flex h-3 w-3">
<span className="animate-ping absolute inline-flex h-full w-full rounded-full bg-blue-400 opacity-75"></span>
<span className="relative inline-flex rounded-full h-3 w-3 bg-blue-500"></span>
</span>
<div className="py-14 text-center space-y-4">
<div className="inline-flex p-4 rounded-card bg-paper-2 border border-rule text-accent">
<Loader2 className="w-8 h-8 animate-spin text-accent" aria-hidden="true" />
</div>
<div>
<h4 className="text-lg font-display font-bold text-slate-900">
CRE Neural Vision Engine Processing...
<h4 className="text-base font-body font-semibold text-ink">
Processing neural layers…
</h4>
<p className="text-xs sm:text-sm text-slate-500 max-w-sm mx-auto mt-1 font-mono">
Synthesizing deep neural layers while preserving natural textures and micro-details.
<p className="text-xs text-muted max-w-sm mx-auto mt-1 font-body">
Synthesizing sub-pixel output in volatile GPU memory while preserving skin pores and edges.
</p>
</div>
</div>
)}
{status === 'success' && previewUrl && resultUrl && (
<div className="space-y-6">
<BeforeAfterSlider
beforeUrl={previewUrl}
afterUrl={resultUrl}
beforeLabel="Original"
afterLabel="CRE AI Result"
caption="Drag slider horizontally to inspect precision AI results and natural textures."
/>
<div className="space-y-5">
<div className="aspect-[4/3] rounded-card overflow-hidden bg-paper-2 border border-rule">
<CardBeforeAfterSlider
beforeUrl={previewUrl}
afterUrl={resultUrl}
beforeLabel="Original"
afterLabel="Enhanced"
/>
</div>
{/* Actions: Download & Reset */}
<div className="flex flex-wrap items-center justify-between gap-3 pt-2">
<button
type="button"
onClick={reset}
className="inline-flex items-center gap-2 px-4 py-2.5 rounded-xl text-xs sm:text-sm font-semibold border border-slate-300 bg-slate-50 hover:bg-slate-100 text-slate-700 transition-colors"
className="btn-secondary"
>
<RefreshCw className="w-4 h-4 text-slate-500" />
<span>Process Another Photo</span>
<RefreshCw className="w-3.5 h-3.5" aria-hidden="true" />
<span>Process another photo</span>
</button>
<a
href={resultUrl}
download={`${tool.slug}-result.png`}
className="inline-flex items-center gap-2 px-6 py-2.5 rounded-xl text-xs sm:text-sm font-bold text-white bg-emerald-600 hover:bg-emerald-700 shadow-md shadow-emerald-500/20 transition-all hover:scale-105 active:scale-95"
className="btn-primary"
>
<Download className="w-4 h-4" />
<span>Download Result (HD)</span>
<Download className="w-3.5 h-3.5" aria-hidden="true" />
<span>Download output</span>
</a>
</div>
{/* Result App Handoff Card */}
{/* Mobile App Handoff */}
{homeApp && (
<div className="mt-6 p-6 rounded-3xl bg-slate-50 border border-slate-200 flex flex-col sm:flex-row items-start sm:items-center justify-between gap-5">
<div className="space-y-1">
<div className="flex items-center gap-2">
<Smartphone className="w-4 h-4 text-indigo-600" />
<span className="text-[11px] font-mono uppercase tracking-widest text-indigo-700 font-bold">
Need 4K Lossless & Batch Processing?
</span>
</div>
<h5 className="font-display font-bold text-slate-900 text-base">
Open in {resolveLocalised(homeApp.name, locale)}
</h5>
<p className="text-xs text-slate-600">
Get 50 free HD export credits on first launch with promo code{' '}
<span className="font-mono font-bold text-blue-600 bg-blue-50 px-1 py-0.5 rounded border border-blue-200">{homeApp.welcomeBonus?.code || 'TRYWEB50'}</span>.
<div className="mt-4 p-4 rounded-card bg-paper-2 border border-rule flex flex-col sm:flex-row items-start sm:items-center justify-between gap-3">
<div className="space-y-0.5">
<span className="text-xs font-body font-semibold text-ink">
Need batch processing or 4K lossless export?
</span>
<p className="text-xs text-muted font-body">
Download {resolveLocalised(homeApp.name, locale)} on your phone for unlimited processing.
</p>
</div>
<Link
href={`/go/${tool.slug}/${homeApp.slug}`}
className="w-full sm:w-auto shrink-0 px-6 py-3 rounded-full text-xs font-bold text-white bg-blue-600 hover:bg-blue-700 shadow-sm transition-all text-center flex items-center justify-center gap-2 hover:scale-105"
href={`/apps/${homeApp.slug}`}
className="btn-secondary shrink-0 text-xs"
>
<span>Open in Mobile App</span>
<ChevronRight className="w-4 h-4" />
<Smartphone className="w-3.5 h-3.5 text-accent" aria-hidden="true" />
<span>Get mobile app</span>
</Link>
</div>
)}
</div>
)}
{(status === 'limit' || status === 'error' || status === 'unavailable') && (
<div className="p-7 sm:p-9 rounded-3xl bg-amber-50 border border-amber-200 text-center space-y-4">
<div className="w-12 h-12 mx-auto rounded-2xl bg-amber-100 border border-amber-300 flex items-center justify-center text-amber-700">
<AlertCircle className="w-6 h-6" />
</div>
<div>
<h4 className="text-base font-display font-bold text-slate-900">
{status === 'limit'
? 'Daily Free Web Limit Reached'
: status === 'unavailable'
? 'Service Temporarily Offline'
: 'Processing Issue'}
</h4>
<p className="text-xs sm:text-sm text-slate-600 max-w-md mx-auto mt-1 font-mono">
{errorMessage}
</p>
</div>
<div className="flex flex-wrap items-center justify-center gap-3 pt-2">
<button
onClick={reset}
className="px-4 py-2 rounded-xl text-xs font-semibold border border-slate-300 bg-white hover:bg-slate-100 text-slate-700"
>
Try Again
</button>
{homeApp && (
<Link
href={`/go/${tool.slug}/${homeApp.slug}`}
className="px-5 py-2 rounded-xl text-xs font-bold text-white bg-blue-600 hover:bg-blue-700 shadow-sm"
>
Open in {resolveLocalised(homeApp.name, locale)}
</Link>
)}
</div>
{status === 'limit' && (
<div className="p-8 text-center space-y-4 bg-paper-2 border border-rule rounded-card">
<h4 className="text-base font-body font-semibold text-ink">
Daily browser limit reached
</h4>
<p className="text-xs text-muted max-w-sm mx-auto font-body">
You have completed all free browser sessions for today. Download our mobile app for unlimited inferences.
</p>
{homeApp && (
<Link href={`/apps/${homeApp.slug}`} className="btn-primary inline-flex">
<span>Open {resolveLocalised(homeApp.name, locale)}</span>
</Link>
)}
</div>
)}
</div>
+47 -149
View File
@@ -17,168 +17,66 @@ export function BrandLogo({
isDark = false,
}: BrandLogoProps) {
const iconDimensions = {
sm: { w: 34, h: 34, textScale: 'text-base', subText: 'text-[7px]' },
md: { w: 42, h: 42, textScale: 'text-xl', subText: 'text-[9px]' },
lg: { w: 54, h: 54, textScale: 'text-2xl', subText: 'text-[11px]' },
sm: { w: 30, h: 30, title: 'text-sm', sub: 'text-[11px]' },
md: { w: 36, h: 36, title: 'text-base', sub: 'text-xs' },
lg: { w: 44, h: 44, title: 'text-xl', sub: 'text-sm' },
}[size];
const content = (
<div className={`group flex items-center gap-3 select-none ${className}`}>
{/* Animated Bright Quantum Prism Emblem */}
<div className={`flex items-center gap-3 select-none ${className}`}>
{/* Precision Lens / Optical Aperture Emblem */}
<div
className="relative flex items-center justify-center shrink-0 transition-transform duration-300 group-hover:scale-105"
className="relative flex items-center justify-center shrink-0"
style={{ width: iconDimensions.w, height: iconDimensions.h }}
>
{/* Clean Static Multi-Color Ambient Glow (Zero Continuous Animations or Heavy Blurs) */}
<div className="absolute -inset-1 rounded-2xl bg-gradient-to-tr from-cyan-400 via-blue-500 to-fuchsia-500 opacity-25 group-hover:opacity-75 transition-opacity duration-300 pointer-events-none" />
{/* Glossy Bezel Container */}
<div className="relative w-full h-full rounded-2xl overflow-hidden bg-slate-950 p-[1.5px] shadow-[0_4px_20px_-4px_rgba(56,189,248,0.5)] border border-white/30 group-hover:border-cyan-400/80 transition-all duration-300">
<svg
viewBox="0 0 100 100"
fill="none"
className="w-full h-full"
xmlns="http://www.w3.org/2000/svg"
>
<defs>
{/* Vibrant Prismatic Gradients */}
<linearGradient id="cre-bright-cyan" x1="0%" y1="0%" x2="100%" y2="100%">
<stop offset="0%" stopColor="#00F5FF" />
<stop offset="100%" stopColor="#2563EB" />
</linearGradient>
<linearGradient id="cre-bright-purple" x1="0%" y1="0%" x2="100%" y2="100%">
<stop offset="0%" stopColor="#A855F7" />
<stop offset="100%" stopColor="#EC4899" />
</linearGradient>
<linearGradient id="cre-bright-gold" x1="0%" y1="0%" x2="100%" y2="100%">
<stop offset="0%" stopColor="#F59E0B" />
<stop offset="100%" stopColor="#FACC15" />
</linearGradient>
<linearGradient id="cre-bright-teal" x1="0%" y1="0%" x2="100%" y2="100%">
<stop offset="0%" stopColor="#10B981" />
<stop offset="100%" stopColor="#06B6D4" />
</linearGradient>
{/* Core Star Bloom Flare */}
<radialGradient id="cre-star-bloom" cx="50%" cy="50%" r="50%">
<stop offset="0%" stopColor="#FFFFFF" />
<stop offset="35%" stopColor="#38BDF8" stopOpacity="0.95" />
<stop offset="70%" stopColor="#818CF8" stopOpacity="0.4" />
<stop offset="100%" stopColor="#0284C7" stopOpacity="0" />
</radialGradient>
{/* Diagonal Light Shimmer Sweep */}
<linearGradient id="cre-shimmer-sweep" x1="0%" y1="0%" x2="100%" y2="100%">
<stop offset="0%" stopColor="#FFFFFF" stopOpacity="0" />
<stop offset="50%" stopColor="#FFFFFF" stopOpacity="0.75" />
<stop offset="100%" stopColor="#FFFFFF" stopOpacity="0" />
</linearGradient>
{/* Deep Space Radial Base */}
<radialGradient id="cre-bg-cosmic" cx="50%" cy="50%" r="50%">
<stop offset="0%" stopColor="#1E293B" />
<stop offset="60%" stopColor="#0F172A" />
<stop offset="100%" stopColor="#020617" />
</radialGradient>
</defs>
{/* Cosmic Background Disc */}
<circle cx="50" cy="50" r="48" fill="url(#cre-bg-cosmic)" />
{/* Outer Orbiting Energy Ring (Clockwise) */}
<g className="cre-anim-orbit">
<circle
cx="50"
cy="50"
r="41"
stroke="rgba(56, 189, 248, 0.45)"
strokeWidth="1.5"
strokeDasharray="4 6"
/>
{/* Orbiting Photon Nodes */}
<circle cx="50" cy="9" r="3" fill="#00F5FF" />
<circle cx="91" cy="50" r="2.5" fill="#EC4899" />
<circle cx="15" cy="70" r="2.5" fill="#FACC15" />
</g>
{/* Inner Counter-Orbiting Quantum Track */}
<g className="cre-anim-orbit-reverse">
<circle
cx="50"
cy="50"
r="33"
stroke="rgba(168, 85, 247, 0.35)"
strokeWidth="1"
strokeDasharray="2 4"
/>
<circle cx="73" cy="27" r="2" fill="#38BDF8" />
<circle cx="27" cy="73" r="2" fill="#A855F7" />
</g>
{/* Faceted Quantum Crystal Prism (8-Point Isometric Star) */}
<g className="cre-anim-core">
{/* North Facet: Electric Cyan */}
<polygon points="50,16 62,38 50,50 38,38" fill="url(#cre-bright-cyan)" opacity="0.95" />
{/* East Facet: Electric Purple / Magenta */}
<polygon points="84,50 62,62 50,50 62,38" fill="url(#cre-bright-purple)" opacity="0.95" />
{/* South Facet: Solar Amber / Gold */}
<polygon points="50,84 38,62 50,50 62,62" fill="url(#cre-bright-gold)" opacity="0.95" />
{/* West Facet: Vibrant Emerald / Teal */}
<polygon points="16,50 38,38 50,50 38,62" fill="url(#cre-bright-teal)" opacity="0.95" />
{/* Diagonal Crystalline Diamond Corner Facets */}
<polygon points="50,50 62,38 72,28 62,28" fill="#38BDF8" opacity="0.8" />
<polygon points="50,50 62,62 72,72 72,62" fill="#EC4899" opacity="0.8" />
<polygon points="50,50 38,62 28,72 38,72" fill="#FACC15" opacity="0.8" />
<polygon points="50,50 38,38 28,28 28,38" fill="#10B981" opacity="0.8" />
{/* Geometric Fine Crystal Ridge Wireframe */}
<line x1="50" y1="16" x2="50" y2="84" stroke="#FFFFFF" strokeWidth="1.2" opacity="0.85" />
<line x1="16" y1="50" x2="84" y2="50" stroke="#FFFFFF" strokeWidth="1.2" opacity="0.85" />
<line x1="26" y1="26" x2="74" y2="74" stroke="#FFFFFF" strokeWidth="0.8" opacity="0.6" />
<line x1="74" y1="26" x2="26" y2="74" stroke="#FFFFFF" strokeWidth="0.8" opacity="0.6" />
{/* Radiant Supernova Core Bloom */}
<circle cx="50" cy="50" r="14" fill="url(#cre-star-bloom)" />
<circle cx="50" cy="50" r="5" fill="#FFFFFF" />
{/* Central 4-Point Micro Diamond Glint */}
<polygon points="50,42 52,50 50,58 48,50" fill="#FFFFFF" />
<polygon points="42,50 50,52 58,50 50,48" fill="#FFFFFF" />
</g>
{/* Sweeping Specular Caustic Glint */}
<rect
x="20"
y="-40"
width="60"
height="20"
fill="url(#cre-shimmer-sweep)"
className="cre-anim-shimmer pointer-events-none"
/>
</svg>
</div>
<svg
viewBox="0 0 40 40"
fill="none"
className="w-full h-full"
xmlns="http://www.w3.org/2000/svg"
aria-hidden="true"
>
{/* Outer Lens Ring */}
<circle
cx="20"
cy="20"
r="18"
stroke="var(--color-ink)"
strokeWidth="1.5"
/>
{/* Inner Ground Circle */}
<circle
cx="20"
cy="20"
r="12"
stroke="var(--color-rule)"
strokeWidth="1"
strokeDasharray="2 3"
/>
{/* Optical Blades / Crosshair */}
<line x1="20" y1="2" x2="20" y2="8" stroke="var(--color-ink)" strokeWidth="1.5" />
<line x1="20" y1="32" x2="20" y2="38" stroke="var(--color-ink)" strokeWidth="1.5" />
<line x1="2" y1="20" x2="8" y2="20" stroke="var(--color-ink)" strokeWidth="1.5" />
<line x1="32" y1="20" x2="38" y2="20" stroke="var(--color-ink)" strokeWidth="1.5" />
{/* Focal Point (Cadmium Orange Studio Accent) */}
<circle cx="20" cy="20" r="4.5" fill="var(--color-accent)" />
<circle cx="20" cy="20" r="1.5" fill="var(--color-paper-hi)" />
</svg>
</div>
{/* Typographic Wordmark */}
{showWordmark && (
<div className="flex flex-col">
<div className="flex items-center tracking-tight leading-none">
<span className={`font-display font-black text-blue-600 tracking-[0.08em] ${iconDimensions.textScale}`}>
<div className="flex flex-col text-left">
<div className="flex items-baseline gap-1.5 leading-none">
<span className={`font-display font-bold text-ink ${iconDimensions.title}`}>
CRE
</span>
<span className={`font-display font-black ${isDark ? 'text-white' : 'text-slate-950'} tracking-[0.14em] ml-1.5 transition-colors duration-200 ${iconDimensions.textScale}`}>
INNOVATIONS
<span className={`font-display font-normal text-ink-2 ${iconDimensions.title}`}>
Innovations
</span>
</div>
<span className={`font-mono ${isDark ? 'text-blue-400' : 'text-blue-700'} tracking-[0.22em] uppercase font-bold mt-0.5 transition-colors duration-200 ${iconDimensions.subText}`}>
Neural Vision Studio
<span className={`font-body text-muted ${iconDimensions.sub} mt-0.5 leading-none`}>
Photographic tools
</span>
</div>
)}
@@ -187,7 +85,7 @@ export function BrandLogo({
if (asLink) {
return (
<Link href="/" className="inline-block outline-none focus-visible:ring-2 focus-visible:ring-blue-500 rounded-lg">
<Link href="/" className="inline-block outline-none focus-visible:ring-2 focus-visible:ring-accent rounded">
{content}
</Link>
);
+78 -119
View File
@@ -5,6 +5,8 @@ import React, { useRef, useState, useEffect, useCallback } from 'react';
interface CardBeforeAfterSliderProps {
beforeUrl: string;
afterUrl: string;
title?: string;
slug?: string;
beforeLabel?: string;
afterLabel?: string;
aspectRatio?: string;
@@ -13,8 +15,10 @@ interface CardBeforeAfterSliderProps {
export function CardBeforeAfterSlider({
beforeUrl,
afterUrl,
beforeLabel = 'BEFORE',
afterLabel = 'AFTER',
title = 'Image comparison',
slug,
beforeLabel = 'Original',
afterLabel = 'Enhanced',
aspectRatio = 'aspect-[16/10]',
}: CardBeforeAfterSliderProps) {
const containerRef = useRef<HTMLDivElement>(null);
@@ -42,7 +46,7 @@ export function CardBeforeAfterSlider({
if (isHoveredRef.current && !isDraggingRef.current && !isInteractedRef.current) {
if (startTime === null) startTime = time;
const elapsed = time - startTime;
const currentSplit = 50 + 22 * Math.sin((elapsed / 3200) * 2 * Math.PI);
const currentSplit = 50 + 20 * Math.sin((elapsed / 3200) * 2 * Math.PI);
setSplit(currentSplit);
animIdRef.current = requestAnimationFrame(animate);
}
@@ -60,146 +64,106 @@ export function CardBeforeAfterSlider({
};
}, [isHoveredState, setSplit]);
const handleMouseEnter = useCallback(() => {
isHoveredRef.current = true;
setIsHoveredState(true);
}, []);
const updatePosition = useCallback(
(clientX: number) => {
let rect = cachedRectRef.current;
if (!rect && containerRef.current) {
rect = containerRef.current.getBoundingClientRect();
cachedRectRef.current = rect;
}
if (!rect || rect.width <= 0) return;
const handleMouseLeave = useCallback(() => {
isHoveredRef.current = false;
setIsHoveredState(false);
if (!isDraggingRef.current && !isInteractedRef.current) {
setSplit(50);
const x = clientX - rect.left;
const pct = (x / rect.width) * 100;
setSplit(pct);
},
[setSplit]
);
const handlePointerDown = (e: React.PointerEvent) => {
isDraggingRef.current = true;
isInteractedRef.current = true;
if (containerRef.current) {
cachedRectRef.current = containerRef.current.getBoundingClientRect();
}
}, [setSplit]);
(e.target as HTMLElement).setPointerCapture(e.pointerId);
updatePosition(e.clientX);
};
// Unified Pointer Handlers on Center Pill Handle with Left/Right Arrows
const handlePointerDown = useCallback(
(e: React.PointerEvent<HTMLDivElement>) => {
if (e.button !== 0 && e.pointerType === 'mouse') return;
e.stopPropagation();
isDraggingRef.current = true;
isInteractedRef.current = true;
cancelAnimationFrame(animIdRef.current);
try {
e.currentTarget.setPointerCapture(e.pointerId);
} catch {
// Fallback
}
if (containerRef.current) {
const rect = containerRef.current.getBoundingClientRect();
cachedRectRef.current = { left: rect.left, width: rect.width };
const x = Math.max(0, Math.min(e.clientX - rect.left, rect.width));
const percent = (x / rect.width) * 100;
setSplit(percent);
}
},
[setSplit]
);
const handlePointerMove = useCallback(
(e: React.PointerEvent<HTMLDivElement>) => {
if (!isDraggingRef.current) return;
e.stopPropagation();
const clientX = e.clientX;
if (rafIdRef.current) {
cancelAnimationFrame(rafIdRef.current);
}
rafIdRef.current = requestAnimationFrame(() => {
let rect = cachedRectRef.current;
if (!rect && containerRef.current) {
const r = containerRef.current.getBoundingClientRect();
rect = { left: r.left, width: r.width };
cachedRectRef.current = rect;
}
if (!rect || rect.width <= 0) return;
const x = Math.max(0, Math.min(clientX - rect.left, rect.width));
const percent = (x / rect.width) * 100;
setSplit(percent);
});
},
[setSplit]
);
const handlePointerUp = useCallback((e: React.PointerEvent<HTMLDivElement>) => {
const handlePointerMove = (e: React.PointerEvent) => {
if (!isDraggingRef.current) return;
e.stopPropagation();
if (rafIdRef.current !== null) cancelAnimationFrame(rafIdRef.current);
rafIdRef.current = requestAnimationFrame(() => {
updatePosition(e.clientX);
});
};
const handlePointerUp = (e: React.PointerEvent) => {
isDraggingRef.current = false;
cachedRectRef.current = null;
if (rafIdRef.current) {
cancelAnimationFrame(rafIdRef.current);
rafIdRef.current = null;
}
try {
e.currentTarget.releasePointerCapture(e.pointerId);
(e.target as HTMLElement).releasePointerCapture(e.pointerId);
} catch {
// Fallback
// Ignore if pointer capture already released
}
}, []);
};
const handleContainerPointerDown = useCallback(
(e: React.PointerEvent<HTMLDivElement>) => {
// On desktop with mouse, clicking anywhere on the card moves the split
if (e.pointerType !== 'mouse' || e.button !== 0) return;
handlePointerDown(e);
},
[handlePointerDown]
);
const handleMouseEnter = () => {
isHoveredRef.current = true;
setIsHoveredState(true);
if (containerRef.current) {
cachedRectRef.current = containerRef.current.getBoundingClientRect();
}
};
const handleMouseLeave = () => {
isHoveredRef.current = false;
setIsHoveredState(false);
cachedRectRef.current = null;
if (!isInteractedRef.current) {
setSplit(50);
}
};
return (
<div
ref={containerRef}
onMouseEnter={handleMouseEnter}
onMouseLeave={handleMouseLeave}
onPointerDown={handleContainerPointerDown}
style={{
'--split': '50%',
touchAction: 'pan-y', // Allows mobile vertical scrolling across the card and line
} as React.CSSProperties}
className={`relative w-full ${aspectRatio} overflow-hidden select-none bg-slate-900 group/slider transition-shadow duration-300 hover:shadow-cream-lg`}
className={`relative w-full ${aspectRatio} select-none overflow-hidden rounded-card bg-paper-2 cursor-ew-resize group/slider`}
style={{ touchAction: 'pan-y', ['--split' as any]: '50%' }}
role="region"
aria-label={`${title} comparison slider`}
>
{/* Layer 1: After Image (Transformed Neural Result) */}
{/* eslint-disable-next-line @next/next/no-img-element */}
{/* Layer 1: After / Enhanced Image (Background) */}
<img
src={afterUrl}
alt="AI enhanced result"
alt={`${title} - enhanced result`}
loading="eager"
decoding="async"
className="absolute inset-0 h-full w-full object-cover pointer-events-none"
decoding="sync"
className="absolute inset-0 h-full w-full object-cover"
/>
{/* Layer 2: Before Image (Clipped Left by CSS variable --split) */}
{/* Layer 2: Before / Original Image (Clipped) */}
<div
className="absolute inset-0 overflow-hidden pointer-events-none"
className="absolute inset-0 overflow-hidden"
style={{ clipPath: 'polygon(0 0, var(--split) 0, var(--split) 100%, 0 100%)' }}
>
{/* eslint-disable-next-line @next/next/no-img-element */}
<img
src={beforeUrl}
alt="Original input"
loading="eager"
alt={`${title} - original`}
loading="lazy"
decoding="async"
className="absolute inset-0 h-full w-full object-cover"
/>
</div>
{/* Layer 3: Vertical Split Divider Line (pointer-events-none so it doesn't block scrolling) */}
{/* Layer 3: Vertical Split Divider Line */}
<div
className="absolute top-0 bottom-0 w-[2.5px] bg-white z-20 pointer-events-none shadow-[0_0_10px_rgba(0,0,0,0.8)] -translate-x-1/2"
className="absolute top-0 bottom-0 w-px bg-paper-hi z-20 pointer-events-none -translate-x-1/2"
style={{ left: 'var(--split)' }}
>
{/* Glowing Aura */}
<div className="absolute -top-4 -bottom-4 -left-1.5 w-3.5 bg-gradient-to-r from-blue-500/30 via-white/70 to-amber-400/30 blur-[2px]" />
{/* Center Pill Handle with Left/Right Arrows - Dedicated Drag Trigger with Pointer Capture */}
{/* Center Round Handle */}
<div
onPointerDown={handlePointerDown}
onPointerMove={handlePointerMove}
@@ -210,26 +174,21 @@ export function CardBeforeAfterSlider({
aria-valuenow={50}
tabIndex={0}
style={{ touchAction: 'none' }}
className="absolute top-1/2 -translate-y-1/2 -translate-x-1/2 w-9 h-9 sm:w-10 sm:h-10 rounded-full bg-white text-slate-800 shadow-xl border border-slate-900/15 flex items-center justify-center transition-transform group-hover/slider:scale-110 before:absolute before:-inset-3 before:content-[''] pointer-events-auto cursor-ew-resize touch-none"
className="absolute top-1/2 -translate-y-1/2 -translate-x-1/2 w-8 h-8 rounded-full bg-paper-hi text-ink border border-rule flex items-center justify-center pointer-events-auto cursor-ew-resize touch-none shadow-sm"
>
<svg className="w-3.5 h-3.5 text-blue-700 pointer-events-none" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2.5} d="M8 9l-3 3 3 3m8-6l3 3-3 3" />
<svg className="w-3.5 h-3.5 text-accent pointer-events-none" fill="none" stroke="currentColor" viewBox="0 0 24 24" aria-hidden="true">
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M8 9l-3 3 3 3m8-6l3 3-3 3" />
</svg>
</div>
</div>
{/* Floating Corner Badges */}
<div className="pointer-events-none absolute bottom-2.5 left-2.5 z-20 rounded-md bg-black/70 px-2 py-0.5 text-[9px] font-mono font-bold tracking-wider text-white backdrop-blur-sm border border-white/10 shadow-sm">
{/* Floating Labels (Floor Gate 9 & 67 compliant: body face, smaller, sentence case) */}
<div className="pointer-events-none absolute bottom-2 left-2 z-20 rounded bg-paper-hi/90 px-2 py-0.5 text-xs font-body text-ink border border-rule shadow-sm">
{beforeLabel}
</div>
<div className="pointer-events-none absolute bottom-2.5 right-2.5 z-20 rounded-md bg-blue-600/90 px-2 py-0.5 text-[9px] font-mono font-bold tracking-wider text-white backdrop-blur-sm shadow-sm border border-white/20">
<div className="pointer-events-none absolute bottom-2 right-2 z-20 rounded bg-paper-hi/90 px-2 py-0.5 text-xs font-body text-ink border border-rule shadow-sm">
{afterLabel}
</div>
{/* Slide Hint */}
<div className="pointer-events-none absolute top-2.5 right-2.5 z-20 rounded-full bg-white/92 px-2.5 py-0.5 text-[9px] font-semibold text-slate-700 shadow-sm backdrop-blur-xs opacity-0 group-hover/slider:opacity-100 transition-opacity">
Drag to inspect
</div>
</div>
);
}
+39 -58
View File
@@ -1,6 +1,6 @@
import React from 'react';
import Link from 'next/link';
import { ShieldCheck, ArrowUpRight, Activity, Terminal } from 'lucide-react';
import { ShieldCheck, ArrowUpRight } from 'lucide-react';
import { SiteConfig, resolveLocalised } from '@/types';
import { BrandLogo } from './BrandLogo';
@@ -11,89 +11,73 @@ interface FooterProps {
export function Footer({ config, currentLocale }: FooterProps) {
return (
<footer className="bg-[#F5F2EB] text-slate-700 border-t border-slate-900/[0.08] relative overflow-hidden">
{/* Subtle ambient light */}
<div className="absolute top-0 left-1/2 -translate-x-1/2 w-3/4 h-24 bg-gradient-to-b from-blue-500/5 to-transparent blur-2xl pointer-events-none" />
<div className="max-w-[1640px] mx-auto px-4 sm:px-6 md:px-8 lg:px-10 py-16 lg:py-24 relative z-10">
<div className="grid grid-cols-1 md:grid-cols-4 gap-12">
{/* Brand & Mission */}
<div className="md:col-span-2 space-y-5">
<BrandLogo size="lg" />
<p className="text-sm text-slate-600 max-w-md leading-relaxed">
{resolveLocalised(config.brand.tagline, currentLocale)}. Ultra-low latency deep learning vision models for instant portrait retouching, hair-strand matting, 4K face enhancement, and vintage restoration.
<footer className="bg-paper-2 text-ink-2 border-t border-rule relative">
<div className="max-w-container mx-auto px-4 sm:px-6 md:px-8 lg:px-10 py-16 lg:py-20">
<div className="grid grid-cols-1 md:grid-cols-4 gap-10">
{/* Brand & Editorial Statement */}
<div className="md:col-span-2 space-y-4">
<BrandLogo size="md" />
<p className="text-sm text-ink-2 max-w-md leading-relaxed font-body">
{resolveLocalised(config.brand.tagline, currentLocale)}. Deep learning neural vision models for sub-pore portrait retouching, hair-strand matting, and archival restoration.
</p>
<div className="flex flex-wrap items-center gap-3 pt-2">
<div className="inline-flex items-center gap-2 text-xs text-emerald-800 bg-emerald-100/70 border border-emerald-300 px-3.5 py-1.5 rounded-full font-mono">
<ShieldCheck className="w-4 h-4 text-emerald-700" />
<span>Enterprise-Grade Photo Privacy Guarantee</span>
</div>
<div className="inline-flex items-center gap-2 text-xs text-blue-800 bg-blue-100/70 border border-blue-300 px-3 py-1.5 rounded-full font-mono">
<Activity className="w-3.5 h-3.5 text-blue-700" />
<span>99.98% System Uptime</span>
<div className="pt-2">
<div className="inline-flex items-center gap-2 text-xs text-ink bg-paper-hi border border-rule px-3 py-1.5 rounded-card font-body">
<ShieldCheck className="w-3.5 h-3.5 text-accent" aria-hidden="true" />
<span>Zero-storage policy: photos processed in volatile memory only</span>
</div>
</div>
</div>
{/* Platform Suite */}
<div className="space-y-4">
<h4 className="text-xs font-mono font-bold uppercase tracking-widest text-slate-900 flex items-center gap-2">
<span className="w-1.5 h-1.5 rounded-full bg-blue-600" />
<span>Platform Suite</span>
<div className="space-y-3">
<h4 className="text-xs font-body font-semibold text-ink">
Platform tools
</h4>
<ul className="space-y-2.5 text-sm">
<ul className="space-y-2 text-sm font-body">
<li>
<Link href="/#studio-suite" className="text-slate-600 hover:text-blue-600 transition-colors flex items-center gap-1.5">
<span>The Creative Studio Suite</span>
<Link href="/tools" className="text-muted hover:text-ink transition-colors">
All neural photo tools
</Link>
</li>
<li>
<Link href="/tools" className="text-slate-600 hover:text-blue-600 transition-colors flex items-center gap-1.5">
<span>All Neural Vision Tools</span>
<Link href="/apps" className="text-muted hover:text-ink transition-colors">
Native mobile applications
</Link>
</li>
<li>
<Link href="/apps" className="text-slate-600 hover:text-blue-600 transition-colors flex items-center gap-1.5">
<span>Mobile Applications</span>
<Link href="/pricing" className="text-muted hover:text-ink transition-colors">
Pricing and credits
</Link>
</li>
<li>
<Link href="/pricing" className="text-slate-600 hover:text-blue-600 transition-colors flex items-center gap-1.5">
<span>Pricing & Licensing</span>
</Link>
</li>
<li>
<Link href="/catalog-manager" className="text-slate-600 hover:text-blue-600 transition-colors inline-flex items-center gap-1">
<Terminal className="w-3.5 h-3.5 text-blue-600" />
<span>Catalogue Inspector</span>
<ArrowUpRight className="w-3 h-3 text-blue-600" />
<Link href="/catalog-manager" className="text-muted hover:text-ink transition-colors inline-flex items-center gap-1">
<span>Catalogue inspector</span>
<ArrowUpRight className="w-3 h-3 text-accent" aria-hidden="true" />
</Link>
</li>
</ul>
</div>
{/* Trust & Architecture */}
<div className="space-y-4">
<h4 className="text-xs font-mono font-bold uppercase tracking-widest text-slate-900 flex items-center gap-2">
<span className="w-1.5 h-1.5 rounded-full bg-purple-600" />
<span>Trust & Security</span>
<div className="space-y-3">
<h4 className="text-xs font-body font-semibold text-ink">
Trust & safeguards
</h4>
<ul className="space-y-2.5 text-sm">
<ul className="space-y-2 text-sm font-body">
<li>
<Link href="/trust" className="text-slate-600 hover:text-blue-600 transition-colors">
Security Architecture & Safeguards
<Link href="/trust" className="text-muted hover:text-ink transition-colors">
Security safeguards
</Link>
</li>
<li>
<Link href="/privacy" className="text-slate-600 hover:text-blue-600 transition-colors">
Zero-Storage Privacy Policy
<Link href="/privacy" className="text-muted hover:text-ink transition-colors">
Privacy policy
</Link>
</li>
<li>
<Link href="/terms" className="text-slate-600 hover:text-blue-600 transition-colors">
Commercial Terms of Service
<Link href="/terms" className="text-muted hover:text-ink transition-colors">
Terms of service
</Link>
</li>
</ul>
@@ -101,12 +85,9 @@ export function Footer({ config, currentLocale }: FooterProps) {
</div>
{/* Bottom Bar */}
<div className="mt-16 pt-8 border-t border-slate-900/[0.08] flex flex-col sm:flex-row items-center justify-between text-xs text-slate-500 gap-4">
<p className="font-mono">{config.footer.copyright}</p>
<p className="flex items-center gap-2 font-mono text-slate-600">
<span>Powered by CRE Innovations Neural Vision Core v2.4</span>
<span className="w-1.5 h-1.5 rounded-full bg-blue-600 animate-pulse" />
</p>
<div className="mt-12 pt-6 border-t border-rule flex flex-col sm:flex-row items-center justify-between text-xs text-muted gap-3 font-body">
<p>{config.footer.copyright}</p>
<p>CRE Innovations · Precision photographic studio</p>
</div>
</div>
</footer>
+50 -117
View File
@@ -14,34 +14,8 @@ interface NavbarProps {
export function Navbar({ config, currentLocale }: NavbarProps) {
const [mobileMenuOpen, setMobileMenuOpen] = useState(false);
const [isScrolledPastHero, setIsScrolledPastHero] = useState(false);
const pathname = usePathname();
// Scroll detection:
// - On homepage: transparent text buttons while hero image is visible.
// - Once hero image area is completely scrolled up (or on other pages): transforms into the navbar!
useEffect(() => {
if (pathname !== '/') {
setIsScrolledPastHero(true);
return;
}
const checkScroll = () => {
const hero = document.getElementById('hero-section');
// Hero image area is completely scrolled up when window.scrollY reaches hero.offsetHeight
const threshold = hero ? Math.max(300, hero.offsetHeight - 4) : window.innerHeight;
setIsScrolledPastHero(window.scrollY >= threshold);
};
checkScroll();
window.addEventListener('scroll', checkScroll, { passive: true });
window.addEventListener('resize', checkScroll, { passive: true });
return () => {
window.removeEventListener('scroll', checkScroll);
window.removeEventListener('resize', checkScroll);
};
}, [pathname]);
// Close mobile menu on Escape key
useEffect(() => {
if (!mobileMenuOpen) return;
@@ -67,33 +41,22 @@ export function Navbar({ config, currentLocale }: NavbarProps) {
};
}, [mobileMenuOpen]);
// Text-only mode while viewing the homepage hero image
const isTextOnlyMode = pathname === '/' && !isScrolledPastHero;
return (
<header
className={`fixed top-0 left-0 right-0 w-full z-50 transition-[background-color,border-color,padding,box-shadow] duration-300 pointer-events-auto ${
mobileMenuOpen
? 'bg-[#FAF8F5] border-b border-slate-200/90 shadow-2xs py-2.5 sm:py-3'
: isTextOnlyMode
? 'bg-transparent border-b border-transparent py-3 sm:py-4'
: 'bg-[#FAF8F5] md:bg-[#FAF8F5]/98 md:backdrop-blur-md border-b border-slate-200/90 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">
{/* Brand Logo - Always visible at all times */}
<header className="sticky top-0 left-0 right-0 w-full z-40 bg-paper/95 border-b border-rule transition-[border-color,background-color] duration-150">
<div className="max-w-container mx-auto px-4 sm:px-6 lg:px-8 h-16 flex items-center justify-between">
{/* Brand Logo */}
<div className="relative z-20 flex-shrink-0">
<BrandLogo size="md" />
</div>
{/* Center Navigation Links: Clean, high-contrast text buttons */}
<nav className="hidden md:flex items-center gap-6 lg:gap-8 relative z-20">
{/* Center Navigation Links: Clean editorial links */}
<nav className="hidden md:flex items-center gap-7 relative z-20">
<Link
href="/"
className={`text-sm font-bold tracking-tight transition-colors ${
className={`text-sm font-body transition-colors duration-100 ${
pathname === '/'
? 'text-blue-600'
: 'text-slate-900 hover:text-blue-600'
? 'text-ink font-semibold border-b-2 border-accent pb-0.5'
: 'text-ink-2 hover:text-ink'
}`}
>
Home
@@ -101,10 +64,10 @@ export function Navbar({ config, currentLocale }: NavbarProps) {
<Link
href="/tools"
className={`text-sm font-bold tracking-tight transition-colors ${
className={`text-sm font-body transition-colors duration-100 ${
pathname.startsWith('/tools')
? 'text-blue-600'
: 'text-slate-900 hover:text-blue-600'
? 'text-ink font-semibold border-b-2 border-accent pb-0.5'
: 'text-ink-2 hover:text-ink'
}`}
>
Tools
@@ -112,10 +75,10 @@ export function Navbar({ config, currentLocale }: NavbarProps) {
<Link
href="/apps"
className={`text-sm font-bold tracking-tight transition-colors ${
className={`text-sm font-body transition-colors duration-100 ${
pathname.startsWith('/apps')
? 'text-blue-600'
: 'text-slate-900 hover:text-blue-600'
? 'text-ink font-semibold border-b-2 border-accent pb-0.5'
: 'text-ink-2 hover:text-ink'
}`}
>
Apps
@@ -123,10 +86,10 @@ export function Navbar({ config, currentLocale }: NavbarProps) {
<Link
href="/pricing"
className={`text-sm font-bold tracking-tight transition-colors ${
className={`text-sm font-body transition-colors duration-100 ${
pathname.startsWith('/pricing')
? 'text-blue-600'
: 'text-slate-900 hover:text-blue-600'
? 'text-ink font-semibold border-b-2 border-accent pb-0.5'
: 'text-ink-2 hover:text-ink'
}`}
>
Pricing
@@ -134,23 +97,23 @@ export function Navbar({ config, currentLocale }: NavbarProps) {
<Link
href="/trust"
className={`text-sm font-bold tracking-tight transition-colors ${
className={`text-sm font-body transition-colors duration-100 ${
pathname.startsWith('/trust')
? 'text-blue-600'
: 'text-slate-900 hover:text-blue-600'
? 'text-ink font-semibold border-b-2 border-accent pb-0.5'
: 'text-ink-2 hover:text-ink'
}`}
>
Trust & Privacy
Trust & privacy
</Link>
</nav>
{/* Right CTA Button: Blue "Get the App" pill button */}
{/* Right CTA Button: Cadmium orange action */}
<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/25 transition-all duration-200 hover:scale-105 active:scale-95"
href="/tools"
className="btn-primary"
>
Get the App
Try tools
</Link>
</div>
@@ -158,98 +121,68 @@ export function Navbar({ config, currentLocale }: NavbarProps) {
<div className="flex md:hidden items-center space-x-2 relative z-20">
<button
onClick={() => setMobileMenuOpen(!mobileMenuOpen)}
className={`transition-all duration-300 active:scale-95 ${
isTextOnlyMode && !mobileMenuOpen
? 'p-2 text-slate-900 hover:text-blue-600 bg-transparent border-transparent'
: 'p-2.5 rounded-xl border text-slate-900 bg-white hover:bg-slate-50 border-slate-200/90 shadow-2xs'
}`}
aria-label={mobileMenuOpen ? 'Close navigation menu' : 'Open navigation menu'}
aria-expanded={mobileMenuOpen}
className="p-2 text-ink hover:text-ink-2 active:bg-paper-2 disabled:opacity-50 focus-visible:ring-2 focus-visible:ring-accent rounded"
aria-label={mobileMenuOpen ? 'Close menu' : 'Open menu'}
>
{mobileMenuOpen ? <X className="w-5 h-5 text-blue-600" /> : <Menu className="w-5 h-5 text-slate-900" />}
{mobileMenuOpen ? (
<X className="w-5 h-5 text-ink" aria-hidden="true" />
) : (
<Menu className="w-5 h-5 text-ink" aria-hidden="true" />
)}
</button>
</div>
</div>
{/* Mobile Drawer */}
{mobileMenuOpen && (
<nav
id="mobile-navigation"
aria-label="Mobile navigation"
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="md:hidden border-t border-rule bg-paper px-4 py-6 space-y-4">
<nav className="flex flex-col space-y-3">
<Link
href="/"
onClick={() => setMobileMenuOpen(false)}
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'
}`}
className="text-base font-body text-ink hover:text-accent py-1"
>
<span>Home</span>
Home
</Link>
<Link
href="/tools"
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('/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'
}`}
className="text-base font-body text-ink hover:text-accent py-1"
>
<span>Tools</span>
Tools
</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'
}`}
className="text-base font-body text-ink hover:text-accent py-1"
>
<span>Apps</span>
Apps
</Link>
<Link
href="/pricing"
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('/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'
}`}
className="text-base font-body text-ink hover:text-accent py-1"
>
<span>Pricing</span>
Pricing
</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'
}`}
className="text-base font-body text-ink hover:text-accent py-1"
>
<span>Trust & Privacy</span>
Trust & privacy
</Link>
</div>
<div className="w-full max-w-md mx-auto pt-6 border-t border-slate-200/80">
</nav>
<div className="pt-2">
<Link
href="/apps"
href="/tools"
onClick={() => setMobileMenuOpen(false)}
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"
className="btn-primary w-full text-center"
>
Get the App
Try tools free
</Link>
</div>
</nav>
</div>
)}
</header>
);