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

332 lines
15 KiB
TypeScript
Raw Normal View History

'use client';
import React, { useState, useEffect } from 'react';
import {
Sparkles,
Wand2,
Download,
Heart,
Smile,
Image as ImageIcon,
ArrowRight,
PartyPopper,
Camera,
Star,
CheckCircle2
} from 'lucide-react';
import { TextAnimate } from '@/components/magicui/text-animate';
interface HowItWorksSectionProps {
title?: string;
badge?: string;
subtitle?: string;
}
export function HowItWorks3DSection({
title = 'Making Photo Magic is Super Simple',
badge = 'SUPER EASY AS 1-2-3',
subtitle = 'No complicated buttons or confusing settings. Just three friendly steps from your photo to pure magic!',
}: HowItWorksSectionProps) {
return (
<section id="how-it-works" className="py-20 sm:py-28 px-4 sm:px-6 md:px-8 lg:px-10 bg-[#FAF8F5] relative overflow-hidden border-t border-slate-900/[0.06]">
{/* Playful Ambient Background Glows */}
<div
className="absolute inset-0 pointer-events-none -z-10"
style={{
background: 'radial-gradient(circle at 50% 30%, rgba(254,240,138,0.15) 0%, rgba(199,210,254,0.12) 40%, transparent 70%)',
}}
/>
<div className="max-w-[1640px] mx-auto space-y-14">
{/* Playful & Warm Section Header */}
<div className="text-center max-w-3xl mx-auto space-y-4">
<div className="inline-flex items-center gap-2 px-4 py-1.5 rounded-full text-xs font-display font-bold tracking-wider uppercase text-amber-900 bg-amber-100/80 border border-amber-300 shadow-sm">
<Sparkles className="w-4 h-4 text-amber-600 animate-spin" style={{ animationDuration: '6s' }} />
<span>{badge}</span>
</div>
<h2 className="text-3xl sm:text-5xl font-display font-black text-slate-900 tracking-tight text-balance">
<TextAnimate animation="slideLeft" by="word">
{title}
</TextAnimate>
</h2>
<p className="text-base sm:text-lg text-slate-600 font-sans text-pretty">
<TextAnimate animation="fadeIn" by="word" delay={0.08}>
{subtitle}
</TextAnimate>
</p>
</div>
{/* 3 Childhood & Friendly Horizontal Story Cards */}
<div className="grid grid-cols-1 lg:grid-cols-3 gap-6 sm:gap-8 items-stretch">
{/* Step 1: Upload Your Picture */}
<StepUploadCard />
{/* Step 2: The Magic Happens */}
<StepMagicCard />
{/* Step 3: Tada! Download & Enjoy */}
<StepTadaCard />
</div>
{/* Cheerful Bottom Reassurance Banner */}
<div className="rounded-3xl bg-gradient-to-r from-amber-50 via-white to-blue-50 border border-amber-200/80 p-6 shadow-sm flex flex-col md:flex-row items-center justify-between gap-4 text-center md:text-left">
<div className="flex items-center gap-3">
<div className="w-10 h-10 rounded-2xl bg-amber-400 text-amber-950 flex items-center justify-center font-bold text-lg shadow-sm">
🎈
</div>
<div>
<h4 className="font-display font-bold text-slate-900 text-sm">
100% Free Trial • No Credit Card • No Sign-Up Needed
</h4>
<p className="text-xs text-slate-600 mt-0.5 font-sans">
Anyone can do it in seconds. Your photos stay completely private and are never saved.
</p>
</div>
</div>
<a
href="#our-tools"
className="inline-flex items-center gap-2 px-6 py-3 rounded-full text-xs font-bold text-slate-900 bg-amber-400 hover:bg-amber-300 shadow-md transition-all hover:scale-105 active:scale-95"
>
<span>Try It Yourself Now</span>
<ArrowRight className="w-4 h-4" />
</a>
</div>
</div>
</section>
);
}
// -------------------------------------------------------------
// Card 1: Upload Your Picture (Super Warm & Visual)
// -------------------------------------------------------------
function StepUploadCard() {
const [bounce, setBounce] = useState(false);
useEffect(() => {
const timer = setInterval(() => {
setBounce((prev) => !prev);
}, 2000);
return () => clearInterval(timer);
}, []);
return (
<div className="group relative flex flex-col justify-between rounded-[36px] bg-white border border-slate-200/90 p-7 shadow-cream-sm hover:shadow-cream-lg transition-all duration-300 hover:-translate-y-1.5 hover:border-blue-400/60">
<div>
{/* Step Badge */}
<div className="flex items-center justify-between mb-5">
<div className="inline-flex items-center gap-2 px-3.5 py-1 rounded-full bg-blue-50 border border-blue-200 text-blue-700 text-xs font-display font-bold uppercase tracking-wider">
<span>STEP 01</span>
</div>
<span className="text-xl">📸</span>
</div>
{/* Visual Animation: Friendly Photo Drop-In */}
<div className="relative w-full h-[230px] rounded-3xl bg-gradient-to-b from-blue-50/70 to-indigo-50/40 border border-blue-100 overflow-hidden flex flex-col items-center justify-center p-4 select-none">
{/* Animated floating dashed dropzone */}
<div className="w-full h-full border-2 border-dashed border-blue-300/80 rounded-2xl flex flex-col items-center justify-center p-4 relative">
{/* Playful Floating Photo Frame */}
<div
className={`w-36 h-28 rounded-2xl bg-white shadow-xl border-2 border-white overflow-hidden p-1.5 transition-transform duration-700 ${
bounce ? 'translate-y-0 rotate-1 scale-105' : '-translate-y-2 -rotate-2 scale-100'
}`}
>
<img
src="/management/pages/home/media/landscape_blemish_before.jpg"
alt="Your Photo"
className="w-full h-full object-cover rounded-xl"
/>
</div>
{/* Little Cheerful Badges */}
<div className="absolute top-2 left-2 px-2.5 py-1 rounded-full bg-white shadow-sm border border-blue-100 text-[10px] font-bold text-blue-700 flex items-center gap-1">
<span>Drop Any Photo</span>
<span>👇</span>
</div>
<div className="absolute bottom-2 right-2 px-2.5 py-1 rounded-full bg-blue-600 text-white shadow-sm text-[10px] font-bold flex items-center gap-1">
<span>Phone or Laptop</span>
<Heart className="w-3 h-3 fill-rose-300 text-rose-300" />
</div>
</div>
</div>
{/* Text */}
<h3 className="mt-6 text-2xl font-display font-black text-slate-900 group-hover:text-blue-600 transition-colors">
1. Pick Any Picture
</h3>
<p className="mt-2 text-sm text-slate-600 leading-relaxed font-sans">
Grab any photo from your phone or computer. Selfies, family memories, portraits, or old albums—anything works like a charm!
</p>
{/* Simple bullet points */}
<ul className="mt-5 space-y-2 text-xs font-medium text-slate-600 border-t border-slate-100 pt-4">
<li className="flex items-center gap-2">
<CheckCircle2 className="w-4 h-4 text-emerald-500 shrink-0" />
<span>Just tap or drag and drop</span>
</li>
<li className="flex items-center gap-2">
<CheckCircle2 className="w-4 h-4 text-emerald-500 shrink-0" />
<span>No account or sign-up needed</span>
</li>
</ul>
</div>
<div className="mt-6 pt-4 border-t border-slate-100 text-xs font-display font-bold text-blue-600 flex items-center justify-between">
<span>Ready in 1 second</span>
<span>⚡ Quick & Easy</span>
</div>
</div>
);
}
// -------------------------------------------------------------
// Card 2: The Magic Happens (Playful & Magical)
// -------------------------------------------------------------
function StepMagicCard() {
const [sparkleRot, setSparkleRot] = useState(0);
useEffect(() => {
const interval = setInterval(() => {
setSparkleRot((prev) => (prev + 30) % 360);
}, 250);
return () => clearInterval(interval);
}, []);
return (
<div className="group relative flex flex-col justify-between rounded-[36px] bg-white border border-slate-200/90 p-7 shadow-cream-sm hover:shadow-cream-lg transition-all duration-300 hover:-translate-y-1.5 hover:border-amber-400/60">
<div>
{/* Step Badge */}
<div className="flex items-center justify-between mb-5">
<div className="inline-flex items-center gap-2 px-3.5 py-1 rounded-full bg-amber-50 border border-amber-200 text-amber-800 text-xs font-display font-bold uppercase tracking-wider">
<span>STEP 02</span>
</div>
<span className="text-xl">🪄</span>
</div>
{/* Visual Animation: Swirling Magical Portal */}
<div className="relative w-full h-[230px] rounded-3xl bg-gradient-to-b from-amber-50/80 via-purple-50/50 to-pink-50/60 border border-amber-200/80 overflow-hidden flex flex-col items-center justify-center p-4 select-none">
{/* Glowing Aura Ring */}
<div className="absolute w-36 h-36 rounded-full bg-gradient-to-tr from-amber-300/40 via-purple-300/40 to-pink-300/40 blur-xl animate-pulse" />
{/* Central Wand and Sparkling Swirl */}
<div className="relative z-10 flex flex-col items-center justify-center">
<div className="w-20 h-20 rounded-3xl bg-white shadow-xl border border-amber-200 flex items-center justify-center transform group-hover:scale-110 transition-transform duration-300">
<Wand2 className="w-10 h-10 text-amber-500 animate-bounce" />
</div>
{/* Orbiting Stars & Sparkles */}
<div
className="absolute inset-[-20px] pointer-events-none transition-transform duration-300"
style={{ transform: `rotate(${sparkleRot}deg)` }}
>
<span className="absolute top-0 left-1/2 -translate-x-1/2 text-amber-400 text-base">✨</span>
<span className="absolute bottom-0 left-1/2 -translate-x-1/2 text-purple-400 text-sm">⭐</span>
<span className="absolute left-0 top-1/2 -translate-y-1/2 text-pink-400 text-sm">💫</span>
<span className="absolute right-0 top-1/2 -translate-y-1/2 text-cyan-400 text-sm">✨</span>
</div>
<div className="mt-3 px-3.5 py-1 rounded-full bg-white/95 shadow-md border border-amber-200 text-xs font-display font-bold text-amber-900 flex items-center gap-1.5">
<span>Mixing Magic Pixels...</span>
<span>🪄</span>
</div>
</div>
</div>
{/* Text */}
<h3 className="mt-6 text-2xl font-display font-black text-slate-900 group-hover:text-amber-600 transition-colors">
2. Some Magic Happens!
</h3>
<p className="mt-2 text-sm text-slate-600 leading-relaxed font-sans">
Our friendly AI waves its magic wand—dusting away marks, cleaning backgrounds, brightening smiles, and restoring crisp details instantly!
</p>
{/* Simple bullet points */}
<ul className="mt-5 space-y-2 text-xs font-medium text-slate-600 border-t border-slate-100 pt-4">
<li className="flex items-center gap-2">
<CheckCircle2 className="w-4 h-4 text-amber-500 shrink-0" />
<span>Cleans blemishes & background gently</span>
</li>
<li className="flex items-center gap-2">
<CheckCircle2 className="w-4 h-4 text-amber-500 shrink-0" />
<span>Keeps your real smile & face natural</span>
</li>
</ul>
</div>
<div className="mt-6 pt-4 border-t border-slate-100 text-xs font-display font-bold text-amber-700 flex items-center justify-between">
<span>Takes under a second</span>
<span>✨ Pure Wonder</span>
</div>
</div>
);
}
// -------------------------------------------------------------
// Card 3: Tada! Your Picture is Ready (Celebration & Joy)
// -------------------------------------------------------------
function StepTadaCard() {
return (
<div className="group relative flex flex-col justify-between rounded-[36px] bg-white border border-slate-200/90 p-7 shadow-cream-sm hover:shadow-cream-lg transition-all duration-300 hover:-translate-y-1.5 hover:border-emerald-400/60">
<div>
{/* Step Badge */}
<div className="flex items-center justify-between mb-5">
<div className="inline-flex items-center gap-2 px-3.5 py-1 rounded-full bg-emerald-50 border border-emerald-200 text-emerald-800 text-xs font-display font-bold uppercase tracking-wider">
<span>STEP 03</span>
</div>
<span className="text-xl">🎉</span>
</div>
{/* Visual Animation: Sparking Gorgeous Final Output */}
<div className="relative w-full h-[230px] rounded-3xl bg-gradient-to-b from-emerald-50/80 via-teal-50/50 to-cyan-50/60 border border-emerald-200/80 overflow-hidden flex flex-col items-center justify-center p-3 select-none">
{/* Finished Masterpiece Preview */}
<div className="relative w-full h-full rounded-2xl overflow-hidden shadow-xl border-2 border-white">
<img
src="/management/pages/home/media/landscape_blemish_after.jpg"
alt="Finished Photo"
className="w-full h-full object-cover transform group-hover:scale-105 transition-transform duration-500"
/>
{/* Tada Ribbon / Celebration Badge */}
<div className="absolute top-2 left-2 px-3 py-1 rounded-full bg-emerald-500 text-white shadow-lg text-xs font-display font-bold flex items-center gap-1.5">
<PartyPopper className="w-3.5 h-3.5" />
<span>Tada! Masterpiece</span>
</div>
<div className="absolute bottom-2 right-2 px-3 py-1 rounded-full bg-white/95 text-slate-900 shadow-md border border-slate-200 text-[10px] font-display font-bold flex items-center gap-1">
<Download className="w-3 h-3 text-emerald-600" />
<span>Crystal 4K Ready</span>
</div>
</div>
</div>
{/* Text */}
<h3 className="mt-6 text-2xl font-display font-black text-slate-900 group-hover:text-emerald-600 transition-colors">
3. Tada! Ready to Love
</h3>
<p className="mt-2 text-sm text-slate-600 leading-relaxed font-sans">
One tap to download your gorgeous new picture in ultra-clear quality! No annoying watermarks, no limits, ready to share with family and friends.
</p>
{/* Simple bullet points */}
<ul className="mt-5 space-y-2 text-xs font-medium text-slate-600 border-t border-slate-100 pt-4">
<li className="flex items-center gap-2">
<CheckCircle2 className="w-4 h-4 text-emerald-500 shrink-0" />
<span>Crisp high-definition download</span>
</li>
<li className="flex items-center gap-2">
<CheckCircle2 className="w-4 h-4 text-emerald-500 shrink-0" />
<span>Zero watermarks or hidden charges</span>
</li>
</ul>
</div>
<div className="mt-6 pt-4 border-t border-slate-100 text-xs font-display font-bold text-emerald-700 flex items-center justify-between">
<span>Instant Download</span>
<span>🎉 All Yours</span>
</div>
</div>
);
}