2026-11-03 13:36:36 +05:30
'use client' ;
2026-11-04 17:55:18 +05:30
import React from 'react' ;
2026-11-03 12:24:43 +05:30
import Link from 'next/link' ;
2026-11-04 12:06:23 +05:30
import {
Sparkles ,
ArrowRight ,
Smartphone ,
ShieldCheck ,
LockKeyhole ,
Check ,
Zap ,
2026-11-04 17:55:18 +05:30
ArrowDown
2026-11-04 12:06:23 +05:30
} from 'lucide-react' ;
2026-11-03 12:24:43 +05:30
import { resolveLocalised , ToolItem , AppItem , VariantSpec } from '@/types' ;
import { TryItWidget } from './TryItWidget' ;
2026-11-04 17:55:18 +05:30
import { Hero3DCanvas } from '@/components/3d/Hero3DCanvas' ;
import { TextAnimate } from '@/components/magicui/text-animate' ;
2026-11-04 12:42:10 +05:30
import { GrainTransformShowcase } from '@/components/ui/GrainTransformShowcase' ;
2026-11-03 12:24:43 +05:30
interface HeroSectionProps {
title? : any ;
subtitle? : any ;
variant? : string ;
badge? : any ;
tryIt ?: {
2026-11-04 15:36:30 +05:30
toolRef? : string ;
ctaText? : string ;
samplePresets? : Array < { label : string ; url : string ; resultUrl? : string } > ;
2026-11-03 12:24:43 +05:30
};
2026-11-04 15:36:30 +05:30
trustBadges? : Array < { text : string ; icon? : string } > ;
primaryCta ?: { label? : any ; href? : string };
secondaryCta ?: { label? : any ; href? : string };
2026-11-03 12:24:43 +05:30
tool? : ToolItem | null ;
homeApp? : AppItem | null ;
variants? : VariantSpec [];
locale? : string ;
}
export function HeroSection ({
title ,
subtitle ,
variant = 'centered' ,
badge ,
2026-11-04 15:36:30 +05:30
tryIt ,
trustBadges ,
primaryCta ,
secondaryCta ,
2026-11-03 12:24:43 +05:30
tool ,
homeApp ,
variants = [],
locale = 'en' ,
} : HeroSectionProps ) {
2026-11-04 17:55:18 +05:30
const resolvedSubtitle = resolveLocalised ( subtitle , locale ) || 'Studio-grade neural vision tools with zero sign-up and zero data retention. Process high-resolution portraits, precision cutouts, and 4K restorations directly in your browser.' ;
const resolvedBadge = resolveLocalised ( badge , locale ) || 'Next-Gen Neural AI Studio' ;
2026-11-03 12:24:43 +05:30
2026-11-04 17:55:18 +05:30
const primaryCtaLabel = resolveLocalised ( primaryCta ? . label , locale , 'Explore Our Tools' );
const primaryCtaHref = primaryCta ? . href || '#our-tools' ;
const secondaryCtaLabel = resolveLocalised ( secondaryCta ? . label , locale , 'Recommended Apps' );
const secondaryCtaHref = secondaryCta ? . href || '#recommended-apps' ;
2026-11-04 15:36:30 +05:30
2026-11-04 17:55:18 +05:30
// Dedicated Tool Landing Hero (for /tools/[slug] SEO pages)
2026-11-04 11:35:51 +05:30
if ( variant === 'toolHero' && tool ) {
const categoryName = tool . category ? . replace ( '-' , ' ' ). toUpperCase () || 'AI TOOL' ;
const appName = homeApp ? resolveLocalised ( homeApp . name , locale ) : 'Mobile App' ;
2026-11-04 12:38:30 +05:30
const toolMedia = ( tool as any ). media ;
2026-11-04 12:06:23 +05:30
const primaryExample = tool . content ? . examples ? .[ 0 ] || {
2026-11-04 12:38:30 +05:30
before : toolMedia?.before || `/management/pages/tools/ ${ tool . slug } /media/before.jpg` ,
after : toolMedia?.after || `/management/pages/tools/ ${ tool . slug } /media/after.jpg` ,
2026-11-04 12:06:23 +05:30
caption : 'Sub-pixel neural transformation details' ,
};
2026-11-04 11:35:51 +05:30
return (
2026-11-04 12:06:23 +05:30
< section className = "relative isolate overflow-hidden pt-28 pb-16 sm:pt-32 sm:pb-20 lg:pt-36 lg:pb-24 bg-[#FAF8F5] border-b border-slate-900/[0.07]" >
2026-11-04 11:35:51 +05:30
< div className = "absolute inset-x-0 top-0 h-[640px] bg-[radial-gradient(ellipse_at_75%_20%,rgba(87,132,220,0.12),transparent_50%),radial-gradient(ellipse_at_15%_0%,rgba(208,182,142,0.15),transparent_40%)] pointer-events-none" />
2026-11-04 12:06:23 +05:30
< div className = "relative z-10 max-w-7xl mx-auto px-4 sm:px-6 lg:px-8" >
< nav aria-label = "Breadcrumb" className = "mb-5 flex items-center justify-center gap-2 text-xs font-medium text-slate-500" >
2026-11-04 11:35:51 +05:30
< Link href = "/" className = "hover:text-blue-700 transition-colors" > Home </ Link >
< span > / </ span >
< Link href = "/tools" className = "hover:text-blue-700 transition-colors" > Tools </ Link >
< span > / </ span >
2026-11-04 17:55:18 +05:30
< span className = "text-slate-900 font-semibold" >{ resolveLocalised ( tool . name , locale )}</ span >
2026-11-04 11:35:51 +05:30
</ nav >
2026-11-04 12:28:32 +05:30
< 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" >
2026-11-04 12:00:17 +05:30
< Sparkles className = "w-3.5 h-3.5 text-blue-600" />
2026-11-04 12:28:32 +05:30
< span >{ categoryName } • CRE NEURAL VISION 4.0 </ span >
2026-11-04 11:35:51 +05:30
</ div >
2026-11-04 12:28:32 +05:30
< h1 className = "mt-4 text-3xl sm:text-5xl lg:text-6xl font-display font-black tracking-tight text-slate-900 leading-[1.08]" >
2026-11-04 17:55:18 +05:30
< TextAnimate animation = "slideLeft" by = "word" >{ resolveLocalised ( tool . name , locale )}</ TextAnimate >
2026-11-04 12:00:17 +05:30
</ h1 >
2026-11-04 17:55:18 +05:30
< 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 >
2026-11-04 12:00:17 +05:30
</ p >
2026-11-04 12:28:32 +05:30
< 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 4 K 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.8 s 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 >
</ div >
2026-11-04 12:00:17 +05:30
</ div >
2026-11-04 12:28:32 +05:30
< div className = "grid grid-cols-1 lg:grid-cols-12 gap-8 items-stretch max-w-7xl mx-auto" id = "tool-studio" >
2026-11-04 15:36:30 +05:30
< div className = "lg:col-span-7 flex flex-col" >
2026-11-04 13:09:44 +05:30
< TryItWidget
tool = { tool }
homeApp = { homeApp }
variants = { variants }
locale = { locale }
className = "h-full flex flex-col justify-between"
/>
</ div >
2026-11-04 15:36:30 +05:30
< div className = "lg:col-span-5 flex flex-col" id = "transformation-preview" >
2026-11-04 17:55:18 +05:30
< div className = "h-full rounded-3xl overflow-hidden border border-slate-900/[0.1] shadow-2xl bg-slate-950 flex flex-col justify-between min-h-[380px] sm:min-h-[460px]" >
2026-11-04 12:42:10 +05:30
< GrainTransformShowcase
beforeUrl = { primaryExample . before }
afterUrl = { primaryExample . after }
2026-11-04 13:03:03 +05:30
beforeLabel = "BEFORE"
afterLabel = "AFTER"
2026-11-04 12:42:10 +05:30
/>
</ div >
2026-11-04 12:06:23 +05:30
</ div >
2026-11-04 11:35:51 +05:30
</ div >
</ div >
2026-11-03 12:24:43 +05:30
</ section >
);
}
2026-11-04 17:55:18 +05:30
// Pure Front Page View (PRD & User Requirements):
// Clean, beautifully formatted typography + interactive 3D visuals strictly behind the text
2026-11-03 12:24:43 +05:30
return (
2026-11-04 17:55:18 +05:30
< section className = "relative isolate min-h-[92vh] sm:min-h-[95vh] flex flex-col justify-center items-center text-center overflow-hidden bg-[#FAF8F5] pt-24 pb-16 px-4 sm:px-6 lg:px-8" >
{ /* 1. Interactive 3D WebGL Canvas & Particle Constellation Mounted Behind Text */ }
< div className = "absolute inset-0 -z-10 flex items-center justify-center pointer-events-none select-none overflow-hidden" >
< div className = "w-[520px] h-[520px] sm:w-[780px] sm:h-[780px] lg:w-[980px] lg:h-[980px] opacity-70 transform-gpu transition-opacity duration-1000" >
< Hero3DCanvas className = "w-full h-full" />
</ div >
</ div >
2026-11-03 12:24:43 +05:30
2026-11-04 17:55:18 +05:30
{ /* 2. Ambient Atmosphere Radial Glows */ }
< div
className = "absolute inset-0 -z-20 pointer-events-none"
style = {{
background : 'radial-gradient(circle at 50% 45%, rgba(37,99,235,0.13) 0%, rgba(14,165,233,0.07) 35%, transparent 70%)' ,
}}
/>
< div
className = "absolute inset-x-0 bottom-0 h-40 bg-gradient-to-t from-[#FAF8F5] to-transparent -z-10 pointer-events-none"
/>
2026-11-03 12:24:43 +05:30
2026-11-04 17:55:18 +05:30
{ /* 3. Front Page Content: Flawlessly Formatted, Luxurious Typography */ }
< div className = "relative z-10 max-w-5xl mx-auto flex flex-col items-center justify-center" >
{ /* Subtle Elegant Pill Badge */ }
< div className = "inline-flex items-center gap-2 rounded-full border border-blue-500/20 bg-white/90 backdrop-blur-md px-4 py-1.5 text-xs font-mono font-medium tracking-wider uppercase text-blue-800 shadow-sm mb-6" >
< span className = "flex h-2 w-2 relative" >
< 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-2 w-2 bg-blue-600" ></ span >
</ span >
< span >{ resolvedBadge }</ span >
</ div >
{ /* Editorial High-Impact Headline (SF Pro & Poppins) */ }
< h1 className = "text-4xl sm:text-6xl lg:text-[4.5rem] font-display font-extrabold tracking-[-0.035em] text-slate-900 leading-[1.08] max-w-4xl mx-auto text-balance" >
< span className = "block text-slate-900" >
< TextAnimate animation = "slideLeft" by = "character" >
Transform Photos with
</ TextAnimate >
</ span >
< span className = "block mt-2 text-blue-600" >
< TextAnimate animation = "slideLeft" by = "character" delay = { 0.25 }>
Next - Gen Neural AI
</ TextAnimate >
</ span >
2026-11-03 12:24:43 +05:30
</ h1 >
2026-11-04 17:55:18 +05:30
{ /* Balanced, Readable Subtitle (Inter / SF Pro) */ }
< p className = "mt-6 text-base sm:text-lg lg:text-xl text-slate-600 max-w-2xl mx-auto font-sans leading-relaxed text-balance" >
< TextAnimate animation = "fadeIn" by = "word" delay = { 0.25 }>
{ resolvedSubtitle }
</ TextAnimate >
2026-11-03 12:24:43 +05:30
</ p >
2026-11-04 17:55:18 +05:30
{ /* Primary and Secondary Action Buttons */ }
< div className = "mt-9 flex flex-wrap items-center justify-center gap-3.5" >
< a
href = { primaryCtaHref }
className = "group inline-flex items-center gap-2.5 rounded-full bg-slate-950 px-8 py-3.5 text-xs sm:text-sm font-bold text-white shadow-lg shadow-slate-900/15 transition-all duration-300 hover:scale-105 hover:bg-blue-600 active:scale-95"
2026-11-03 12:24:43 +05:30
>
2026-11-04 17:55:18 +05:30
< span >{ primaryCtaLabel }</ span >
< ArrowDown className = "w-4 h-4 transition-transform group-hover:translate-y-0.5" />
</ a >
< a
href = { secondaryCtaHref }
className = "inline-flex items-center gap-2 rounded-full border border-slate-300/90 bg-white/80 backdrop-blur-md px-7 py-3.5 text-xs sm:text-sm font-semibold text-slate-800 shadow-sm transition-all duration-300 hover:scale-105 hover:bg-white active:scale-95"
2026-11-03 12:24:43 +05:30
>
2026-11-03 13:16:16 +05:30
< Smartphone className = "w-4 h-4 text-blue-600" />
2026-11-04 17:55:18 +05:30
< span >{ secondaryCtaLabel }</ span >
</ a >
2026-11-03 12:24:43 +05:30
</ div >
2026-11-04 17:55:18 +05:30
{ /* Trust Badges Strip */ }
< div className = "mt-8 flex flex-wrap items-center justify-center gap-x-6 gap-y-2 text-xs font-medium text-slate-500 font-sans" >
< span className = "inline-flex items-center gap-1.5" >
< ShieldCheck className = "h-4 w-4 text-emerald-600" />
< span > Zero - Storage Guarantee </ span >
</ span >
< span className = "inline-flex items-center gap-1.5" >
< Check className = "h-4 w-4 text-blue-600" />
< span > Lossless 4 K Export </ span >
</ span >
< span className = "inline-flex items-center gap-1.5" >
< Zap className = "h-4 w-4 text-amber-500" />
< span > & lt ; 0.8 s Inference </ span >
</ span >
</ div >
{ /* Gentle Scroll Cue */ }
< a
href = "#our-tools"
aria-label = "Scroll to our tools"
className = "mt-12 inline-flex flex-col items-center gap-1.5 text-[11px] font-mono uppercase tracking-widest text-slate-600 hover:text-blue-600 transition-colors"
>
< span > Scroll to Explore </ span >
< span className = "w-4 h-7 rounded-full border border-slate-300 flex justify-center p-1" >
< span className = "w-1 h-1.5 rounded-full bg-blue-600 animate-bounce" />
</ span >
</ a >
2026-11-03 12:24:43 +05:30
</ div >
</ section >
);
}