feat: implement management folder architecture, hover-only tool sliders, grain transform animation, and prominent upload studio

This commit is contained in:
2026-11-04 12:28:32 +05:30
parent ad9a3ab000
commit 3cb202399f
56 changed files with 2339 additions and 466 deletions
+89 -70
View File
@@ -22,6 +22,7 @@ import { Kinetic3DText } from '@/components/ui/Kinetic3DText';
import { ShimmerBadge } from '@/components/animate-ui/ShimmerBadge';
import { CardBeforeAfterSlider } from '@/components/ui/CardBeforeAfterSlider';
import { BeforeAfterSlider } from '@/components/ui/BeforeAfterSlider';
import { NeuralGrainOverlay } from '@/components/ui/NeuralGrainOverlay';
interface HeroSectionProps {
title?: any;
@@ -48,6 +49,7 @@ export function HeroSection({
locale = 'en',
}: HeroSectionProps) {
const [mobileTab, setMobileTab] = useState<'upload' | 'compare'>('upload');
const [grainActive, setGrainActive] = useState<boolean>(true);
const resolvedTitle = resolveLocalised(title, locale);
const resolvedSubtitle = resolveLocalised(subtitle, locale);
const resolvedBadge = resolveLocalised(badge, locale);
@@ -127,29 +129,45 @@ export function HeroSection({
<span className="text-slate-900 font-semibold">{resolvedTitle}</span>
</nav>
{/* Centered Tool Header */}
<div className="text-center max-w-3xl mx-auto mb-6 sm:mb-8">
<div className="inline-flex items-center gap-2 rounded-full border border-blue-200/80 bg-white/80 px-3.5 py-1.5 text-[11px] font-semibold tracking-[0.14em] uppercase text-blue-800 shadow-sm backdrop-blur">
{/* Centered Editorial Tool Header (Typography OUTSIDE cards) */}
<div className="text-center max-w-4xl mx-auto mb-10 sm:mb-12">
<div className="inline-flex items-center gap-2 rounded-full border border-blue-200/90 bg-white/90 px-4 py-1.5 text-xs font-semibold tracking-[0.14em] uppercase text-blue-800 shadow-sm backdrop-blur">
<Sparkles className="w-3.5 h-3.5 text-blue-600" />
<span>{categoryName} • AI NEURAL TOOL</span>
<span>{categoryName} • CRE NEURAL VISION 4.0</span>
</div>
<h1 className="mt-3.5 text-3xl sm:text-4xl lg:text-5xl font-display font-black tracking-tight text-slate-900 leading-[1.1]">
<h1 className="mt-4 text-3xl sm:text-5xl lg:text-6xl font-display font-black tracking-tight text-slate-900 leading-[1.08]">
{resolvedTitle}
</h1>
<p className="mt-3 text-sm sm:text-base leading-relaxed text-slate-600 max-w-2xl mx-auto">
<p className="mt-4 text-base sm:text-lg leading-relaxed text-slate-600 max-w-2xl mx-auto">
{resolvedSubtitle}
</p>
{/* Model Specs Row Outside Cards */}
<div className="mt-6 flex flex-wrap items-center justify-center gap-2 sm:gap-3 text-xs font-medium text-slate-600">
<span className="inline-flex items-center gap-1.5 px-3.5 py-1.5 rounded-full bg-white/90 border border-slate-200/80 shadow-2xs">
<Check className="w-3.5 h-3.5 text-blue-600" /> Lossless 4K Reconstruction
</span>
<span className="inline-flex items-center gap-1.5 px-3.5 py-1.5 rounded-full bg-white/90 border border-slate-200/80 shadow-2xs">
<Zap className="w-3.5 h-3.5 text-amber-500" /> &lt; 0.8s Inference
</span>
<span className="inline-flex items-center gap-1.5 px-3.5 py-1.5 rounded-full bg-white/90 border border-slate-200/80 shadow-2xs">
<ShieldCheck className="w-3.5 h-3.5 text-emerald-600" /> 100% Private (Never Stored)
</span>
<span className="inline-flex items-center gap-1.5 px-3.5 py-1.5 rounded-full bg-white/90 border border-slate-200/80 shadow-2xs">
<Sparkles className="w-3.5 h-3.5 text-indigo-600" /> Free Browser Trial
</span>
</div>
</div>
{/* Intelligent Mobile Tab Switcher (Visible ONLY on Mobile < 768px) */}
<div className="flex md:hidden items-center justify-center mb-5">
{/* Intelligent Mobile Tab Switcher (Visible ONLY on Mobile < 1024px) */}
<div className="flex lg:hidden items-center justify-center mb-6">
<div className="inline-flex rounded-2xl bg-white p-1 border border-slate-200/90 shadow-2xs">
<button
type="button"
onClick={() => setMobileTab('upload')}
className={`flex items-center gap-2 px-4 py-2 rounded-xl text-xs font-bold transition-all ${
className={`flex items-center gap-2 px-5 py-2.5 rounded-xl text-xs font-bold transition-all ${
mobileTab === 'upload'
? 'bg-blue-600 text-white shadow-sm'
: 'text-slate-600 hover:text-slate-900'
@@ -161,91 +179,92 @@ export function HeroSection({
<button
type="button"
onClick={() => setMobileTab('compare')}
className={`flex items-center gap-2 px-4 py-2 rounded-xl text-xs font-bold transition-all ${
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>Before &amp; After</span>
<span>Transform Result</span>
</button>
</div>
</div>
{/* Intelligent Side-by-Side Tool Studio (Side-by-Side on Tablet & Desktop) */}
<div className="grid grid-cols-1 md:grid-cols-2 gap-6 lg:gap-8 items-stretch max-w-6xl mx-auto" id="tool-studio">
{/* Column 1: Live Comparison Showcase */}
<div className={`flex flex-col ${mobileTab === 'compare' ? 'block' : 'hidden md:flex'}`}>
<div className="flex flex-col justify-between h-full bg-white rounded-3xl p-5 sm:p-7 lg:p-8 border border-slate-900/[0.08] shadow-cream-md overflow-hidden">
<div>
{/* Card Header */}
<div className="flex items-center justify-between 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-indigo-50 border border-indigo-200/80 flex items-center justify-center text-indigo-600">
<Sparkles className="w-4 h-4" />
</div>
<div>
<h3 className="text-xs sm:text-sm font-display font-bold text-slate-900">
Neural Transformation Preview
</h3>
<p className="text-[11px] font-mono text-slate-500">Interactive Model Result</p>
</div>
</div>
<span className="inline-flex items-center gap-1.5 px-3 py-1 rounded-full text-[10px] font-mono font-semibold text-emerald-800 bg-emerald-50 border border-emerald-200/90 shadow-2xs">
<span className="w-1.5 h-1.5 rounded-full bg-emerald-500 animate-pulse" />
Live Demo
</span>
{/* 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: Result-Focused Display Stage (Edge-to-Edge Media Focus with Neural Grain Transform Animation) */}
<div className={`lg:col-span-7 flex flex-col ${mobileTab === 'compare' ? 'block' : 'hidden lg:flex'}`}>
<div className="relative flex flex-col justify-between h-full rounded-3xl overflow-hidden border border-slate-900/[0.1] bg-slate-950 shadow-cinematic-3d group">
{/* Floating Glass Top Bar */}
<div className="absolute top-4 left-4 right-4 z-20 flex items-center justify-between pointer-events-none">
<div className="pointer-events-auto inline-flex items-center gap-2 px-3.5 py-1.5 rounded-full bg-slate-900/80 backdrop-blur-md border border-white/15 text-white text-xs font-semibold shadow-md">
<Sparkles className="w-3.5 h-3.5 text-blue-400" />
<span>Neural Model Result</span>
</div>
{/* Comparison Slider */}
<div className="mt-5">
<BeforeAfterSlider
beforeUrl={primaryExample.before}
afterUrl={primaryExample.after}
beforeLabel="Original"
afterLabel="CRE AI Result"
caption={primaryExample.caption}
aspectRatio="aspect-[4/3] sm:aspect-[16/11]"
autoSlide={true}
/>
</div>
{/* Neural Grain Synthesis Toggle */}
<button
type="button"
onClick={() => setGrainActive(!grainActive)}
className="pointer-events-auto inline-flex items-center gap-1.5 px-3 py-1.5 rounded-full bg-white/90 hover:bg-white text-slate-800 text-xs font-semibold shadow-md backdrop-blur-md transition-all active:scale-95"
title="Toggle Generative Latent Grain Synthesis"
>
<span className={`w-2 h-2 rounded-full ${grainActive ? 'bg-indigo-500 animate-pulse' : 'bg-slate-400'}`} />
<span>Film Grain Transform: {grainActive ? 'ON' : 'OFF'}</span>
</button>
</div>
<div>
{/* Model Specs Strip */}
<div className="mt-5 pt-4 border-t border-slate-100 flex flex-wrap items-center justify-between gap-3 text-xs text-slate-500 font-mono">
<span className="inline-flex items-center gap-1.5">
<Check className="w-3.5 h-3.5 text-blue-600" /> Lossless 4K preservation
</span>
<span className="inline-flex items-center gap-1.5">
<Zap className="w-3.5 h-3.5 text-amber-500" /> Instant sub-second inference
</span>
</div>
{/* The Pure Result-Focused Viewport */}
<div className="relative flex-1 min-h-[380px] sm:min-h-[460px] overflow-hidden">
<BeforeAfterSlider
beforeUrl={primaryExample.before}
afterUrl={primaryExample.after}
beforeLabel="RAW INPUT"
afterLabel="AI SYNTHESIZED"
caption={primaryExample.caption}
aspectRatio="aspect-[4/3] lg:aspect-auto lg:h-full"
autoSlide={true}
className="h-full"
/>
{/* Mobile Jump to Upload */}
<div className="mt-4 md: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 Now</span>
</button>
</div>
{/* Generative AI Latent Grain Transform Animation */}
<NeuralGrainOverlay active={grainActive} intensity={0.25} />
</div>
{/* Floating Bottom Hint Bar */}
<div className="p-4 bg-slate-900/90 border-t border-white/10 flex flex-wrap items-center justify-between gap-3 text-xs text-slate-300 font-mono">
<span className="flex items-center gap-1.5">
<SlidersHorizontal className="w-3.5 h-3.5 text-blue-400" />
Drag divider to inspect sub-pixel linework &amp; textures
</span>
<span className="text-[11px] text-slate-400">
High-Res Neural Synthesis
</span>
</div>
{/* Mobile Jump to Upload */}
<div className="p-4 bg-slate-900 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>
</div>
</div>
</div>
{/* Column 2: Upload Action Studio */}
<div className={`flex flex-col ${mobileTab === 'upload' ? 'block' : 'hidden md:flex'}`}>
{/* Column 2: Spacious, Prominent Upload Studio */}
<div className={`lg:col-span-5 flex flex-col ${mobileTab === 'upload' ? 'block' : 'hidden lg:flex'}`}>
<TryItWidget
tool={tool}
homeApp={homeApp}
variants={variants}
locale={locale}
className="h-full"
className="h-full flex flex-col justify-between"
onSwitchToCompare={() => setMobileTab('compare')}
/>
</div>