2026-11-03 13:36:36 +05:30
|
|
|
'use client';
|
|
|
|
|
|
2026-11-06 10:53:55 +05:30
|
|
|
import React, { useState } from 'react';
|
2026-11-03 12:24:43 +05:30
|
|
|
import Link from 'next/link';
|
2026-11-06 10:53:55 +05:30
|
|
|
import { ArrowRight, Smartphone, SlidersHorizontal, UploadCloud } from 'lucide-react';
|
2026-11-04 18:22:18 +05:30
|
|
|
import { ToolItem, VariantSpec, resolveLocalised } from '@/types';
|
2026-11-05 10:26:19 +05:30
|
|
|
import { TryItWidget } from './TryItWidget';
|
2026-11-06 10:53:55 +05:30
|
|
|
import { CardBeforeAfterSlider } from '@/components/ui/CardBeforeAfterSlider';
|
2026-11-03 12:24:43 +05:30
|
|
|
|
|
|
|
|
interface HeroSectionProps {
|
2026-11-04 18:22:18 +05:30
|
|
|
title?: Record<string, string> | string;
|
|
|
|
|
badge?: Record<string, string> | string;
|
|
|
|
|
subtitle?: Record<string, string> | string;
|
|
|
|
|
primaryCta?: { label?: Record<string, string> | string; href?: string };
|
|
|
|
|
secondaryCta?: { label?: Record<string, string> | string; href?: string };
|
2026-11-03 12:24:43 +05:30
|
|
|
variant?: string;
|
2026-11-04 18:22:18 +05:30
|
|
|
tool?: ToolItem;
|
|
|
|
|
homeApp?: any;
|
2026-11-03 12:24:43 +05:30
|
|
|
variants?: VariantSpec[];
|
|
|
|
|
locale?: string;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export function HeroSection({
|
|
|
|
|
title,
|
|
|
|
|
badge,
|
2026-11-04 18:22:18 +05:30
|
|
|
subtitle,
|
2026-11-04 15:36:30 +05:30
|
|
|
primaryCta,
|
|
|
|
|
secondaryCta,
|
2026-11-05 11:01:09 +05:30
|
|
|
variant = 'frontpage',
|
2026-11-03 12:24:43 +05:30
|
|
|
tool,
|
2026-11-05 10:26:19 +05:30
|
|
|
homeApp,
|
2026-11-03 12:24:43 +05:30
|
|
|
variants = [],
|
|
|
|
|
locale = 'en',
|
|
|
|
|
}: HeroSectionProps) {
|
2026-11-05 10:26:19 +05:30
|
|
|
const [mobileTab, setMobileTab] = useState<'upload' | 'compare'>('upload');
|
2026-11-06 10:53:55 +05:30
|
|
|
const primaryCtaLabel = resolveLocalised(primaryCta?.label, locale, 'Explore our tools');
|
2026-11-04 17:55:18 +05:30
|
|
|
const primaryCtaHref = primaryCta?.href || '#our-tools';
|
2026-11-06 10:53:55 +05:30
|
|
|
const secondaryCtaLabel = resolveLocalised(secondaryCta?.label, locale, 'Native mobile apps');
|
|
|
|
|
const secondaryCtaHref = secondaryCta?.href || '/apps';
|
2026-11-04 18:22:18 +05:30
|
|
|
|
2026-11-06 10:53:55 +05:30
|
|
|
// 1. Tool Detail Page Hero (/tools/[slug])
|
2026-11-05 11:01:09 +05:30
|
|
|
if (variant === 'toolHero' && tool) {
|
2026-11-05 10:26:19 +05:30
|
|
|
const toolMedia = (tool as any).media;
|
|
|
|
|
const primaryExample = tool.content?.examples?.[0] || {
|
|
|
|
|
before: toolMedia?.before || `/management/pages/tools/${tool.slug}/media/before.jpg`,
|
|
|
|
|
after: toolMedia?.after || `/management/pages/tools/${tool.slug}/media/after.jpg`,
|
|
|
|
|
caption: 'Sub-pixel neural transformation details',
|
|
|
|
|
};
|
|
|
|
|
|
2026-11-04 11:35:51 +05:30
|
|
|
return (
|
2026-11-06 10:53:55 +05:30
|
|
|
<section className="relative bg-paper border-b border-rule pt-8 pb-16 px-4 sm:px-6 lg:px-8">
|
|
|
|
|
<div className="max-w-container mx-auto">
|
2026-11-05 10:26:19 +05:30
|
|
|
{/* Breadcrumb Navigation */}
|
2026-11-06 10:53:55 +05:30
|
|
|
<nav className="flex items-center gap-2 text-xs font-body text-muted mb-6">
|
|
|
|
|
<Link href="/" className="hover:text-ink transition-colors">Home</Link>
|
2026-11-04 11:35:51 +05:30
|
|
|
<span>/</span>
|
2026-11-06 10:53:55 +05:30
|
|
|
<Link href="/tools" className="hover:text-ink transition-colors">Tools</Link>
|
2026-11-04 11:35:51 +05:30
|
|
|
<span>/</span>
|
2026-11-06 10:53:55 +05:30
|
|
|
<span className="text-ink font-medium">{resolveLocalised(tool.name, locale)}</span>
|
2026-11-04 11:35:51 +05:30
|
|
|
</nav>
|
|
|
|
|
|
2026-11-06 10:53:55 +05:30
|
|
|
{/* Heading Block */}
|
|
|
|
|
<div className="max-w-3xl mb-10">
|
|
|
|
|
<h1 className="text-3xl sm:text-5xl font-display font-bold text-ink tracking-tight">
|
|
|
|
|
{resolveLocalised(tool.name, locale)}
|
2026-11-04 12:00:17 +05:30
|
|
|
</h1>
|
2026-11-06 10:53:55 +05:30
|
|
|
<p className="mt-3 text-base sm:text-lg text-ink-2 font-body max-w-2xl leading-relaxed">
|
|
|
|
|
{resolveLocalised(tool.summary, locale)}
|
2026-11-04 12:00:17 +05:30
|
|
|
</p>
|
|
|
|
|
</div>
|
2026-11-05 10:26:19 +05:30
|
|
|
|
2026-11-06 10:53:55 +05:30
|
|
|
{/* Studio Workspace: Counter Layout (Upload Studio on Left, Comparison Proof on Right) */}
|
|
|
|
|
<div className="grid grid-cols-1 lg:grid-cols-12 gap-8 items-start">
|
|
|
|
|
{/* Upload Studio */}
|
|
|
|
|
<div className="lg:col-span-6 bg-paper-hi border border-rule rounded-card p-6 shadow-sheet">
|
|
|
|
|
<div className="border-b border-rule pb-3 mb-6 flex items-center justify-between">
|
|
|
|
|
<span className="studio-label">Proof studio</span>
|
|
|
|
|
<span className="text-xs text-muted font-body">Zero server retention</span>
|
|
|
|
|
</div>
|
2026-11-05 10:26:19 +05:30
|
|
|
<TryItWidget
|
|
|
|
|
tool={tool}
|
|
|
|
|
homeApp={homeApp}
|
|
|
|
|
variants={variants}
|
|
|
|
|
locale={locale}
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
|
2026-11-06 10:53:55 +05:30
|
|
|
{/* Comparison Proof Sheet */}
|
|
|
|
|
<div className="lg:col-span-6">
|
|
|
|
|
<div className="studio-sheet p-4 crop-marked">
|
|
|
|
|
<div className="mb-3 flex items-center justify-between text-xs text-muted font-body">
|
|
|
|
|
<span>Transformation specimen</span>
|
|
|
|
|
<span>Drag slider to inspect</span>
|
|
|
|
|
</div>
|
|
|
|
|
<div className="aspect-[4/3] rounded-card overflow-hidden bg-paper-2">
|
|
|
|
|
<CardBeforeAfterSlider
|
|
|
|
|
beforeUrl={primaryExample.before}
|
|
|
|
|
afterUrl={primaryExample.after}
|
|
|
|
|
title={resolveLocalised(tool.name, locale)}
|
|
|
|
|
slug={tool.slug}
|
|
|
|
|
aspectRatio="aspect-[4/3]"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
<div className="mt-3 text-xs text-muted font-body text-center">
|
|
|
|
|
Full 4K batch processing available in the {homeApp ? resolveLocalised(homeApp.name, locale) : 'mobile app'}.
|
|
|
|
|
</div>
|
2026-11-05 10:26:19 +05:30
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2026-11-04 11:35:51 +05:30
|
|
|
</div>
|
2026-11-03 12:24:43 +05:30
|
|
|
</section>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
2026-11-06 10:53:55 +05:30
|
|
|
// 2. Centered Directory Hero (for /tools, /apps, /pricing, /trust)
|
2026-11-05 11:01:09 +05:30
|
|
|
if (variant === 'centered') {
|
2026-11-06 10:53:55 +05:30
|
|
|
const resolvedTitle = resolveLocalised(title, locale) || 'Creative studio';
|
2026-11-05 11:01:09 +05:30
|
|
|
const resolvedSubtitle = resolveLocalised(subtitle, locale);
|
|
|
|
|
|
|
|
|
|
return (
|
2026-11-06 10:53:55 +05:30
|
|
|
<section className="relative pt-16 pb-14 text-center bg-paper border-b border-rule">
|
|
|
|
|
<div className="max-w-3xl mx-auto px-4 sm:px-6 lg:px-8 space-y-4">
|
|
|
|
|
<h1 className="text-3xl sm:text-5xl font-display font-bold text-ink tracking-tight">
|
2026-11-05 11:01:09 +05:30
|
|
|
{resolvedTitle}
|
|
|
|
|
</h1>
|
|
|
|
|
|
|
|
|
|
{resolvedSubtitle && (
|
2026-11-06 10:53:55 +05:30
|
|
|
<p className="text-base sm:text-lg text-ink-2 font-body max-w-xl mx-auto leading-relaxed">
|
2026-11-05 11:01:09 +05:30
|
|
|
{resolvedSubtitle}
|
|
|
|
|
</p>
|
|
|
|
|
)}
|
|
|
|
|
|
2026-11-06 10:53:55 +05:30
|
|
|
<div className="flex flex-wrap items-center justify-center gap-3 pt-2">
|
|
|
|
|
<Link href="/#our-tools" className="btn-primary">
|
|
|
|
|
Browse tools
|
2026-11-05 11:01:09 +05:30
|
|
|
</Link>
|
2026-11-06 10:53:55 +05:30
|
|
|
<Link href="/apps" className="btn-secondary">
|
|
|
|
|
Mobile apps
|
2026-11-05 11:01:09 +05:30
|
|
|
</Link>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</section>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
2026-11-06 10:53:55 +05:30
|
|
|
// 3. Homepage Hero (Narrative Workflow shape, Counter posture)
|
2026-11-03 12:24:43 +05:30
|
|
|
return (
|
2026-11-06 10:53:55 +05:30
|
|
|
<section id="hero-section" className="relative bg-paper studio-proof-grid border-b border-rule pt-12 sm:pt-16 pb-16 sm:pb-20">
|
|
|
|
|
<div className="max-w-container mx-auto px-4 sm:px-6 lg:px-8">
|
|
|
|
|
<div className="grid grid-cols-1 lg:grid-cols-12 gap-10 lg:gap-12 items-center">
|
|
|
|
|
{/* Left Column: Content & Actions (Counter Posture) */}
|
|
|
|
|
<div className="lg:col-span-6 space-y-6">
|
|
|
|
|
<div className="space-y-3">
|
|
|
|
|
<h1 className="text-4xl sm:text-5xl lg:text-6xl font-display font-bold text-ink tracking-tight leading-[1.04]">
|
|
|
|
|
Photographic tools, built with precision.
|
|
|
|
|
</h1>
|
|
|
|
|
<p className="text-base sm:text-lg text-ink-2 font-body leading-relaxed max-w-xl">
|
|
|
|
|
Retouch portraits, extract cutouts, and restore archival prints directly in your browser.
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
2026-11-03 12:24:43 +05:30
|
|
|
|
2026-11-06 10:53:55 +05:30
|
|
|
{/* Actions */}
|
|
|
|
|
<div className="flex flex-wrap items-center gap-3 pt-1">
|
|
|
|
|
<a href={primaryCtaHref} className="btn-primary">
|
|
|
|
|
<span>{primaryCtaLabel}</span>
|
|
|
|
|
<ArrowRight className="w-4 h-4" aria-hidden="true" />
|
|
|
|
|
</a>
|
2026-11-05 17:15:36 +05:30
|
|
|
|
2026-11-06 10:53:55 +05:30
|
|
|
<Link href={secondaryCtaHref} className="btn-secondary">
|
|
|
|
|
<Smartphone className="w-4 h-4 text-accent" aria-hidden="true" />
|
|
|
|
|
<span>{secondaryCtaLabel}</span>
|
|
|
|
|
</Link>
|
|
|
|
|
</div>
|
2026-11-05 11:10:39 +05:30
|
|
|
|
2026-11-06 10:53:55 +05:30
|
|
|
{/* Proof Line */}
|
|
|
|
|
<div className="pt-2 flex items-center gap-6 text-xs text-muted font-body border-t border-rule">
|
|
|
|
|
<span>Zero server image retention</span>
|
|
|
|
|
<span>Hardware-accelerated neural models</span>
|
|
|
|
|
<span>Free browser trial</span>
|
|
|
|
|
</div>
|
2026-11-04 18:37:52 +05:30
|
|
|
</div>
|
2026-11-05 11:10:39 +05:30
|
|
|
|
2026-11-06 10:53:55 +05:30
|
|
|
{/* Right Column: Lead Interactive Specimen (Crop-Marked Before/After Loupe) */}
|
|
|
|
|
<div className="lg:col-span-6">
|
|
|
|
|
<div className="studio-sheet p-4 sm:p-5 crop-marked">
|
|
|
|
|
<div className="mb-3 flex items-center justify-between text-xs text-muted font-body">
|
|
|
|
|
<span className="font-medium text-ink">Skin & blemish retoucher</span>
|
|
|
|
|
<span>Drag to inspect sub-pore restoration</span>
|
|
|
|
|
</div>
|
2026-11-05 11:10:39 +05:30
|
|
|
|
2026-11-06 10:53:55 +05:30
|
|
|
<div className="aspect-[16/10] rounded-card overflow-hidden bg-paper-2 border border-rule">
|
|
|
|
|
<CardBeforeAfterSlider
|
|
|
|
|
beforeUrl="/management/pages/home/sections/our-tools/blemish-remover/before.jpg"
|
|
|
|
|
afterUrl="/management/pages/home/sections/our-tools/blemish-remover/after.jpg"
|
|
|
|
|
title="Skin & blemish retoucher"
|
|
|
|
|
slug="blemish-remover"
|
|
|
|
|
aspectRatio="aspect-[16/10]"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
2026-11-05 11:10:39 +05:30
|
|
|
|
2026-11-06 10:53:55 +05:30
|
|
|
<div className="mt-3 flex items-center justify-between text-xs text-muted font-body">
|
|
|
|
|
<span>Natural skin pore preservation</span>
|
|
|
|
|
<Link href="/tools/blemish-remover" className="text-accent hover:underline font-medium">
|
|
|
|
|
Open full tool studio
|
|
|
|
|
</Link>
|
|
|
|
|
</div>
|
2026-11-05 11:10:39 +05:30
|
|
|
</div>
|
2026-11-04 18:37:52 +05:30
|
|
|
</div>
|
2026-11-04 17:55:18 +05:30
|
|
|
</div>
|
2026-11-03 12:24:43 +05:30
|
|
|
</div>
|
|
|
|
|
</section>
|
|
|
|
|
);
|
|
|
|
|
}
|