feat: seamless sticky showcase scroll, tool page hero comparison, and homepage tool stack sliders
This commit is contained in:
@@ -2,13 +2,13 @@
|
||||
|
||||
import React from 'react';
|
||||
import Link from 'next/link';
|
||||
import { Sparkles, ArrowRight, Smartphone, Layers, ShieldCheck, LockKeyhole, ImagePlus } from 'lucide-react';
|
||||
import { Sparkles, ArrowRight, Smartphone, Layers, ShieldCheck, LockKeyhole, ImagePlus, Check, Zap } from 'lucide-react';
|
||||
import { resolveLocalised, ToolItem, AppItem, VariantSpec } from '@/types';
|
||||
import { TryItWidget } from './TryItWidget';
|
||||
import { Hero3DCanvas } from '@/components/3d/Hero3DCanvas';
|
||||
import { HeroPrism } from '@/components/3d/HeroPrism';
|
||||
import { Kinetic3DText } from '@/components/ui/Kinetic3DText';
|
||||
import { ShimmerBadge } from '@/components/animate-ui/ShimmerBadge';
|
||||
import { BorderBeam } from '@/components/animate-ui/BorderBeam';
|
||||
import { DeferredComparison } from '@/components/ui/DeferredComparison';
|
||||
|
||||
interface HeroSectionProps {
|
||||
title?: any;
|
||||
@@ -43,7 +43,7 @@ export function HeroSection({
|
||||
<section className="relative isolate overflow-hidden pt-28 pb-16 sm:pt-36 sm:pb-24 lg:pt-40 lg:pb-28 bg-[#FAF8F5]">
|
||||
<div className="absolute inset-x-0 top-0 h-[620px] bg-[radial-gradient(ellipse_at_72%_18%,rgba(87,132,220,0.14),transparent_48%),radial-gradient(ellipse_at_12%_0%,rgba(208,182,142,0.12),transparent_36%)] pointer-events-none" />
|
||||
<div className="absolute right-[4%] top-12 w-[360px] h-[360px] opacity-35 pointer-events-none hidden lg:block" aria-hidden="true">
|
||||
<Hero3DCanvas className="w-full h-full" />
|
||||
<HeroPrism />
|
||||
</div>
|
||||
|
||||
<div className="relative z-10 max-w-[1440px] mx-auto px-4 sm:px-6 lg:px-10">
|
||||
@@ -78,8 +78,7 @@ export function HeroSection({
|
||||
|
||||
<div className="relative min-w-0">
|
||||
<div className="absolute -inset-4 rounded-[2.25rem] bg-gradient-to-br from-blue-200/50 via-white/30 to-amber-100/60 blur-2xl" />
|
||||
<div className="relative rounded-[1.8rem] border border-white/80 bg-white/55 p-1.5 shadow-[0_35px_100px_-38px_rgba(32,49,84,0.32)] backdrop-blur-sm sm:p-2">
|
||||
<div className="absolute inset-0 rounded-[1.8rem] overflow-hidden pointer-events-none"><BorderBeam duration={16} size={240} borderWidth={1.5} colorFrom="#6b8bd6" colorTo="#c7a979" /></div>
|
||||
<div className="relative rounded-[1.8rem] border border-slate-200/90 bg-white/88 p-1.5 shadow-[0_35px_100px_-38px_rgba(32,49,84,0.32)] sm:p-2">
|
||||
<TryItWidget tool={tool} homeApp={homeApp} variants={variants} locale={locale} />
|
||||
</div>
|
||||
</div>
|
||||
@@ -89,6 +88,114 @@ export function HeroSection({
|
||||
);
|
||||
}
|
||||
|
||||
// Dedicated Tool Landing Hero (for Google Search / Direct Traffic SEO)
|
||||
if (variant === 'toolHero' && tool) {
|
||||
const example = tool.content?.examples?.[0];
|
||||
const categoryName = tool.category?.replace('-', ' ').toUpperCase() || 'AI TOOL';
|
||||
const appName = homeApp ? resolveLocalised(homeApp.name, locale) : 'Mobile App';
|
||||
|
||||
return (
|
||||
<section className="relative isolate overflow-hidden pt-28 pb-16 sm:pt-36 sm:pb-20 lg:pt-40 lg:pb-24 bg-[#FAF8F5] border-b border-slate-900/[0.07]">
|
||||
{/* Ambient subtle warm gradient */}
|
||||
<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" />
|
||||
|
||||
<div className="relative z-10 max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
|
||||
{/* Breadcrumb Navigation */}
|
||||
<nav aria-label="Breadcrumb" className="mb-6 flex items-center gap-2 text-xs font-medium text-slate-500">
|
||||
<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>
|
||||
<span className="text-slate-900 font-semibold">{resolvedTitle}</span>
|
||||
</nav>
|
||||
|
||||
<div className="grid lg:grid-cols-[1fr_1.1fr] gap-10 xl:gap-14 items-center">
|
||||
{/* Left Column: Value Proposition & Actions */}
|
||||
<div className="max-w-xl">
|
||||
<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">
|
||||
<Sparkles className="w-3.5 h-3.5 text-blue-600" />
|
||||
<span>{categoryName} • NEURAL MODEL</span>
|
||||
</div>
|
||||
|
||||
<h1 className="mt-5 text-3xl sm:text-4xl lg:text-5xl font-display font-black tracking-tight text-slate-900 leading-[1.08]">
|
||||
{resolvedTitle}
|
||||
</h1>
|
||||
|
||||
<p className="mt-4 text-base sm:text-lg leading-relaxed text-slate-600">
|
||||
{resolvedSubtitle}
|
||||
</p>
|
||||
|
||||
{/* Key Feature Specs */}
|
||||
<div className="mt-6 flex flex-wrap gap-2.5">
|
||||
<span className="inline-flex items-center gap-1.5 rounded-lg border border-slate-900/10 bg-white px-3 py-1.5 text-xs font-semibold text-slate-700 shadow-sm">
|
||||
<Check className="h-3.5 w-3.5 text-blue-700" /> Lossless 4K Output
|
||||
</span>
|
||||
<span className="inline-flex items-center gap-1.5 rounded-lg border border-slate-900/10 bg-white px-3 py-1.5 text-xs font-semibold text-slate-700 shadow-sm">
|
||||
<Zap className="h-3.5 w-3.5 text-amber-600" /> Instant Processing
|
||||
</span>
|
||||
<span className="inline-flex items-center gap-1.5 rounded-lg border border-slate-900/10 bg-white px-3 py-1.5 text-xs font-semibold text-slate-700 shadow-sm">
|
||||
<ShieldCheck className="h-3.5 w-3.5 text-emerald-600" /> 100% Free Online
|
||||
</span>
|
||||
</div>
|
||||
|
||||
{/* CTAs */}
|
||||
<div className="mt-8 flex flex-wrap gap-3.5">
|
||||
<a
|
||||
href="#tool-tryit"
|
||||
className="group inline-flex items-center gap-2.5 rounded-full bg-blue-600 px-6 py-3.5 text-sm font-semibold text-white shadow-lg shadow-blue-600/25 transition-all hover:-translate-y-0.5 hover:bg-blue-700 hover:shadow-xl"
|
||||
>
|
||||
<Sparkles className="h-4 w-4" /> Try with your photo <ArrowRight className="h-4 w-4 transition-transform group-hover:translate-x-1" />
|
||||
</a>
|
||||
{homeApp && (
|
||||
<Link
|
||||
href={`/apps/${homeApp.slug}`}
|
||||
className="inline-flex items-center gap-2 rounded-full border border-slate-300/80 bg-white/80 px-5 py-3.5 text-sm font-semibold text-slate-800 shadow-sm transition-all hover:-translate-y-0.5 hover:border-slate-400 hover:bg-white"
|
||||
>
|
||||
<Smartphone className="h-4 w-4 text-blue-700" /> {appName} App
|
||||
</Link>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{/* Trust Badges */}
|
||||
<div className="mt-8 flex flex-wrap gap-x-5 gap-y-2 text-xs font-medium text-slate-500">
|
||||
<span className="inline-flex items-center gap-1.5"><ShieldCheck className="h-4 w-4 text-emerald-600" /> No account needed</span>
|
||||
<span className="inline-flex items-center gap-1.5"><LockKeyhole className="h-4 w-4 text-emerald-600" /> Photos never stored</span>
|
||||
<span className="inline-flex items-center gap-1.5"><ImagePlus className="h-4 w-4 text-emerald-600" /> Instant preview</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Right Column: Hero Interactive Transformation Showcase */}
|
||||
<div className="relative min-w-0">
|
||||
<div className="absolute -inset-4 rounded-[2.5rem] bg-gradient-to-br from-blue-300/30 via-amber-200/20 to-indigo-300/30 blur-2xl pointer-events-none" />
|
||||
<div className="relative rounded-[2rem] border border-slate-900/[0.1] bg-white p-2.5 sm:p-3 shadow-cinematic-3d">
|
||||
{example?.before && example?.after ? (
|
||||
<div className="space-y-2.5">
|
||||
<DeferredComparison
|
||||
beforeUrl={example.before}
|
||||
afterUrl={example.after}
|
||||
beforeLabel="ORIGINAL"
|
||||
afterLabel="AI RESULT"
|
||||
aspectRatio="aspect-[4/3] sm:aspect-[16/10]"
|
||||
/>
|
||||
{example.caption && (
|
||||
<p className="px-2 py-1 text-center text-xs font-medium text-slate-500">
|
||||
{example.caption}
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
) : (
|
||||
<div className="aspect-[16/10] bg-slate-100 rounded-2xl grid place-items-center text-slate-400 text-sm">
|
||||
Interactive transformation preview
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
);
|
||||
}
|
||||
|
||||
// Centered Hero for Tools/Apps/Pricing pages
|
||||
return (
|
||||
<section className="relative overflow-hidden pt-28 pb-20 sm:pt-36 sm:pb-28 text-center bg-[#FAF8F5] border-b border-slate-900/[0.07]">
|
||||
|
||||
Reference in New Issue
Block a user