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

129 lines
5.3 KiB
TypeScript
Raw Normal View History

'use client';
import React from 'react';
import Link from 'next/link';
import { Sparkles, ArrowRight, Smartphone, Layers } from 'lucide-react';
import { resolveLocalised, ToolItem, AppItem, VariantSpec } from '@/types';
import { TryItWidget } from './TryItWidget';
import { TiltCard } from '@/components/ui/TiltCard';
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 overflow-hidden pt-24 pb-20 sm:pt-32 sm:pb-28 lg:pt-36 lg:pb-32 bg-[#FAF8F5]">
{/* Ambient Radial Lighting Glow */}
<div className="absolute top-0 left-1/2 -translate-x-1/2 w-full max-w-7xl h-[450px] bg-gradient-to-b from-blue-500/[0.04] via-indigo-500/[0.03] to-transparent blur-3xl pointer-events-none -z-10" />
<div className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 relative z-10">
{/* Main Hero Header */}
<div className="text-center max-w-4xl mx-auto space-y-7 mb-12 sm:mb-16 relative z-10">
{/* Live Core Status Pill */}
{resolvedBadge && (
<div className="inline-flex items-center gap-2 px-4 py-1.5 rounded-full bg-blue-50 border border-blue-200/80 text-xs font-mono font-semibold text-blue-700 shadow-sm backdrop-blur-sm">
<span className="relative flex h-2 w-2">
<span className="animate-ping absolute inline-flex h-full w-full rounded-full bg-blue-500 opacity-75"></span>
<span className="relative inline-flex rounded-full h-2 w-2 bg-blue-600"></span>
</span>
<span>{resolvedBadge}</span>
</div>
)}
{/* Main Headline with Editorial Kerning and Fluid Scale */}
<h1 className="text-4xl sm:text-5xl lg:text-6xl xl:text-7xl font-display font-black text-slate-900 tracking-tight leading-[1.08] max-w-4xl mx-auto">
Transform Photos with <br className="hidden sm:inline" />
<span className="text-transparent bg-clip-text bg-gradient-to-r from-blue-700 via-indigo-600 to-purple-600">
Next-Gen Neural AI
</span>
</h1>
{/* Subtitle with Refined Editorial Measure */}
<p className="text-base sm:text-lg lg:text-xl text-slate-600 leading-relaxed max-w-2xl mx-auto font-normal">
{resolvedSubtitle}
</p>
</div>
{/* Embedded Interactive Free Try-It Widget wrapped with 3D Tilt Card */}
<div className="max-w-4xl mx-auto relative z-10">
<TiltCard maxTilt={4} scale={1.01} showGlare={true}>
<TryItWidget
tool={tool}
homeApp={homeApp}
variants={variants}
locale={locale}
/>
</TiltCard>
</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>
);
}