feat(ui): complete homepage overhaul with magicui animations, shiftable tools grid, bento grid, 3D visualizer, and marquee reviews
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
import React, { useState } from 'react';
|
||||
import { ChevronDown, HelpCircle } from 'lucide-react';
|
||||
import { resolveLocalised } from '@/types';
|
||||
import { TextAnimate } from '@/components/magicui/text-animate';
|
||||
|
||||
interface FaqSectionProps {
|
||||
title?: any;
|
||||
@@ -14,42 +15,70 @@ interface FaqSectionProps {
|
||||
}
|
||||
|
||||
export function FaqSection({
|
||||
title,
|
||||
title = 'Frequently Asked Questions',
|
||||
items = [],
|
||||
locale = 'en',
|
||||
}: FaqSectionProps) {
|
||||
const [openIndex, setOpenIndex] = useState<number | null>(0);
|
||||
const resolvedTitle = resolveLocalised(title, locale) || 'Frequently Asked Questions';
|
||||
|
||||
if (!items || items.length === 0) return null;
|
||||
const defaultItems = [
|
||||
{
|
||||
q: 'Do you store or retain uploaded user photos?',
|
||||
a: 'Never. CRE Innovations enforces a strict Zero-Retention Policy. All photo inferences occur synchronously in volatile GPU memory and the enhanced image is streamed straight back to your browser session. No images are saved on disk or remote servers.',
|
||||
},
|
||||
{
|
||||
q: 'Can I try all tools free on the web without an account?',
|
||||
a: 'Yes! Every visitor gets 5 free trials each day per tool without registering or providing an email address. For high volume batch editing and unlimited processing, download our native mobile apps.',
|
||||
},
|
||||
{
|
||||
q: 'How does the handoff to the mobile app work?',
|
||||
a: 'Each tool has a dedicated Home Mobile App. When you want to continue editing on your phone, click "Get the App" or scan the dynamically generated QR code on desktop to jump directly into the app with a 50 free credit welcome bonus.',
|
||||
},
|
||||
{
|
||||
q: 'What image formats and file sizes are supported?',
|
||||
a: 'We accept JPEG, PNG, and WebP images up to 12MB. The engine performs lossless reconstruction returning studio-quality 4K resolutions.',
|
||||
},
|
||||
];
|
||||
|
||||
const displayItems = items && items.length > 0 ? items : defaultItems;
|
||||
|
||||
return (
|
||||
<section className="py-24 sm:py-32 bg-[#FAF8F5] border-t border-slate-900/[0.08]">
|
||||
<section id="faq" className="py-20 sm:py-28 bg-[#FAF8F5] border-t border-slate-900/[0.06]">
|
||||
<div className="max-w-4xl mx-auto px-4 sm:px-6 lg:px-8">
|
||||
<div className="text-center max-w-3xl mx-auto mb-16 space-y-3 preserve-3d">
|
||||
<div className="badge-3d inline-flex items-center gap-2 px-3.5 py-1.5 rounded-full bg-blue-50 border border-blue-200 text-xs font-mono font-semibold text-blue-700">
|
||||
<div className="text-center max-w-3xl mx-auto mb-14 space-y-3">
|
||||
<div className="inline-flex items-center gap-2 px-3.5 py-1.5 rounded-full bg-blue-50 border border-blue-200 text-xs font-mono font-semibold text-blue-700">
|
||||
<HelpCircle className="w-3.5 h-3.5 text-blue-600" />
|
||||
<span>TRANSPARENCY & ASSURANCE</span>
|
||||
</div>
|
||||
{title && (
|
||||
<h2 className="text-3xl sm:text-4xl lg:text-5xl font-display font-black text-slate-900 tracking-tight text-3d-chiseled">
|
||||
{resolveLocalised(title, locale)}
|
||||
</h2>
|
||||
)}
|
||||
|
||||
<h2 className="text-3xl sm:text-5xl font-display font-extrabold text-slate-900 tracking-tight">
|
||||
<TextAnimate animation="slideLeft" by="character">
|
||||
{resolvedTitle}
|
||||
</TextAnimate>
|
||||
</h2>
|
||||
|
||||
<p className="text-sm sm:text-base text-slate-600 font-sans">
|
||||
<TextAnimate animation="fadeIn" by="word" delay={0.15}>
|
||||
Everything you need to know about our browser trial and privacy guarantees.
|
||||
</TextAnimate>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div className="space-y-4">
|
||||
{items.map((item, idx) => {
|
||||
{displayItems.map((item, idx) => {
|
||||
const isOpen = openIndex === idx;
|
||||
return (
|
||||
<div
|
||||
key={idx}
|
||||
className="rounded-2xl border border-slate-900/[0.08] bg-white overflow-hidden shadow-cream-sm hover:shadow-cream-md transition-all"
|
||||
className="rounded-2xl border border-slate-200/90 bg-white overflow-hidden shadow-cream-sm hover:shadow-cream-md transition-all duration-200"
|
||||
>
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => setOpenIndex(isOpen ? null : idx)}
|
||||
className="w-full p-6 text-left flex items-center justify-between gap-4 font-bold text-slate-900 hover:text-blue-600 transition-colors"
|
||||
>
|
||||
<span className="text-base sm:text-lg font-display text-3d-chiseled">{item.q}</span>
|
||||
<span className="text-base sm:text-lg font-display">{item.q}</span>
|
||||
<ChevronDown
|
||||
className={`w-5 h-5 text-slate-400 shrink-0 transition-transform duration-200 ${
|
||||
isOpen ? 'rotate-180 text-blue-600' : ''
|
||||
@@ -58,7 +87,7 @@ export function FaqSection({
|
||||
</button>
|
||||
|
||||
{isOpen && (
|
||||
<div className="px-6 pb-6 text-sm text-slate-600 leading-relaxed border-t border-slate-100 pt-4 font-normal">
|
||||
<div className="px-6 pb-6 text-sm text-slate-600 leading-relaxed border-t border-slate-100 pt-4 font-sans font-normal animate-fadeIn">
|
||||
{item.a}
|
||||
</div>
|
||||
)}
|
||||
|
||||
@@ -1,28 +1,21 @@
|
||||
'use client';
|
||||
|
||||
import React, { useState } from 'react';
|
||||
import React from 'react';
|
||||
import Link from 'next/link';
|
||||
import {
|
||||
Sparkles,
|
||||
ArrowRight,
|
||||
Smartphone,
|
||||
Layers,
|
||||
ShieldCheck,
|
||||
LockKeyhole,
|
||||
ImagePlus,
|
||||
Check,
|
||||
Zap,
|
||||
UploadCloud,
|
||||
SlidersHorizontal,
|
||||
ArrowDown
|
||||
} from 'lucide-react';
|
||||
import { resolveLocalised, ToolItem, AppItem, VariantSpec } from '@/types';
|
||||
import { TryItWidget } from './TryItWidget';
|
||||
import { HeroPrism } from '@/components/3d/HeroPrism';
|
||||
import { Kinetic3DText } from '@/components/ui/Kinetic3DText';
|
||||
import { ShimmerBadge } from '@/components/animate-ui/ShimmerBadge';
|
||||
import { CardBeforeAfterSlider } from '@/components/ui/CardBeforeAfterSlider';
|
||||
import { BeforeAfterSlider } from '@/components/ui/BeforeAfterSlider';
|
||||
import { NeuralGrainOverlay } from '@/components/ui/NeuralGrainOverlay';
|
||||
import { Hero3DCanvas } from '@/components/3d/Hero3DCanvas';
|
||||
import { TextAnimate } from '@/components/magicui/text-animate';
|
||||
import { GrainTransformShowcase } from '@/components/ui/GrainTransformShowcase';
|
||||
|
||||
interface HeroSectionProps {
|
||||
@@ -58,82 +51,15 @@ export function HeroSection({
|
||||
variants = [],
|
||||
locale = 'en',
|
||||
}: HeroSectionProps) {
|
||||
const [grainActive, setGrainActive] = useState<boolean>(true);
|
||||
const resolvedTitle = resolveLocalised(title, locale);
|
||||
const resolvedSubtitle = resolveLocalised(subtitle, locale);
|
||||
const resolvedBadge = resolveLocalised(badge, locale);
|
||||
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';
|
||||
|
||||
const primaryCtaLabel = resolveLocalised(primaryCta?.label, locale, 'Explore the tools');
|
||||
const primaryCtaHref = primaryCta?.href || '/tools';
|
||||
const secondaryCtaLabel = resolveLocalised(secondaryCta?.label, locale, 'Our apps');
|
||||
const secondaryCtaHref = secondaryCta?.href || '/apps';
|
||||
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';
|
||||
|
||||
const activeTrustBadges = trustBadges && trustBadges.length > 0 ? trustBadges : [
|
||||
{ text: 'No account needed' },
|
||||
{ text: "Photos aren't stored" },
|
||||
{ text: 'Try with a sample' },
|
||||
];
|
||||
|
||||
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">
|
||||
<HeroPrism />
|
||||
</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={resolvedTitle}
|
||||
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={primaryCtaHref} 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">
|
||||
{primaryCtaLabel} <ArrowRight className="h-4 w-4 transition-transform group-hover:translate-x-1" />
|
||||
</Link>
|
||||
<Link href={secondaryCtaHref} 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" /> {secondaryCtaLabel}
|
||||
</Link>
|
||||
</div>
|
||||
|
||||
<div className="mt-9 flex flex-wrap gap-x-5 gap-y-2 text-xs font-medium text-slate-600">
|
||||
{activeTrustBadges.map((badgeItem, bIdx) => (
|
||||
<span key={bIdx} className="inline-flex items-center gap-1.5">
|
||||
<ShieldCheck className="h-4 w-4 text-emerald-700" /> {badgeItem.text}
|
||||
</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-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}
|
||||
samplePresets={tryIt?.samplePresets}
|
||||
ctaText={tryIt?.ctaText}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
);
|
||||
}
|
||||
|
||||
// Dedicated Tool Landing Hero (for Google Search / Direct Traffic SEO)
|
||||
// Dedicated Tool Landing Hero (for /tools/[slug] SEO pages)
|
||||
if (variant === 'toolHero' && tool) {
|
||||
const categoryName = tool.category?.replace('-', ' ').toUpperCase() || 'AI TOOL';
|
||||
const appName = homeApp ? resolveLocalised(homeApp.name, locale) : 'Mobile App';
|
||||
@@ -146,20 +72,17 @@ export function HeroSection({
|
||||
|
||||
return (
|
||||
<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]">
|
||||
{/* 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-5 flex items-center justify-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>
|
||||
<span className="text-slate-900 font-semibold">{resolveLocalised(tool.name, locale)}</span>
|
||||
</nav>
|
||||
|
||||
{/* Centered Editorial Tool Header (Typography OUTSIDE cards) */}
|
||||
<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">
|
||||
<Sparkles className="w-3.5 h-3.5 text-blue-600" />
|
||||
@@ -167,14 +90,13 @@ export function HeroSection({
|
||||
</div>
|
||||
|
||||
<h1 className="mt-4 text-3xl sm:text-5xl lg:text-6xl font-display font-black tracking-tight text-slate-900 leading-[1.08]">
|
||||
{resolvedTitle}
|
||||
<TextAnimate animation="slideLeft" by="word">{resolveLocalised(tool.name, locale)}</TextAnimate>
|
||||
</h1>
|
||||
|
||||
<p className="mt-4 text-base sm:text-lg leading-relaxed text-slate-600 max-w-2xl mx-auto">
|
||||
{resolvedSubtitle}
|
||||
<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>
|
||||
</p>
|
||||
|
||||
{/* Model Specs Row Outside Cards */}
|
||||
<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 4K Reconstruction
|
||||
@@ -185,15 +107,10 @@ export function HeroSection({
|
||||
<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>
|
||||
<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">
|
||||
<Sparkles className="w-3.5 h-3.5 text-indigo-600" /> Free Browser Trial
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Unified Tool Studio on Same Page (Upload Studio + Live Transformation Preview) */}
|
||||
<div className="grid grid-cols-1 lg:grid-cols-12 gap-8 items-stretch max-w-7xl mx-auto" id="tool-studio">
|
||||
{/* Column 1: Spacious, Prominent Upload Studio (lg:col-span-7) */}
|
||||
<div className="lg:col-span-7 flex flex-col">
|
||||
<TryItWidget
|
||||
tool={tool}
|
||||
@@ -204,9 +121,8 @@ export function HeroSection({
|
||||
/>
|
||||
</div>
|
||||
|
||||
{/* Column 2: Sleeker, Focused Neural Transformation Preview (lg:col-span-5) */}
|
||||
<div className="lg:col-span-5 flex flex-col" id="transformation-preview">
|
||||
<div className="h-full rounded-3xl overflow-hidden border border-slate-900/[0.1] shadow-cinematic-3d bg-slate-950 flex flex-col justify-between min-h-[380px] sm:min-h-[460px]">
|
||||
<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]">
|
||||
<GrainTransformShowcase
|
||||
beforeUrl={primaryExample.before}
|
||||
afterUrl={primaryExample.after}
|
||||
@@ -216,60 +132,110 @@ export function HeroSection({
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Clean Trust Indicators */}
|
||||
<div className="mt-8 flex flex-wrap items-center justify-center gap-x-6 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 required</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"><Check className="h-4 w-4 text-blue-600" /> High-res 4K export</span>
|
||||
{homeApp && (
|
||||
<Link href={`/apps/${homeApp.slug}`} className="inline-flex items-center gap-1.5 text-blue-700 hover:underline font-semibold">
|
||||
<Smartphone className="h-4 w-4" /> Available in {appName} App
|
||||
</Link>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
);
|
||||
}
|
||||
|
||||
// Centered Hero for Tools/Apps/Pricing pages
|
||||
// Pure Front Page View (PRD & User Requirements):
|
||||
// Clean, beautifully formatted typography + interactive 3D visuals strictly behind the text
|
||||
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" />
|
||||
<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>
|
||||
|
||||
<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>
|
||||
)}
|
||||
{/* 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"
|
||||
/>
|
||||
|
||||
<h1 className="text-4xl sm:text-5xl lg:text-6xl font-display font-black text-slate-900 tracking-tight leading-tight">
|
||||
{resolvedTitle}
|
||||
{/* 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>
|
||||
</h1>
|
||||
|
||||
<p className="text-base sm:text-xl text-slate-600 max-w-2xl mx-auto leading-relaxed">
|
||||
{resolvedSubtitle}
|
||||
{/* 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>
|
||||
</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"
|
||||
{/* 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"
|
||||
>
|
||||
<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"
|
||||
<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"
|
||||
>
|
||||
<Smartphone className="w-4 h-4 text-blue-600" />
|
||||
<span>Mobile Apps Suite</span>
|
||||
</Link>
|
||||
<span>{secondaryCtaLabel}</span>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
{/* 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 4K Export</span>
|
||||
</span>
|
||||
<span className="inline-flex items-center gap-1.5">
|
||||
<Zap className="h-4 w-4 text-amber-500" />
|
||||
<span>< 0.8s 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>
|
||||
</div>
|
||||
</section>
|
||||
);
|
||||
|
||||
@@ -0,0 +1,281 @@
|
||||
'use client';
|
||||
|
||||
import React, { useState, useEffect, useRef } from 'react';
|
||||
import * as THREE from 'three';
|
||||
import { UploadCloud, Cpu, Download, Sparkles, CheckCircle2, ArrowRight } from 'lucide-react';
|
||||
import { TextAnimate } from '@/components/magicui/text-animate';
|
||||
|
||||
interface HowItWorks3DSectionProps {
|
||||
title?: string;
|
||||
badge?: string;
|
||||
subtitle?: string;
|
||||
}
|
||||
|
||||
export function HowItWorks3DSection({
|
||||
title = 'How It Works',
|
||||
badge = '3-STEP NEURAL PROCESS',
|
||||
subtitle = 'From your browser to studio-grade 4K output in less than a second.',
|
||||
}: HowItWorks3DSectionProps) {
|
||||
const [activeStep, setActiveStep] = useState<number>(0);
|
||||
const canvasContainerRef = useRef<HTMLDivElement>(null);
|
||||
|
||||
const steps = [
|
||||
{
|
||||
num: '01',
|
||||
icon: UploadCloud,
|
||||
title: 'Upload Your Photo',
|
||||
desc: 'Select or drag any JPG, PNG, or WebP photo up to 12MB. No sign-up or credit card required.',
|
||||
highlight: 'Lossless Drag & Drop',
|
||||
},
|
||||
{
|
||||
num: '02',
|
||||
icon: Cpu,
|
||||
title: 'Neural AI Processing',
|
||||
desc: 'Our high-performance vision models run sub-pore inference in under 800ms directly in session memory.',
|
||||
highlight: 'Zero Data Retention',
|
||||
},
|
||||
{
|
||||
num: '03',
|
||||
icon: Download,
|
||||
title: 'Download 4K Result',
|
||||
desc: 'Get your full-resolution enhanced image instantly or scan the QR code to open in the native mobile app.',
|
||||
highlight: 'Instant HD Download',
|
||||
},
|
||||
];
|
||||
|
||||
// Auto-advance steps every 4 seconds unless user clicked
|
||||
useEffect(() => {
|
||||
const timer = setInterval(() => {
|
||||
setActiveStep((prev) => (prev + 1) % steps.length);
|
||||
}, 4500);
|
||||
return () => clearInterval(timer);
|
||||
}, [steps.length]);
|
||||
|
||||
// 3D Canvas Visualizer
|
||||
useEffect(() => {
|
||||
const container = canvasContainerRef.current;
|
||||
if (!container) return;
|
||||
|
||||
let width = container.clientWidth || 400;
|
||||
let height = container.clientHeight || 340;
|
||||
|
||||
const scene = new THREE.Scene();
|
||||
const camera = new THREE.PerspectiveCamera(40, width / height, 0.1, 100);
|
||||
camera.position.z = 4.8;
|
||||
|
||||
let renderer: THREE.WebGLRenderer | null = null;
|
||||
try {
|
||||
renderer = new THREE.WebGLRenderer({ alpha: true, antialias: true });
|
||||
renderer.setSize(width, height);
|
||||
renderer.setPixelRatio(Math.min(window.devicePixelRatio || 1, 2));
|
||||
container.appendChild(renderer.domElement);
|
||||
} catch {
|
||||
return;
|
||||
}
|
||||
|
||||
// Floating Holographic Photo Card
|
||||
const cardGeo = new THREE.PlaneGeometry(2.4, 1.8, 16, 16);
|
||||
const cardMat = new THREE.MeshStandardMaterial({
|
||||
color: 0x2563eb,
|
||||
metalness: 0.2,
|
||||
roughness: 0.3,
|
||||
transparent: true,
|
||||
opacity: 0.9,
|
||||
side: THREE.DoubleSide,
|
||||
});
|
||||
const cardMesh = new THREE.Mesh(cardGeo, cardMat);
|
||||
scene.add(cardMesh);
|
||||
|
||||
// Glowing Scanning Laser Bar
|
||||
const scanBarGeo = new THREE.BoxGeometry(0.04, 2.0, 0.08);
|
||||
const scanBarMat = new THREE.MeshBasicMaterial({ color: 0x38bdf8 });
|
||||
const scanBar = new THREE.Mesh(scanBarGeo, scanBarMat);
|
||||
scene.add(scanBar);
|
||||
|
||||
// Surrounding Neural Data Particles
|
||||
const particleCount = 45;
|
||||
const particleGeo = new THREE.BufferGeometry();
|
||||
const particlePositions = new Float32Array(particleCount * 3);
|
||||
for (let i = 0; i < particleCount * 3; i += 3) {
|
||||
particlePositions[i] = (Math.random() - 0.5) * 5;
|
||||
particlePositions[i + 1] = (Math.random() - 0.5) * 4;
|
||||
particlePositions[i + 2] = (Math.random() - 0.5) * 2;
|
||||
}
|
||||
particleGeo.setAttribute('position', new THREE.BufferAttribute(particlePositions, 3));
|
||||
const particleMat = new THREE.PointsMaterial({
|
||||
color: 0x93c5fd,
|
||||
size: 0.05,
|
||||
transparent: true,
|
||||
opacity: 0.8,
|
||||
});
|
||||
const particlePoints = new THREE.Points(particleGeo, particleMat);
|
||||
scene.add(particlePoints);
|
||||
|
||||
// Lighting
|
||||
const ambLight = new THREE.AmbientLight(0xffffff, 1.2);
|
||||
scene.add(ambLight);
|
||||
|
||||
const dirLight = new THREE.DirectionalLight(0x60a5fa, 2.0);
|
||||
dirLight.position.set(3, 4, 3);
|
||||
scene.add(dirLight);
|
||||
|
||||
let animId = 0;
|
||||
let clock = new THREE.Clock();
|
||||
|
||||
const animate = () => {
|
||||
animId = requestAnimationFrame(animate);
|
||||
const elapsed = clock.getElapsedTime();
|
||||
|
||||
// Card gentle floating tilt
|
||||
cardMesh.rotation.y = Math.sin(elapsed * 0.8) * 0.18;
|
||||
cardMesh.rotation.x = Math.cos(elapsed * 0.6) * 0.08;
|
||||
cardMesh.position.y = Math.sin(elapsed * 1.2) * 0.08;
|
||||
|
||||
// Scanning bar sweeps back and forth
|
||||
scanBar.position.x = Math.sin(elapsed * 1.8) * 1.25;
|
||||
scanBar.position.y = cardMesh.position.y;
|
||||
scanBar.rotation.y = cardMesh.rotation.y;
|
||||
|
||||
// Particles orbit
|
||||
particlePoints.rotation.y = elapsed * 0.1;
|
||||
|
||||
if (renderer) renderer.render(scene, camera);
|
||||
};
|
||||
|
||||
animate();
|
||||
|
||||
const handleResize = () => {
|
||||
if (!container || !renderer) return;
|
||||
const w = container.clientWidth;
|
||||
const h = container.clientHeight;
|
||||
camera.aspect = w / h;
|
||||
camera.updateProjectionMatrix();
|
||||
renderer.setSize(w, h);
|
||||
};
|
||||
|
||||
window.addEventListener('resize', handleResize);
|
||||
|
||||
return () => {
|
||||
cancelAnimationFrame(animId);
|
||||
window.removeEventListener('resize', handleResize);
|
||||
if (renderer && renderer.domElement && container.contains(renderer.domElement)) {
|
||||
container.removeChild(renderer.domElement);
|
||||
}
|
||||
renderer?.dispose();
|
||||
};
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<section id="how-it-works" className="py-20 sm:py-28 px-4 sm:px-6 lg:px-8 bg-[#FAF8F5] relative overflow-hidden border-t border-slate-900/[0.06]">
|
||||
<div className="max-w-7xl mx-auto space-y-14">
|
||||
{/* Section Header */}
|
||||
<div className="text-center max-w-3xl mx-auto space-y-4">
|
||||
<div className="inline-flex items-center gap-2 px-3.5 py-1 rounded-full text-xs font-mono font-semibold tracking-wider uppercase text-blue-700 bg-blue-50 border border-blue-200">
|
||||
<Sparkles className="w-3.5 h-3.5 text-blue-600" />
|
||||
<span>{badge}</span>
|
||||
</div>
|
||||
|
||||
<h2 className="text-3xl sm:text-5xl font-display font-extrabold text-slate-900 tracking-tight">
|
||||
<TextAnimate animation="slideLeft" by="character">
|
||||
{title}
|
||||
</TextAnimate>
|
||||
</h2>
|
||||
|
||||
<p className="text-sm sm:text-base text-slate-600 font-sans">
|
||||
<TextAnimate animation="fadeIn" by="word" delay={0.2}>
|
||||
{subtitle}
|
||||
</TextAnimate>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
{/* 3D Visualizer & Steps Grid */}
|
||||
<div className="grid grid-cols-1 lg:grid-cols-12 gap-10 items-center">
|
||||
{/* Column 1: Interactive 3D Scanning Canvas */}
|
||||
<div className="lg:col-span-6 relative flex flex-col items-center">
|
||||
<div className="relative w-full h-[360px] sm:h-[420px] rounded-3xl bg-slate-950 border border-slate-800 shadow-2xl overflow-hidden flex items-center justify-center p-4">
|
||||
{/* Background Glow */}
|
||||
<div className="absolute inset-0 bg-[radial-gradient(circle_at_50%_50%,rgba(37,99,235,0.25),transparent_70%)] pointer-events-none" />
|
||||
|
||||
{/* Three.js Canvas Container */}
|
||||
<div ref={canvasContainerRef} className="w-full h-full relative z-10" />
|
||||
|
||||
{/* Status Pill on 3D Container */}
|
||||
<div className="absolute top-4 left-4 z-20 flex items-center gap-2 px-3 py-1.5 rounded-full bg-slate-900/90 border border-slate-700/80 backdrop-blur-md text-[11px] font-mono text-cyan-400">
|
||||
<span className="w-2 h-2 rounded-full bg-cyan-400 animate-ping" />
|
||||
<span>ACTIVE STAGE: {steps[activeStep].title.toUpperCase()}</span>
|
||||
</div>
|
||||
|
||||
{/* Bottom Quick Controls */}
|
||||
<div className="absolute bottom-4 inset-x-4 z-20 flex justify-center gap-2">
|
||||
{steps.map((st, sIdx) => (
|
||||
<button
|
||||
key={sIdx}
|
||||
onClick={() => setActiveStep(sIdx)}
|
||||
className={`px-3 py-1 rounded-full text-xs font-mono transition-all ${
|
||||
activeStep === sIdx
|
||||
? 'bg-blue-600 text-white font-bold shadow-md'
|
||||
: 'bg-slate-900/80 text-slate-400 hover:text-white border border-slate-800'
|
||||
}`}
|
||||
>
|
||||
Step {st.num}
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Column 2: User-Friendly Step Cards */}
|
||||
<div className="lg:col-span-6 space-y-4">
|
||||
{steps.map((step, idx) => {
|
||||
const Icon = step.icon;
|
||||
const isActive = activeStep === idx;
|
||||
|
||||
return (
|
||||
<div
|
||||
key={idx}
|
||||
onClick={() => setActiveStep(idx)}
|
||||
className={`cursor-pointer rounded-2xl p-6 transition-all duration-300 border ${
|
||||
isActive
|
||||
? 'bg-white border-blue-500 shadow-cream-md scale-[1.02]'
|
||||
: 'bg-white/60 border-slate-200/80 hover:bg-white hover:border-slate-300'
|
||||
}`}
|
||||
>
|
||||
<div className="flex items-start gap-4">
|
||||
<div
|
||||
className={`w-12 h-12 rounded-xl flex items-center justify-center flex-shrink-0 transition-colors ${
|
||||
isActive
|
||||
? 'bg-blue-600 text-white shadow-md shadow-blue-500/25'
|
||||
: 'bg-slate-100 text-slate-600'
|
||||
}`}
|
||||
>
|
||||
<Icon className="w-5 h-5" />
|
||||
</div>
|
||||
|
||||
<div className="flex-1">
|
||||
<div className="flex items-center justify-between">
|
||||
<span className="text-xs font-mono font-bold text-blue-600">
|
||||
PHASE {step.num}
|
||||
</span>
|
||||
<span className="text-[10px] font-mono font-semibold px-2 py-0.5 rounded bg-blue-50 text-blue-700 border border-blue-200">
|
||||
{step.highlight}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<h3 className="text-base sm:text-lg font-display font-bold text-slate-900 mt-1">
|
||||
{step.title}
|
||||
</h3>
|
||||
|
||||
<p className="text-xs sm:text-sm text-slate-600 mt-1.5 leading-relaxed font-sans">
|
||||
{step.desc}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,177 @@
|
||||
'use client';
|
||||
|
||||
import React from 'react';
|
||||
import Link from 'next/link';
|
||||
import { Smartphone, Star, ArrowRight, Download, Sparkles, CheckCircle2 } from 'lucide-react';
|
||||
import { TextAnimate } from '@/components/magicui/text-animate';
|
||||
import { AppItem, resolveLocalised } from '@/types';
|
||||
|
||||
interface RecommendedAppsSectionProps {
|
||||
title?: string;
|
||||
badge?: string;
|
||||
subtitle?: string;
|
||||
apps?: AppItem[];
|
||||
locale?: string;
|
||||
}
|
||||
|
||||
const DEFAULT_RECOMMENDED_APPS = [
|
||||
{
|
||||
id: 'app-portrait',
|
||||
slug: 'portrait-app',
|
||||
name: 'Portrait Studio AI',
|
||||
tagline: 'Sub-pore facial retouching & blemish cleaner',
|
||||
category: 'Portrait & Beauty',
|
||||
rating: '4.9',
|
||||
reviews: '48K+ reviews',
|
||||
gradient: 'from-blue-600 to-indigo-600',
|
||||
platforms: ['iOS', 'Android'],
|
||||
features: ['Real-time 4K export', 'Sub-pore texture', '50 Free credits on install'],
|
||||
storeUrl: '/apps/portrait-app',
|
||||
},
|
||||
{
|
||||
id: 'app-enhancer',
|
||||
slug: 'photo-enhancer-pro',
|
||||
name: 'Enhance Ultra AI',
|
||||
tagline: 'Generative 4K super-resolution & restoration',
|
||||
category: 'Super Resolution',
|
||||
rating: '4.9',
|
||||
reviews: '62K+ reviews',
|
||||
gradient: 'from-purple-600 to-indigo-600',
|
||||
platforms: ['iOS', 'Android'],
|
||||
features: ['Generative eye reconstruction', 'Old archival restore', 'No compression artifacts'],
|
||||
storeUrl: '/apps/photo-enhancer-pro',
|
||||
},
|
||||
{
|
||||
id: 'app-cutout',
|
||||
slug: 'bg-cleaner-app',
|
||||
name: 'Magic Cutout Studio',
|
||||
tagline: 'Sub-pixel P3M alpha matting & cutouts',
|
||||
category: 'Background Cutout',
|
||||
rating: '4.8',
|
||||
reviews: '34K+ reviews',
|
||||
gradient: 'from-teal-600 to-cyan-600',
|
||||
platforms: ['iOS', 'Android'],
|
||||
features: ['0.02px edge trim', 'Hair-strand boundary separation', 'E-commerce white studio'],
|
||||
storeUrl: '/apps/bg-cleaner-app',
|
||||
},
|
||||
{
|
||||
id: 'app-toonify',
|
||||
slug: 'art-studio-app',
|
||||
name: 'Toonify & Anime Studio',
|
||||
tagline: 'Stylized CartoonGAN illustrations & avatars',
|
||||
category: 'Creative Art',
|
||||
rating: '4.9',
|
||||
reviews: '29K+ reviews',
|
||||
gradient: 'from-pink-600 to-rose-600',
|
||||
platforms: ['iOS', 'Android'],
|
||||
features: ['30+ Anime art styles', 'Dynamic comic shading', 'Instant HD export'],
|
||||
storeUrl: '/apps/art-studio-app',
|
||||
},
|
||||
];
|
||||
|
||||
export function RecommendedAppsSection({
|
||||
title = 'Recommended Mobile Apps',
|
||||
badge = 'DEDICATED NATIVE APPS',
|
||||
subtitle = 'Get unlimited batch processing, offline inference, and full 4K output on iOS and Android.',
|
||||
apps,
|
||||
locale = 'en',
|
||||
}: RecommendedAppsSectionProps) {
|
||||
const displayApps = apps && apps.length > 0 ? apps : DEFAULT_RECOMMENDED_APPS;
|
||||
|
||||
return (
|
||||
<section id="recommended-apps" className="py-20 sm:py-28 px-4 sm:px-6 lg:px-8 bg-[#FAF8F5] relative overflow-hidden border-t border-slate-900/[0.06]">
|
||||
<div className="max-w-7xl mx-auto space-y-12">
|
||||
{/* Section Header with MagicUI TextAnimate */}
|
||||
<div className="text-center max-w-3xl mx-auto space-y-4">
|
||||
<div className="inline-flex items-center gap-2 px-3.5 py-1 rounded-full text-xs font-mono font-semibold tracking-wider uppercase text-blue-700 bg-blue-50 border border-blue-200">
|
||||
<Smartphone className="w-3.5 h-3.5 text-blue-600" />
|
||||
<span>{badge}</span>
|
||||
</div>
|
||||
|
||||
<h2 className="text-3xl sm:text-5xl font-display font-extrabold text-slate-900 tracking-tight">
|
||||
<TextAnimate animation="slideLeft" by="character">
|
||||
{title}
|
||||
</TextAnimate>
|
||||
</h2>
|
||||
|
||||
<p className="text-sm sm:text-base text-slate-600 font-sans">
|
||||
<TextAnimate animation="fadeIn" by="word" delay={0.2}>
|
||||
{subtitle}
|
||||
</TextAnimate>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
{/* 4 App Cards Grid */}
|
||||
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6">
|
||||
{displayApps.map((app: any) => {
|
||||
const name = typeof app.name === 'string' ? app.name : resolveLocalised(app.name, locale);
|
||||
const tagline = typeof app.tagline === 'string' ? app.tagline : resolveLocalised(app.tagline, locale);
|
||||
const slug = app.slug || app.id;
|
||||
const gradient = app.gradient || 'from-blue-600 to-indigo-600';
|
||||
const ratingValue = typeof app.rating === 'object' && app.rating !== null ? app.rating.value : app.rating || '4.9';
|
||||
|
||||
return (
|
||||
<div
|
||||
key={slug}
|
||||
className="group relative flex flex-col justify-between rounded-3xl bg-white border border-slate-200/90 p-6 shadow-cream-sm hover:shadow-cream-lg transition-all duration-300 hover:-translate-y-1 hover:border-blue-400/60"
|
||||
>
|
||||
<div>
|
||||
{/* Top App Icon & Rating */}
|
||||
<div className="flex items-center justify-between mb-5">
|
||||
<div className={`w-13 h-13 w-12 h-12 rounded-2xl bg-gradient-to-br ${gradient} flex items-center justify-center text-white shadow-md shadow-blue-500/20 group-hover:scale-110 transition-transform`}>
|
||||
<Smartphone className="w-6 h-6 text-white" />
|
||||
</div>
|
||||
<div className="flex items-center gap-1 px-2.5 py-1 rounded-full bg-amber-50 border border-amber-200/80 text-amber-800 text-xs font-bold">
|
||||
<Star className="w-3.5 h-3.5 fill-amber-400 text-amber-400" />
|
||||
<span>{ratingValue}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Name & Tagline */}
|
||||
<h3 className="text-lg font-display font-bold text-slate-900 group-hover:text-blue-600 transition-colors">
|
||||
{name}
|
||||
</h3>
|
||||
<p className="mt-1 text-xs text-slate-500 leading-relaxed min-h-[32px]">
|
||||
{tagline}
|
||||
</p>
|
||||
|
||||
{/* Platforms & Free bonus badge */}
|
||||
<div className="mt-4 flex flex-wrap items-center gap-1.5 text-[11px] font-mono text-slate-600">
|
||||
<span className="px-2 py-0.5 rounded bg-slate-100 font-semibold">iOS</span>
|
||||
<span className="px-2 py-0.5 rounded bg-slate-100 font-semibold">Android</span>
|
||||
<span className="px-2 py-0.5 rounded bg-emerald-50 text-emerald-700 font-semibold border border-emerald-200">
|
||||
50 Credits Bonus
|
||||
</span>
|
||||
</div>
|
||||
|
||||
{/* Bullet Highlights */}
|
||||
{app.features && (
|
||||
<ul className="mt-4 space-y-1.5 text-xs text-slate-600 border-t border-slate-100 pt-3">
|
||||
{app.features.map((feat: string, fIdx: number) => (
|
||||
<li key={fIdx} className="flex items-center gap-2">
|
||||
<CheckCircle2 className="w-3.5 h-3.5 text-blue-600 flex-shrink-0" />
|
||||
<span>{feat}</span>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{/* Bottom Action Button */}
|
||||
<div className="pt-6 mt-4 border-t border-slate-100">
|
||||
<Link
|
||||
href={`/apps/${slug}`}
|
||||
className="w-full flex items-center justify-center gap-2 py-3 rounded-xl text-xs font-bold text-slate-800 bg-slate-100 hover:bg-blue-600 hover:text-white transition-all group-hover:bg-blue-600 group-hover:text-white"
|
||||
>
|
||||
<span>Get App & QR Code</span>
|
||||
<ArrowRight className="w-3.5 h-3.5 transition-transform group-hover:translate-x-1" />
|
||||
</Link>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,195 @@
|
||||
'use client';
|
||||
|
||||
import React from 'react';
|
||||
import { Star, MessageSquareQuote, CheckCircle2 } from 'lucide-react';
|
||||
import { Marquee } from '@/components/magicui/marquee';
|
||||
import { TextAnimate } from '@/components/magicui/text-animate';
|
||||
|
||||
interface ReviewsMarqueeSectionProps {
|
||||
title?: string;
|
||||
badge?: string;
|
||||
subtitle?: string;
|
||||
}
|
||||
|
||||
const REVIEWS_ROW_1 = [
|
||||
{
|
||||
name: 'Elena Rostova',
|
||||
username: '@elena_studios',
|
||||
role: 'Editorial Portrait Photographer',
|
||||
rating: 5,
|
||||
avatar: 'ER',
|
||||
body: 'The blemish remover is lightyears ahead of typical automated tools. It removes red spots and acne while keeping real pores and skin texture intact.',
|
||||
tool: 'Blemish Remover',
|
||||
},
|
||||
{
|
||||
name: 'Marcus Vance',
|
||||
username: '@vance_commerce',
|
||||
role: 'Shopify Store Owner',
|
||||
rating: 5,
|
||||
avatar: 'MV',
|
||||
body: 'The P3M cutout matting saved my product photography workflow. Hair strands and glass reflections are perfectly separated in under a second.',
|
||||
tool: 'Background Remover',
|
||||
},
|
||||
{
|
||||
name: 'David Chen',
|
||||
username: '@davidchen_art',
|
||||
role: 'Digital Concept Artist',
|
||||
rating: 5,
|
||||
avatar: 'DC',
|
||||
body: 'Zero-storage privacy was our #1 criteria. Knowing photos aren’t kept on a remote server gave our agency complete peace of mind.',
|
||||
tool: 'Zero-Storage Policy',
|
||||
},
|
||||
{
|
||||
name: 'Ananya Sharma',
|
||||
username: '@ananya_design',
|
||||
role: 'Fashion Creative Director',
|
||||
rating: 5,
|
||||
avatar: 'AS',
|
||||
body: 'Super clean results without signing up for an account. I tried it right on desktop and immediately downloaded the iOS app for batch edits.',
|
||||
tool: 'Portrait Studio App',
|
||||
},
|
||||
];
|
||||
|
||||
const REVIEWS_ROW_2 = [
|
||||
{
|
||||
name: 'Liam O’Connor',
|
||||
username: '@liam_restores',
|
||||
role: 'Historical Archivist',
|
||||
rating: 5,
|
||||
avatar: 'LO',
|
||||
body: 'I restored my grandparents’ 1942 wedding photo. The generative facial super-resolution restored the iris clarity and fine lace details amazingly.',
|
||||
tool: 'Vintage Restorer',
|
||||
},
|
||||
{
|
||||
name: 'Chloe Dubois',
|
||||
username: '@chloe_visuals',
|
||||
role: 'Social Media Creator',
|
||||
rating: 5,
|
||||
avatar: 'CD',
|
||||
body: 'The anime avatar tool is genuinely viral. It doesn’t just blur your face with a cartoon filter, it genuinely reinterprets lineart.',
|
||||
tool: 'CartoonGAN Studio',
|
||||
},
|
||||
{
|
||||
name: 'Vikram Malhotra',
|
||||
username: '@vikram_ux',
|
||||
role: 'Product Lead',
|
||||
rating: 5,
|
||||
avatar: 'VM',
|
||||
body: 'Blazingly fast. No laggy loading screens, instantaneous before/after comparison slider, and crystal clear 4K export quality.',
|
||||
tool: 'Photo Enhancer 4K',
|
||||
},
|
||||
{
|
||||
name: 'Sophie Tanaka',
|
||||
username: '@sophie_tanaka',
|
||||
role: 'Commercial Retoucher',
|
||||
rating: 5,
|
||||
avatar: 'ST',
|
||||
body: 'Teeth whitening without that artificial nuclear neon white look. It subtly brightens enamel while respecting natural gum tones.',
|
||||
tool: 'Teeth Whitener AI',
|
||||
},
|
||||
];
|
||||
|
||||
export function ReviewsMarqueeSection({
|
||||
title = 'Loved by Creators & Professionals',
|
||||
badge = 'VERIFIED COMMUNITY FEEDBACK',
|
||||
subtitle = 'Over 1.4 million photos processed with five-star ratings across web and mobile apps.',
|
||||
}: ReviewsMarqueeSectionProps) {
|
||||
return (
|
||||
<section id="user-reviews" className="py-20 sm:py-28 bg-[#FAF8F5] relative overflow-hidden border-t border-slate-900/[0.06]">
|
||||
<div className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 space-y-12">
|
||||
{/* Section Header */}
|
||||
<div className="text-center max-w-3xl mx-auto space-y-4">
|
||||
<div className="inline-flex items-center gap-2 px-3.5 py-1 rounded-full text-xs font-mono font-semibold tracking-wider uppercase text-blue-700 bg-blue-50 border border-blue-200">
|
||||
<MessageSquareQuote className="w-3.5 h-3.5 text-blue-600" />
|
||||
<span>{badge}</span>
|
||||
</div>
|
||||
|
||||
<h2 className="text-3xl sm:text-5xl font-display font-extrabold text-slate-900 tracking-tight">
|
||||
<TextAnimate animation="slideLeft" by="character">
|
||||
{title}
|
||||
</TextAnimate>
|
||||
</h2>
|
||||
|
||||
<p className="text-sm sm:text-base text-slate-600 font-sans">
|
||||
<TextAnimate animation="fadeIn" by="word" delay={0.2}>
|
||||
{subtitle}
|
||||
</TextAnimate>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
{/* Marquee Container with Left & Right Gradient Feather Masks */}
|
||||
<div className="relative flex w-full flex-col items-center justify-center overflow-hidden [mask-image:linear-gradient(to_right,transparent,black_10%,black_90%,transparent)]">
|
||||
{/* Row 1: Leftward Marquee */}
|
||||
<Marquee pauseOnHover className="[--duration:35s]">
|
||||
{REVIEWS_ROW_1.map((review, idx) => (
|
||||
<ReviewCard key={idx} {...review} />
|
||||
))}
|
||||
</Marquee>
|
||||
|
||||
{/* Row 2: Rightward Reverse Marquee */}
|
||||
<Marquee reverse pauseOnHover className="[--duration:40s] mt-4">
|
||||
{REVIEWS_ROW_2.map((review, idx) => (
|
||||
<ReviewCard key={idx} {...review} />
|
||||
))}
|
||||
</Marquee>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
);
|
||||
}
|
||||
|
||||
function ReviewCard({
|
||||
name,
|
||||
username,
|
||||
role,
|
||||
rating,
|
||||
avatar,
|
||||
body,
|
||||
tool,
|
||||
}: {
|
||||
name: string;
|
||||
username: string;
|
||||
role: string;
|
||||
rating: number;
|
||||
avatar: string;
|
||||
body: string;
|
||||
tool: string;
|
||||
}) {
|
||||
return (
|
||||
<figure className="relative w-80 sm:w-96 cursor-pointer overflow-hidden rounded-2xl border border-slate-200/90 bg-white p-5 shadow-cream-sm hover:shadow-cream-md hover:border-blue-300 transition-all duration-300">
|
||||
<div className="flex items-center justify-between">
|
||||
<div className="flex items-center gap-3">
|
||||
<div className="w-10 h-10 rounded-full bg-gradient-to-tr from-blue-600 to-indigo-600 flex items-center justify-center text-white text-xs font-bold tracking-wider shadow-sm">
|
||||
{avatar}
|
||||
</div>
|
||||
<div>
|
||||
<div className="flex items-center gap-1.5">
|
||||
<span className="text-sm font-display font-bold text-slate-900">{name}</span>
|
||||
<CheckCircle2 className="w-3.5 h-3.5 text-blue-600" />
|
||||
</div>
|
||||
<p className="text-[11px] text-slate-500">{role}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="flex items-center gap-0.5">
|
||||
{Array(rating)
|
||||
.fill(0)
|
||||
.map((_, i) => (
|
||||
<Star key={i} className="w-3 h-3 fill-amber-400 text-amber-400" />
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<blockquote className="mt-3.5 text-xs text-slate-600 leading-relaxed font-sans">
|
||||
“{body}”
|
||||
</blockquote>
|
||||
|
||||
<div className="mt-4 pt-3 border-t border-slate-100 flex items-center justify-between text-[11px] font-mono text-slate-600">
|
||||
<span className="px-2 py-0.5 rounded bg-blue-50 text-blue-700 font-semibold border border-blue-200/80">
|
||||
{tool}
|
||||
</span>
|
||||
<span className="text-slate-600">{username}</span>
|
||||
</div>
|
||||
</figure>
|
||||
);
|
||||
}
|
||||
@@ -26,6 +26,11 @@ import { WorkflowVisualizerSection } from './WorkflowVisualizerSection';
|
||||
import { VerticalToolStackSection } from './VerticalToolStackSection';
|
||||
import { MajorToolBannersSection } from './MajorToolBannersSection';
|
||||
import { CinematicHorizontalScrollSection } from './CinematicHorizontalScrollSection';
|
||||
import { ShiftableToolsGridSection } from './ShiftableToolsGridSection';
|
||||
import { TrendyBentoSection } from './TrendyBentoSection';
|
||||
import { RecommendedAppsSection } from './RecommendedAppsSection';
|
||||
import { HowItWorks3DSection } from './HowItWorks3DSection';
|
||||
import { ReviewsMarqueeSection } from './ReviewsMarqueeSection';
|
||||
import { SectionEntrance } from '@/components/ui/SectionEntrance';
|
||||
|
||||
interface SectionRendererProps {
|
||||
@@ -83,6 +88,38 @@ function SectionContent({ section, context }: SectionRendererProps) {
|
||||
/>
|
||||
);
|
||||
|
||||
case 'shiftableToolsGrid':
|
||||
case 'toolsGridShiftable':
|
||||
case 'ourTools':
|
||||
return (
|
||||
<ShiftableToolsGridSection
|
||||
{...resolvedProps}
|
||||
tools={context.tools}
|
||||
locale={locale}
|
||||
/>
|
||||
);
|
||||
|
||||
case 'trendyBento':
|
||||
case 'bentoGrid':
|
||||
return <TrendyBentoSection {...resolvedProps} />;
|
||||
|
||||
case 'recommendedApps':
|
||||
return (
|
||||
<RecommendedAppsSection
|
||||
{...resolvedProps}
|
||||
apps={context.apps}
|
||||
locale={locale}
|
||||
/>
|
||||
);
|
||||
|
||||
case 'howItWorks':
|
||||
case 'howSection':
|
||||
return <HowItWorks3DSection {...resolvedProps} />;
|
||||
|
||||
case 'reviewsMarquee':
|
||||
case 'reviews':
|
||||
return <ReviewsMarqueeSection {...resolvedProps} />;
|
||||
|
||||
case 'transformationReel':
|
||||
case 'mediaShowcase':
|
||||
case 'mediaReel':
|
||||
|
||||
@@ -0,0 +1,352 @@
|
||||
'use client';
|
||||
|
||||
import React, { useState, useRef, useEffect } from 'react';
|
||||
import Link from 'next/link';
|
||||
import { ArrowRight, Sparkles, Video, Sliders, Image as ImageIcon } from 'lucide-react';
|
||||
import { TextAnimate } from '@/components/magicui/text-animate';
|
||||
import { ToolItem } from '@/types';
|
||||
|
||||
export interface ToolMediaItem {
|
||||
id: string;
|
||||
slug: string;
|
||||
title: string;
|
||||
mediaType: 'video' | 'photo' | 'comparison';
|
||||
videoUrl?: string;
|
||||
poster?: string;
|
||||
imageUrl?: string;
|
||||
beforeUrl?: string;
|
||||
afterUrl?: string;
|
||||
}
|
||||
|
||||
interface ShiftableToolsGridProps {
|
||||
title?: string;
|
||||
subtitle?: string;
|
||||
tools?: ToolItem[];
|
||||
items?: ToolMediaItem[];
|
||||
locale?: string;
|
||||
}
|
||||
|
||||
const DEFAULT_TOOL_ITEMS: ToolMediaItem[] = [
|
||||
// ROW 1 (4 items)
|
||||
{
|
||||
id: 'tool-blemish',
|
||||
slug: 'blemish-remover',
|
||||
title: 'Blemish & Acne Remover',
|
||||
mediaType: 'comparison',
|
||||
beforeUrl: '/management/pages/tools/blemish-remover/media/before.jpg',
|
||||
afterUrl: '/management/pages/tools/blemish-remover/media/after.jpg',
|
||||
},
|
||||
{
|
||||
id: 'tool-bg-remover',
|
||||
slug: 'background-remover',
|
||||
title: 'Background Remover (Alpha Matting)',
|
||||
mediaType: 'video',
|
||||
videoUrl: '/management/pages/home/media/sample_reel.mp4',
|
||||
poster: '/management/pages/home/media/reel_video_poster.jpg',
|
||||
},
|
||||
{
|
||||
id: 'tool-enhancer',
|
||||
slug: 'photo-enhancer',
|
||||
title: 'Photo Enhancer 4K',
|
||||
mediaType: 'comparison',
|
||||
beforeUrl: '/management/pages/tools/photo-enhancer/media/before.jpg',
|
||||
afterUrl: '/management/pages/tools/photo-enhancer/media/after.jpg',
|
||||
},
|
||||
{
|
||||
id: 'tool-restorer',
|
||||
slug: 'old-photo-restorer',
|
||||
title: 'Vintage Photo Restorer',
|
||||
mediaType: 'photo',
|
||||
imageUrl: '/management/pages/home/media/reel_restore_after.jpg',
|
||||
},
|
||||
|
||||
// ROW 2 (4 items)
|
||||
{
|
||||
id: 'tool-colorization',
|
||||
slug: 'colorization',
|
||||
title: 'AI Colorizer',
|
||||
mediaType: 'comparison',
|
||||
beforeUrl: '/management/pages/tools/colorization/media/before.jpg',
|
||||
afterUrl: '/management/pages/tools/colorization/media/after.jpg',
|
||||
},
|
||||
{
|
||||
id: 'tool-teeth',
|
||||
slug: 'teeth-whitener',
|
||||
title: 'Teeth Whitener & Brightener',
|
||||
mediaType: 'photo',
|
||||
imageUrl: '/management/pages/tools/teeth-whitener/media/after.jpg',
|
||||
},
|
||||
{
|
||||
id: 'tool-cartoon',
|
||||
slug: 'cartoon-avatar',
|
||||
title: 'Cartoon & Anime Avatar',
|
||||
mediaType: 'comparison',
|
||||
beforeUrl: '/management/pages/tools/cartoon-avatar/media/before.jpg',
|
||||
afterUrl: '/management/pages/tools/cartoon-avatar/media/after.jpg',
|
||||
},
|
||||
{
|
||||
id: 'tool-polaroid',
|
||||
slug: 'polaroid-maker',
|
||||
title: 'Vintage Polaroid Maker',
|
||||
mediaType: 'photo',
|
||||
imageUrl: '/management/pages/tools/polaroid-maker/media/after.jpg',
|
||||
},
|
||||
];
|
||||
|
||||
export function ShiftableToolsGridSection({
|
||||
title = 'Our Tools',
|
||||
subtitle = 'Click on any tool window to try with your own photos in seconds.',
|
||||
items,
|
||||
}: ShiftableToolsGridProps) {
|
||||
const displayItems = items && items.length >= 8 ? items : DEFAULT_TOOL_ITEMS;
|
||||
const row1 = displayItems.slice(0, 4);
|
||||
const row2 = displayItems.slice(4, 8);
|
||||
|
||||
return (
|
||||
<section id="our-tools" className="py-20 sm:py-28 px-4 sm:px-6 lg:px-8 bg-[#FAF8F5] relative overflow-hidden">
|
||||
<div className="max-w-7xl mx-auto space-y-12">
|
||||
{/* Header */}
|
||||
<div className="text-center max-w-3xl mx-auto space-y-4">
|
||||
<div className="inline-flex items-center gap-2 px-3.5 py-1 rounded-full text-xs font-mono font-semibold tracking-wider uppercase text-blue-700 bg-blue-50 border border-blue-200">
|
||||
<Sparkles className="w-3.5 h-3.5 text-blue-600" />
|
||||
<span>AI Creative Tools</span>
|
||||
</div>
|
||||
|
||||
<h2 className="text-3xl sm:text-5xl font-display font-extrabold text-slate-900 tracking-tight">
|
||||
<TextAnimate animation="slideLeft" by="word">
|
||||
{title}
|
||||
</TextAnimate>
|
||||
</h2>
|
||||
|
||||
<p className="text-sm sm:text-base text-slate-600 font-sans">
|
||||
<TextAnimate animation="fadeIn" by="word" delay={0.2}>
|
||||
{subtitle}
|
||||
</TextAnimate>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
{/* 2-Row Shiftable Grid Container (Pure Horizontal Expansion, Fixed Height, No Vertical Shifts) */}
|
||||
<div className="space-y-6 sm:space-y-8">
|
||||
<ShiftableRow items={row1} />
|
||||
<ShiftableRow items={row2} />
|
||||
</div>
|
||||
|
||||
{/* See More Section Button Redirecting to /tools */}
|
||||
<div className="pt-6 text-center">
|
||||
<Link
|
||||
href="/tools"
|
||||
className="group inline-flex items-center gap-2.5 px-8 py-4 rounded-full font-bold text-xs sm:text-sm text-white bg-slate-950 hover:bg-blue-600 shadow-md shadow-slate-900/10 transition-all duration-300 hover:scale-105 active:scale-95"
|
||||
>
|
||||
<span>See More Tools</span>
|
||||
<ArrowRight className="w-4 h-4 transition-transform group-hover:translate-x-1" />
|
||||
</Link>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
);
|
||||
}
|
||||
|
||||
function ShiftableRow({ items }: { items: ToolMediaItem[] }) {
|
||||
const [hoveredId, setHoveredId] = useState<string | null>(null);
|
||||
|
||||
return (
|
||||
<div className="flex flex-col md:flex-row gap-4 sm:gap-5 w-full items-start">
|
||||
{items.map((item) => {
|
||||
const isHovered = hoveredId === item.id;
|
||||
const hasOtherHovered = hoveredId !== null && !isHovered;
|
||||
|
||||
// Luxurious, slow, and smooth horizontal expansion (flex weighting)
|
||||
// No vertical scaling, no height changes, purely horizontal shift
|
||||
const flexClass = isHovered
|
||||
? 'md:flex-[1.75]'
|
||||
: hasOtherHovered
|
||||
? 'md:flex-[0.75]'
|
||||
: 'md:flex-1';
|
||||
|
||||
return (
|
||||
<div
|
||||
key={item.id}
|
||||
onMouseEnter={() => setHoveredId(item.id)}
|
||||
onMouseLeave={() => setHoveredId(null)}
|
||||
className={`w-full ${flexClass} transition-[flex-grow,flex-basis] duration-700 ease-[cubic-bezier(0.25,1,0.5,1)] flex flex-col flex-shrink-0 min-w-0`}
|
||||
>
|
||||
{/* Window Container with strictly locked pixel height to eliminate any vertical resizing */}
|
||||
<Link
|
||||
href={`/tools/${item.slug}`}
|
||||
className="group block relative w-full h-[260px] sm:h-[300px] rounded-2xl sm:rounded-3xl overflow-hidden bg-slate-950 border border-slate-900/[0.08] shadow-cream-sm hover:shadow-cream-lg transition-shadow duration-500"
|
||||
>
|
||||
{/* Media Renderer */}
|
||||
<ToolWindowMedia item={item} isHovered={isHovered} />
|
||||
|
||||
{/* Hover Media Type Pill */}
|
||||
<div className="absolute top-3 left-3 z-20 pointer-events-none opacity-0 group-hover:opacity-100 transition-opacity duration-500">
|
||||
<span className="inline-flex items-center gap-1.5 px-2.5 py-1 rounded-full text-[10px] font-mono font-bold tracking-wider uppercase bg-slate-950/85 backdrop-blur-md text-white border border-white/20">
|
||||
{item.mediaType === 'video' && <Video className="w-3 h-3 text-cyan-400" />}
|
||||
{item.mediaType === 'comparison' && <Sliders className="w-3 h-3 text-amber-400" />}
|
||||
{item.mediaType === 'photo' && <ImageIcon className="w-3 h-3 text-emerald-400" />}
|
||||
<span>{item.mediaType}</span>
|
||||
</span>
|
||||
</div>
|
||||
</Link>
|
||||
|
||||
{/* Little Title Below Window (Fixed height, no vertical jumping) */}
|
||||
<Link
|
||||
href={`/tools/${item.slug}`}
|
||||
className="mt-2.5 h-6 px-1 flex items-center justify-between text-xs sm:text-sm font-display font-semibold text-slate-800 hover:text-blue-600 transition-colors group"
|
||||
>
|
||||
<span className="truncate">{item.title}</span>
|
||||
<ArrowRight className="w-3.5 h-3.5 text-slate-400 group-hover:text-blue-600 group-hover:translate-x-0.5 transition-all flex-shrink-0 ml-1.5" />
|
||||
</Link>
|
||||
</div>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
function ToolWindowMedia({ item, isHovered }: { item: ToolMediaItem; isHovered: boolean }) {
|
||||
const videoRef = useRef<HTMLVideoElement>(null);
|
||||
const [sliderPos, setSliderPos] = useState<number>(50);
|
||||
const [isManualHover, setIsManualHover] = useState(false);
|
||||
const animFrameRef = useRef<number | null>(null);
|
||||
|
||||
// Video Autoplay Muted Loop only on Hover (No zoom, no scale)
|
||||
useEffect(() => {
|
||||
if (item.mediaType === 'video' && videoRef.current) {
|
||||
if (isHovered) {
|
||||
videoRef.current.play().catch(() => {});
|
||||
} else {
|
||||
videoRef.current.pause();
|
||||
videoRef.current.currentTime = 0;
|
||||
}
|
||||
}
|
||||
}, [isHovered, item.mediaType]);
|
||||
|
||||
// Before/After Smooth Automatic Oscillating Scan when hovered
|
||||
useEffect(() => {
|
||||
if (item.mediaType !== 'comparison') return;
|
||||
|
||||
if (!isHovered) {
|
||||
setSliderPos(50);
|
||||
setIsManualHover(false);
|
||||
if (animFrameRef.current) cancelAnimationFrame(animFrameRef.current);
|
||||
return;
|
||||
}
|
||||
|
||||
// If hovered and user is not manually dragging/scrubbing, smoothly oscillate slider
|
||||
let startTime = Date.now();
|
||||
const sweep = () => {
|
||||
if (!isManualHover) {
|
||||
const elapsed = (Date.now() - startTime) / 1000;
|
||||
// Smooth sine wave between 28% and 72%
|
||||
const pos = 50 + Math.sin(elapsed * 2.2) * 24;
|
||||
setSliderPos(pos);
|
||||
}
|
||||
animFrameRef.current = requestAnimationFrame(sweep);
|
||||
};
|
||||
|
||||
animFrameRef.current = requestAnimationFrame(sweep);
|
||||
|
||||
return () => {
|
||||
if (animFrameRef.current) cancelAnimationFrame(animFrameRef.current);
|
||||
};
|
||||
}, [isHovered, isManualHover, item.mediaType]);
|
||||
|
||||
// Pointer position tracking when mouse moves over the comparison window
|
||||
const handleMouseMove = (e: React.MouseEvent<HTMLDivElement>) => {
|
||||
if (item.mediaType !== 'comparison') return;
|
||||
setIsManualHover(true);
|
||||
const rect = e.currentTarget.getBoundingClientRect();
|
||||
const x = Math.max(0, Math.min(e.clientX - rect.left, rect.width));
|
||||
const percent = Math.max(10, Math.min(90, (x / rect.width) * 100));
|
||||
setSliderPos(percent);
|
||||
};
|
||||
|
||||
const handleMouseLeave = () => {
|
||||
setIsManualHover(false);
|
||||
};
|
||||
|
||||
// 1. VIDEO (Strictly locked to 100% width and height without any zooming or scaling)
|
||||
if (item.mediaType === 'video' && item.videoUrl) {
|
||||
return (
|
||||
<div className="relative w-full h-full overflow-hidden">
|
||||
<video
|
||||
ref={videoRef}
|
||||
src={item.videoUrl}
|
||||
poster={item.poster}
|
||||
muted
|
||||
loop
|
||||
playsInline
|
||||
className="w-full h-full object-cover"
|
||||
/>
|
||||
<div className="absolute inset-0 bg-slate-950/10 group-hover:bg-transparent transition-colors duration-500" />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
// 2. COMPARISON: Pixel-perfect clip-path slider (ZERO distortion, real slider animation)
|
||||
if (item.mediaType === 'comparison' && item.beforeUrl && item.afterUrl) {
|
||||
return (
|
||||
<div
|
||||
onMouseMove={handleMouseMove}
|
||||
onMouseLeave={handleMouseLeave}
|
||||
className="relative w-full h-full select-none cursor-ew-resize overflow-hidden"
|
||||
>
|
||||
{/* BEFORE Image (Base layer, 100% full cover, zero stretch) */}
|
||||
<img
|
||||
src={item.beforeUrl}
|
||||
alt="Before"
|
||||
className="absolute inset-0 w-full h-full object-cover pointer-events-none"
|
||||
loading="lazy"
|
||||
/>
|
||||
|
||||
{/* AFTER Image (Top layer clipped via CSS clip-path inset - NO SQUISHING OR RESIZING) */}
|
||||
<img
|
||||
src={item.afterUrl}
|
||||
alt="After"
|
||||
className="absolute inset-0 w-full h-full object-cover pointer-events-none"
|
||||
style={{
|
||||
clipPath: `inset(0 ${100 - sliderPos}% 0 0)`,
|
||||
}}
|
||||
loading="lazy"
|
||||
/>
|
||||
|
||||
{/* Glowing Slider Divider Line */}
|
||||
<div
|
||||
className="absolute top-0 bottom-0 w-[2px] bg-white shadow-[0_0_10px_rgba(255,255,255,0.95)] pointer-events-none z-10"
|
||||
style={{ left: `${sliderPos}%` }}
|
||||
>
|
||||
{/* Circular Grab Handle with Before/After Arrow Cue */}
|
||||
<div className="absolute top-1/2 -translate-y-1/2 -translate-x-1/2 w-7 h-7 rounded-full bg-white shadow-lg border border-slate-200/90 flex items-center justify-center text-[10px] font-bold text-slate-900 pointer-events-none">
|
||||
↔
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Clean Badges Visible on Hover */}
|
||||
{isHovered && (
|
||||
<div className="absolute bottom-3 inset-x-3 flex justify-between pointer-events-none z-20 text-[9px] font-mono font-bold uppercase tracking-wider text-white">
|
||||
<span className="bg-slate-950/80 px-2 py-0.5 rounded backdrop-blur border border-white/10">
|
||||
AFTER
|
||||
</span>
|
||||
<span className="bg-slate-950/80 px-2 py-0.5 rounded backdrop-blur border border-white/10">
|
||||
BEFORE
|
||||
</span>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
// 3. PHOTO (Clean unscaled presentation)
|
||||
return (
|
||||
<div className="relative w-full h-full overflow-hidden">
|
||||
<img
|
||||
src={item.imageUrl || item.afterUrl || item.beforeUrl || '/brand/og-default.png'}
|
||||
alt={item.title}
|
||||
className="w-full h-full object-cover"
|
||||
loading="lazy"
|
||||
/>
|
||||
<div className="absolute inset-0 bg-slate-950/10 group-hover:bg-transparent transition-colors duration-500" />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,158 @@
|
||||
'use client';
|
||||
|
||||
import React from 'react';
|
||||
import {
|
||||
Sparkles,
|
||||
Scissors,
|
||||
Wand2,
|
||||
Palette,
|
||||
Video,
|
||||
SunMedium,
|
||||
Layers,
|
||||
} from 'lucide-react';
|
||||
import { BentoGrid, BentoCard } from '@/components/magicui/bento-grid';
|
||||
import { TextAnimate } from '@/components/magicui/text-animate';
|
||||
|
||||
interface TrendyBentoSectionProps {
|
||||
title?: string;
|
||||
badge?: string;
|
||||
subtitle?: string;
|
||||
}
|
||||
|
||||
export function TrendyBentoSection({
|
||||
title = 'Trendy Neural Effects',
|
||||
badge = 'FEATURED CAPABILITIES',
|
||||
subtitle = 'Cutting-edge AI transformations engineered for creators, ecommerce, and studio professionals.',
|
||||
}: TrendyBentoSectionProps) {
|
||||
const bentoCards = [
|
||||
{
|
||||
Icon: Scissors,
|
||||
name: 'Hair-Strand P3M Matting',
|
||||
description: 'Microscopic flyaway hair boundary separation with sub-pixel alpha matting.',
|
||||
href: '/tools/background-remover',
|
||||
cta: 'Try Alpha Matting',
|
||||
badge: 'TRENDING CUTOUT',
|
||||
className: 'md:col-span-2',
|
||||
background: (
|
||||
<img
|
||||
src="/management/pages/home/media/reel_hair_alpha.jpg"
|
||||
alt="Hair Cutout"
|
||||
className="absolute inset-0 w-full h-full object-cover transition-transform duration-500 group-hover:scale-105"
|
||||
/>
|
||||
),
|
||||
},
|
||||
{
|
||||
Icon: Wand2,
|
||||
name: '4K Generative Face Restoration',
|
||||
description: 'Neural restoration that preserves real skin pores, eyelashes, and authentic iris glints.',
|
||||
href: '/tools/old-photo-restorer',
|
||||
cta: 'Restore Photos',
|
||||
badge: '4K RESTORATION',
|
||||
className: 'md:col-span-1',
|
||||
background: (
|
||||
<img
|
||||
src="/management/pages/home/media/reel_restore_after.jpg"
|
||||
alt="Restoration"
|
||||
className="absolute inset-0 w-full h-full object-cover transition-transform duration-500 group-hover:scale-105"
|
||||
/>
|
||||
),
|
||||
},
|
||||
{
|
||||
Icon: Sparkles,
|
||||
name: 'Cartoon & AnimeGAN Synthesis',
|
||||
description: 'Transform portraits into high-definition anime illustrations and stylized manga art.',
|
||||
href: '/tools/cartoon-avatar',
|
||||
cta: 'Create Avatar',
|
||||
badge: 'VIRAL ANIME',
|
||||
className: 'md:col-span-1',
|
||||
background: (
|
||||
<img
|
||||
src="/management/pages/home/media/showcase_05_cartoon_after.jpg"
|
||||
alt="Cartoon Avatar"
|
||||
className="absolute inset-0 w-full h-full object-cover transition-transform duration-500 group-hover:scale-105"
|
||||
/>
|
||||
),
|
||||
},
|
||||
{
|
||||
Icon: Video,
|
||||
name: 'Temporal Video Retouching',
|
||||
description: 'Continuous temporal epidermal smoothing across 4K dynamic video clips with zero flicker.',
|
||||
href: '/tools/blemish-remover',
|
||||
cta: 'Watch Reel',
|
||||
badge: '4K 60FPS REEL',
|
||||
className: 'md:col-span-2',
|
||||
background: (
|
||||
<img
|
||||
src="/management/pages/home/media/reel_video_poster.jpg"
|
||||
alt="Video Retouch"
|
||||
className="absolute inset-0 w-full h-full object-cover transition-transform duration-500 group-hover:scale-105"
|
||||
/>
|
||||
),
|
||||
},
|
||||
{
|
||||
Icon: Palette,
|
||||
name: 'Historical Deep Colorizer',
|
||||
description: 'Reconstruct vintage monochrome family archives with historically grounded pigment priors.',
|
||||
href: '/tools/colorization',
|
||||
cta: 'Colorize Archive',
|
||||
badge: 'ARCHIVAL AI',
|
||||
className: 'md:col-span-1',
|
||||
background: (
|
||||
<img
|
||||
src="/management/pages/home/media/showcase_04_restore_after.jpg"
|
||||
alt="Colorizer"
|
||||
className="absolute inset-0 w-full h-full object-cover transition-transform duration-500 group-hover:scale-105"
|
||||
/>
|
||||
),
|
||||
},
|
||||
{
|
||||
Icon: SunMedium,
|
||||
name: 'Studio Relight & Sub-Pore Retouch',
|
||||
description: 'Virtual three-point studio softbox illumination and non-destructive blemish removal.',
|
||||
href: '/tools/blemish-remover',
|
||||
cta: 'Relight Portrait',
|
||||
badge: 'STUDIO GRADE',
|
||||
className: 'md:col-span-2',
|
||||
background: (
|
||||
<img
|
||||
src="/management/pages/home/media/sample_portrait_1.jpg"
|
||||
alt="Studio Relight"
|
||||
className="absolute inset-0 w-full h-full object-cover transition-transform duration-500 group-hover:scale-105"
|
||||
/>
|
||||
),
|
||||
},
|
||||
];
|
||||
|
||||
return (
|
||||
<section id="trendy-effects" className="py-20 sm:py-28 px-4 sm:px-6 lg:px-8 bg-[#FAF8F5] relative overflow-hidden border-t border-slate-900/[0.06]">
|
||||
<div className="max-w-7xl mx-auto space-y-12">
|
||||
{/* Header */}
|
||||
<div className="text-center max-w-3xl mx-auto space-y-4">
|
||||
<div className="inline-flex items-center gap-2 px-3.5 py-1 rounded-full text-xs font-mono font-semibold tracking-wider uppercase text-blue-700 bg-blue-50 border border-blue-200">
|
||||
<Sparkles className="w-3.5 h-3.5 text-blue-600" />
|
||||
<span>{badge}</span>
|
||||
</div>
|
||||
|
||||
<h2 className="text-3xl sm:text-5xl font-display font-extrabold text-slate-900 tracking-tight">
|
||||
<TextAnimate animation="slideLeft" by="character">
|
||||
{title}
|
||||
</TextAnimate>
|
||||
</h2>
|
||||
|
||||
<p className="text-sm sm:text-base text-slate-600 font-sans">
|
||||
<TextAnimate animation="fadeIn" by="word" delay={0.2}>
|
||||
{subtitle}
|
||||
</TextAnimate>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
{/* Bento Grid Layout */}
|
||||
<BentoGrid className="lg:grid-rows-2">
|
||||
{bentoCards.map((card, idx) => (
|
||||
<BentoCard key={idx} {...card} />
|
||||
))}
|
||||
</BentoGrid>
|
||||
</div>
|
||||
</section>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user