Files
webb/src/components/sections/HeroSection.tsx
T

134 lines
6.8 KiB
TypeScript
Raw Normal View History

'use client';
import React from 'react';
import Link from 'next/link';
import { Sparkles, ArrowRight, Smartphone, Layers, ShieldCheck, LockKeyhole, ImagePlus } from 'lucide-react';
import { resolveLocalised, ToolItem, AppItem, VariantSpec } from '@/types';
import { TryItWidget } from './TryItWidget';
import { Hero3DCanvas } from '@/components/3d/Hero3DCanvas';
import { Kinetic3DText } from '@/components/ui/Kinetic3DText';
import { ShimmerBadge } from '@/components/animate-ui/ShimmerBadge';
import { BorderBeam } from '@/components/animate-ui/BorderBeam';
interface HeroSectionProps {
title?: any;
subtitle?: any;
variant?: string;
badge?: any;
tryIt?: {
toolRef: string;
};
tool?: ToolItem | null;
homeApp?: AppItem | null;
variants?: VariantSpec[];
locale?: string;
}
export function HeroSection({
title,
subtitle,
variant = 'centered',
badge,
tool,
homeApp,
variants = [],
locale = 'en',
}: HeroSectionProps) {
const resolvedTitle = resolveLocalised(title, locale);
const resolvedSubtitle = resolveLocalised(subtitle, locale);
const resolvedBadge = resolveLocalised(badge, locale);
if (variant === 'tryit' && tool) {
return (
<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" />
</div>
<div className="relative z-10 max-w-[1440px] mx-auto px-4 sm:px-6 lg:px-10">
<div className="grid lg:grid-cols-[0.82fr_1.18fr] gap-10 xl:gap-16 items-center">
<div className="max-w-xl">
<div className="inline-flex items-center gap-2 rounded-full border border-blue-200/80 bg-white/75 px-3.5 py-2 text-[11px] font-semibold tracking-[0.12em] uppercase text-blue-800 shadow-sm backdrop-blur">
<Sparkles className="w-3.5 h-3.5" />
<span>{resolvedBadge || 'A calmer way to create'}</span>
</div>
<Kinetic3DText
primaryText="Make every photo"
highlightText="feel finished."
subtitle={resolvedSubtitle}
className="mt-7 text-left [&_h1]:text-left [&_h1]:text-[2.7rem] sm:[&_h1]:text-6xl lg:[&_h1]:text-[4.25rem] [&_h1]:leading-[1.02] [&_p]:mx-0 [&_p]:mt-5 [&_p]:max-w-lg [&_p]:text-base [&_p]:sm:text-lg"
/>
<div className="mt-8 flex flex-wrap gap-3">
<Link href="/tools" className="group inline-flex items-center gap-2.5 rounded-full bg-slate-950 px-6 py-3.5 text-sm font-semibold text-white shadow-lg shadow-slate-900/10 transition-all hover:-translate-y-0.5 hover:bg-blue-700 hover:shadow-xl">
Explore the tools <ArrowRight className="h-4 w-4 transition-transform group-hover:translate-x-1" />
</Link>
<Link href="/apps" className="inline-flex items-center gap-2 rounded-full border border-slate-300/80 bg-white/75 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" /> Our apps
</Link>
</div>
<div className="mt-9 flex flex-wrap gap-x-5 gap-y-2 text-xs font-medium text-slate-600">
<span className="inline-flex items-center gap-1.5"><ShieldCheck className="h-4 w-4 text-emerald-700" /> No account needed</span>
<span className="inline-flex items-center gap-1.5"><LockKeyhole className="h-4 w-4 text-emerald-700" /> Photos aren’t stored</span>
<span className="inline-flex items-center gap-1.5"><ImagePlus className="h-4 w-4 text-emerald-700" /> Try with a sample</span>
</div>
</div>
<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>
<TryItWidget tool={tool} homeApp={homeApp} variants={variants} locale={locale} />
</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]">
<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">
{resolvedTitle}
</h1>
<p className="text-base sm:text-xl text-slate-600 max-w-2xl mx-auto leading-relaxed">
{resolvedSubtitle}
</p>
<div className="flex flex-wrap items-center justify-center gap-4 pt-4">
<Link
href="/#studio-suite"
className="inline-flex items-center gap-2 px-7 py-3.5 rounded-full font-bold text-xs sm:text-sm text-white bg-blue-600 hover:bg-blue-700 shadow-sm shadow-blue-500/20 transition-all hover:scale-105 active:scale-95"
>
<Layers className="w-4 h-4 text-white" />
<span>The Creative Suite</span>
</Link>
<Link
href="/apps"
className="inline-flex items-center gap-2 px-7 py-3.5 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>
</div>
</div>
</section>
);
}