feat(homepage): add travelling image pipeline to how-it-works, round our-tools corners, organize media, and clean hero header
This commit is contained in:
@@ -583,5 +583,16 @@ h1, h2, h3, h4, h5, h6, .text-3d-chiseled {
|
||||
animation: cre-shimmer-slide 4.5s ease-in-out infinite;
|
||||
}
|
||||
|
||||
@keyframes laser-scan {
|
||||
0% { transform: translateX(-150%); opacity: 0; }
|
||||
25% { opacity: 0.9; }
|
||||
75% { opacity: 0.9; }
|
||||
100% { transform: translateX(250%); opacity: 0; }
|
||||
}
|
||||
|
||||
.animate-laser-scan {
|
||||
animation: laser-scan 1.6s ease-in-out infinite;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -299,21 +299,6 @@ export function HeroSection({
|
||||
|
||||
{/* 4. Center Hero Typography & Visual Atmosphere */}
|
||||
<div className="relative z-10 max-w-6xl mx-auto flex flex-col items-center justify-center w-full">
|
||||
{/* Ambient Frosted Eyebrow Badge */}
|
||||
<div className="inline-flex items-center gap-2.5 rounded-full border border-slate-900/[0.08] bg-white/80 backdrop-blur-xl px-4 py-1.5 text-xs font-mono font-medium tracking-wider uppercase text-slate-800 shadow-[0_2px_12px_-4px_rgba(15,23,42,0.06),inset_0_1px_0_rgba(255,255,255,0.8)] transition-all duration-300 hover:border-blue-500/30 hover:bg-white mb-8 sm:mb-9 group cursor-default">
|
||||
<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 className="relative inline-flex rounded-full h-2 w-2 bg-gradient-to-r from-blue-600 to-cyan-500" />
|
||||
</span>
|
||||
<span className="text-slate-700 tracking-wider font-semibold text-[11px] sm:text-xs">
|
||||
{resolvedBadge}
|
||||
</span>
|
||||
<span className="h-3 w-px bg-slate-200" />
|
||||
<span className="text-[10px] font-mono font-bold uppercase tracking-wider text-blue-600 bg-blue-50 px-2 py-0.5 rounded-full border border-blue-200/50">
|
||||
v4.2 PRO
|
||||
</span>
|
||||
</div>
|
||||
|
||||
{/* Grand Headline: Masterpiece Proportions, Zero Awkward Wraps */}
|
||||
<h1 className="text-3xl sm:text-5xl md:text-6xl lg:text-[5.2rem] xl:text-[5.8rem] font-display font-extrabold tracking-[-0.035em] leading-[1.08] max-w-6xl mx-auto text-balance">
|
||||
<span className="block text-slate-950 pb-1 sm:pb-2">
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
'use client';
|
||||
|
||||
import React from 'react';
|
||||
import React, { useState, useEffect, useRef } from 'react';
|
||||
import {
|
||||
Sparkles,
|
||||
Wand2,
|
||||
@@ -12,7 +12,10 @@ import {
|
||||
PartyPopper,
|
||||
Camera,
|
||||
Star,
|
||||
CheckCircle2
|
||||
CheckCircle2,
|
||||
Play,
|
||||
Pause,
|
||||
RotateCcw
|
||||
} from 'lucide-react';
|
||||
import { TextAnimate } from '@/components/magicui/text-animate';
|
||||
|
||||
@@ -27,8 +30,65 @@ export function HowItWorks3DSection({
|
||||
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) {
|
||||
const [activeStep, setActiveStep] = useState<1 | 2 | 3>(1);
|
||||
const [isPaused, setIsPaused] = useState(false);
|
||||
const sectionRef = useRef<HTMLDivElement>(null);
|
||||
|
||||
// Auto-advance travelling image through steps with smart offscreen pause
|
||||
useEffect(() => {
|
||||
if (isPaused) return;
|
||||
const section = sectionRef.current;
|
||||
let isVisible = true;
|
||||
let timer: any = null;
|
||||
|
||||
const runTimer = () => {
|
||||
if (timer) clearInterval(timer);
|
||||
timer = setInterval(() => {
|
||||
if (isVisible && !document.hidden && !isPaused) {
|
||||
setActiveStep((prev) => (prev === 3 ? 1 : ((prev + 1) as 1 | 2 | 3)));
|
||||
}
|
||||
}, 3400);
|
||||
};
|
||||
|
||||
const observer = new IntersectionObserver(
|
||||
([entry]) => {
|
||||
isVisible = entry.isIntersecting;
|
||||
if (isVisible) {
|
||||
runTimer();
|
||||
} else if (timer) {
|
||||
clearInterval(timer);
|
||||
timer = null;
|
||||
}
|
||||
},
|
||||
{ threshold: 0.1 }
|
||||
);
|
||||
|
||||
if (section) observer.observe(section);
|
||||
runTimer();
|
||||
|
||||
const handleVisibility = () => {
|
||||
if (document.hidden && timer) {
|
||||
clearInterval(timer);
|
||||
timer = null;
|
||||
} else if (isVisible && !isPaused) {
|
||||
runTimer();
|
||||
}
|
||||
};
|
||||
document.addEventListener('visibilitychange', handleVisibility);
|
||||
|
||||
return () => {
|
||||
if (timer) clearInterval(timer);
|
||||
observer.disconnect();
|
||||
document.removeEventListener('visibilitychange', handleVisibility);
|
||||
};
|
||||
}, [isPaused]);
|
||||
|
||||
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]">
|
||||
<section
|
||||
id="how-it-works"
|
||||
ref={sectionRef}
|
||||
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"
|
||||
@@ -37,7 +97,7 @@ export function HowItWorks3DSection({
|
||||
}}
|
||||
/>
|
||||
|
||||
<div className="max-w-[1640px] mx-auto space-y-14">
|
||||
<div className="max-w-[1640px] mx-auto space-y-12 sm: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">
|
||||
@@ -58,16 +118,24 @@ export function HowItWorks3DSection({
|
||||
</p>
|
||||
</div>
|
||||
|
||||
{/* 3 Childhood & Friendly Horizontal Story Cards */}
|
||||
{/* 1. Dynamic Travelling Image Pipeline Animation */}
|
||||
<TravellingTransformationPipeline
|
||||
activeStep={activeStep}
|
||||
onSelectStep={setActiveStep}
|
||||
isPaused={isPaused}
|
||||
onTogglePause={() => setIsPaused(!isPaused)}
|
||||
/>
|
||||
|
||||
{/* 2. Three 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 />
|
||||
<StepUploadCard isActive={activeStep === 1} />
|
||||
|
||||
{/* Step 2: The Magic Happens */}
|
||||
<StepMagicCard />
|
||||
<StepMagicCard isActive={activeStep === 2} />
|
||||
|
||||
{/* Step 3: Tada! Download & Enjoy */}
|
||||
<StepTadaCard />
|
||||
<StepTadaCard isActive={activeStep === 3} />
|
||||
</div>
|
||||
|
||||
{/* Cheerful Bottom Reassurance Banner */}
|
||||
@@ -99,16 +167,274 @@ export function HowItWorks3DSection({
|
||||
);
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------
|
||||
// Travelling Image Transformation Pipeline
|
||||
// -------------------------------------------------------------
|
||||
function TravellingTransformationPipeline({
|
||||
activeStep,
|
||||
onSelectStep,
|
||||
isPaused,
|
||||
onTogglePause,
|
||||
}: {
|
||||
activeStep: 1 | 2 | 3;
|
||||
onSelectStep: (step: 1 | 2 | 3) => void;
|
||||
isPaused: boolean;
|
||||
onTogglePause: () => void;
|
||||
}) {
|
||||
return (
|
||||
<div className="rounded-[32px] sm:rounded-[40px] bg-white border border-slate-200/90 p-5 sm:p-8 shadow-cream-sm overflow-hidden relative isolate">
|
||||
{/* Dynamic ambient background glow that shifts with active step */}
|
||||
<div
|
||||
className="absolute inset-0 pointer-events-none transition-all duration-1000 -z-10"
|
||||
style={{
|
||||
background: activeStep === 1
|
||||
? 'radial-gradient(circle at 18% 50%, rgba(59,130,246,0.1) 0%, transparent 60%)'
|
||||
: activeStep === 2
|
||||
? 'radial-gradient(circle at 50% 50%, rgba(245,158,11,0.12) 0%, rgba(168,85,247,0.08) 40%, transparent 70%)'
|
||||
: 'radial-gradient(circle at 82% 50%, rgba(16,185,129,0.1) 0%, transparent 60%)'
|
||||
}}
|
||||
/>
|
||||
|
||||
{/* Pipeline Header: Progress Title & Interactive Step Selectors */}
|
||||
<div className="flex flex-col md:flex-row md:items-center justify-between gap-4 pb-6 border-b border-slate-100">
|
||||
<div>
|
||||
<div className="inline-flex items-center gap-2 px-3 py-1 rounded-full bg-slate-100 text-slate-800 text-[11px] font-mono font-bold tracking-wider uppercase mb-1">
|
||||
<span className={`w-2 h-2 rounded-full animate-ping ${
|
||||
activeStep === 1 ? 'bg-blue-600' : activeStep === 2 ? 'bg-amber-500' : 'bg-emerald-500'
|
||||
}`} />
|
||||
<span>Live Photo Journey Pipeline</span>
|
||||
</div>
|
||||
<h3 className="text-base sm:text-lg font-display font-extrabold text-slate-900 transition-colors">
|
||||
{activeStep === 1 && 'Step 1: Your original picture drops onto the conveyor'}
|
||||
{activeStep === 2 && 'Step 2: AI Neural magic analyzes & transforms pixels'}
|
||||
{activeStep === 3 && 'Step 3: Flawless 4K masterpiece is instantly ready!'}
|
||||
</h3>
|
||||
</div>
|
||||
|
||||
{/* Controls: Step Switchers & Play/Pause */}
|
||||
<div className="flex items-center gap-2 flex-wrap">
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => onSelectStep(1)}
|
||||
className={`px-3 py-1.5 rounded-full text-xs font-display font-bold transition-all duration-300 ${
|
||||
activeStep === 1
|
||||
? 'bg-blue-600 text-white shadow-md shadow-blue-500/20 scale-105'
|
||||
: 'bg-slate-100 text-slate-600 hover:bg-slate-200'
|
||||
}`}
|
||||
>
|
||||
📸 1. Pick Photo
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => onSelectStep(2)}
|
||||
className={`px-3 py-1.5 rounded-full text-xs font-display font-bold transition-all duration-300 ${
|
||||
activeStep === 2
|
||||
? 'bg-amber-500 text-white shadow-md shadow-amber-500/20 scale-105'
|
||||
: 'bg-slate-100 text-slate-600 hover:bg-slate-200'
|
||||
}`}
|
||||
>
|
||||
🪄 2. AI Magic
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => onSelectStep(3)}
|
||||
className={`px-3 py-1.5 rounded-full text-xs font-display font-bold transition-all duration-300 ${
|
||||
activeStep === 3
|
||||
? 'bg-emerald-600 text-white shadow-md shadow-emerald-500/20 scale-105'
|
||||
: 'bg-slate-100 text-slate-600 hover:bg-slate-200'
|
||||
}`}
|
||||
>
|
||||
🎉 3. Masterpiece
|
||||
</button>
|
||||
|
||||
<button
|
||||
type="button"
|
||||
onClick={onTogglePause}
|
||||
className="p-2 rounded-full bg-slate-100 hover:bg-slate-200 text-slate-700 transition-colors ml-1"
|
||||
title={isPaused ? 'Resume auto-play' : 'Pause auto-play'}
|
||||
aria-label={isPaused ? 'Resume auto-play' : 'Pause auto-play'}
|
||||
>
|
||||
{isPaused ? <Play className="w-3.5 h-3.5" /> : <Pause className="w-3.5 h-3.5" />}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* DESKTOP PIPELINE TRACK (hidden on small mobile, visible sm+) */}
|
||||
<div className="hidden sm:block relative pt-6 pb-2 h-[240px] overflow-hidden">
|
||||
{/* Conveyor Base Track Line */}
|
||||
<div className="absolute top-[120px] inset-x-12 h-1.5 bg-slate-200/80 rounded-full" />
|
||||
|
||||
{/* Animated Active Glowing Energy Beam */}
|
||||
<div
|
||||
className="absolute top-[120px] left-12 h-1.5 bg-gradient-to-r from-blue-500 via-amber-400 to-emerald-500 rounded-full transition-all duration-700 ease-[cubic-bezier(0.16,1,0.3,1)] shadow-[0_0_12px_rgba(59,130,246,0.6)]"
|
||||
style={{
|
||||
width: activeStep === 1 ? '0%' : activeStep === 2 ? 'calc(50% - 3rem)' : 'calc(100% - 6rem)'
|
||||
}}
|
||||
/>
|
||||
|
||||
{/* Station 1 Anchor Ring */}
|
||||
<div className="absolute top-[120px] left-12 -translate-x-1/2 -translate-y-1/2 flex flex-col items-center">
|
||||
<div className={`w-9 h-9 rounded-full border-2 flex items-center justify-center transition-all duration-300 ${
|
||||
activeStep === 1 ? 'bg-blue-600 border-blue-300 text-white shadow-lg scale-110' : 'bg-white border-slate-300 text-slate-500'
|
||||
}`}>
|
||||
<span className="text-sm">📸</span>
|
||||
</div>
|
||||
<span className="mt-2 text-[10px] font-mono font-bold uppercase text-slate-600">1. Pick</span>
|
||||
</div>
|
||||
|
||||
{/* Station 2 Anchor Ring */}
|
||||
<div className="absolute top-[120px] left-1/2 -translate-x-1/2 -translate-y-1/2 flex flex-col items-center">
|
||||
<div className={`w-9 h-9 rounded-full border-2 flex items-center justify-center transition-all duration-300 ${
|
||||
activeStep === 2 ? 'bg-amber-500 border-amber-300 text-white shadow-lg scale-110' : 'bg-white border-slate-300 text-slate-500'
|
||||
}`}>
|
||||
<span className="text-sm">🪄</span>
|
||||
</div>
|
||||
<span className="mt-2 text-[10px] font-mono font-bold uppercase text-slate-600">2. Neural Magic</span>
|
||||
</div>
|
||||
|
||||
{/* Station 3 Anchor Ring */}
|
||||
<div className="absolute top-[120px] right-12 translate-x-1/2 -translate-y-1/2 flex flex-col items-center">
|
||||
<div className={`w-9 h-9 rounded-full border-2 flex items-center justify-center transition-all duration-300 ${
|
||||
activeStep === 3 ? 'bg-emerald-600 border-emerald-300 text-white shadow-lg scale-110' : 'bg-white border-slate-300 text-slate-500'
|
||||
}`}>
|
||||
<span className="text-sm">🎉</span>
|
||||
</div>
|
||||
<span className="mt-2 text-[10px] font-mono font-bold uppercase text-slate-600">3. Download</span>
|
||||
</div>
|
||||
|
||||
{/* THE TRAVELLING PHOTO CARD */}
|
||||
<div
|
||||
className="absolute top-1/2 z-20 transition-all duration-700 ease-[cubic-bezier(0.16,1,0.3,1)] transform-gpu will-change-[left,transform]"
|
||||
style={{
|
||||
left: activeStep === 1 ? 'calc(3rem + 30px)' : activeStep === 2 ? '50%' : 'calc(100% - 3rem - 30px)',
|
||||
transform: 'translate(-50%, -50%)',
|
||||
}}
|
||||
>
|
||||
<div className={`relative w-44 h-32 rounded-2xl bg-white p-1.5 shadow-2xl border-2 transition-all duration-500 overflow-hidden ${
|
||||
activeStep === 1
|
||||
? 'border-blue-400 shadow-blue-500/25 rotate-[-2deg]'
|
||||
: activeStep === 2
|
||||
? 'border-amber-400 shadow-amber-500/35 scale-110 rotate-[0deg]'
|
||||
: 'border-emerald-400 shadow-emerald-500/30 rotate-[2deg] scale-105'
|
||||
}`}>
|
||||
{/* Raw Source Photo (active in step 1, crossfades out) */}
|
||||
<img
|
||||
src="/management/pages/home/sections/how-it-works/media/before.jpg"
|
||||
alt="Source Raw Photo"
|
||||
className={`absolute inset-1.5 w-[calc(100%-12px)] h-[calc(100%-12px)] object-cover rounded-xl transition-opacity duration-700 ${
|
||||
activeStep === 1 ? 'opacity-100' : 'opacity-0'
|
||||
}`}
|
||||
/>
|
||||
|
||||
{/* AI Transformed Masterpiece Photo (fades in step 2 & 3) */}
|
||||
<img
|
||||
src="/management/pages/home/sections/how-it-works/media/after.jpg"
|
||||
alt="Transformed Masterpiece"
|
||||
className={`absolute inset-1.5 w-[calc(100%-12px)] h-[calc(100%-12px)] object-cover rounded-xl transition-opacity duration-700 ${
|
||||
activeStep >= 2 ? 'opacity-100' : 'opacity-0'
|
||||
}`}
|
||||
/>
|
||||
|
||||
{/* Step 2 Neural Laser Scanner Beam */}
|
||||
{activeStep === 2 && (
|
||||
<div
|
||||
className="absolute inset-y-1.5 w-10 bg-gradient-to-r from-transparent via-cyan-400/90 to-transparent animate-laser-scan pointer-events-none z-20 rounded-xl"
|
||||
/>
|
||||
)}
|
||||
|
||||
{/* Badges on Travelling Card */}
|
||||
<div className="absolute bottom-2.5 left-2.5 right-2.5 z-30 flex items-center justify-between">
|
||||
<span className={`px-2 py-0.5 rounded-full text-[9px] font-mono font-bold uppercase tracking-wider backdrop-blur-md shadow-xs text-white ${
|
||||
activeStep === 1 ? 'bg-blue-600/95' : activeStep === 2 ? 'bg-amber-600/95' : 'bg-emerald-600/95'
|
||||
}`}>
|
||||
{activeStep === 1 && 'Raw Photo'}
|
||||
{activeStep === 2 && 'AI Magic...'}
|
||||
{activeStep === 3 && '4K Masterpiece'}
|
||||
</span>
|
||||
|
||||
{activeStep === 2 && (
|
||||
<span className="text-xs animate-spin" style={{ animationDuration: '3s' }}>✨</span>
|
||||
)}
|
||||
{activeStep === 3 && (
|
||||
<span className="text-xs">🎉</span>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* MOBILE PIPELINE TRACK (sm:hidden) */}
|
||||
<div className="sm:hidden pt-3 pb-1 space-y-4">
|
||||
{/* Mobile Animated Travelling Card Stage */}
|
||||
<div className="relative w-full h-[180px] rounded-2xl bg-gradient-to-b from-slate-900 to-slate-950 p-3 overflow-hidden flex flex-col items-center justify-center">
|
||||
<div className="relative w-48 h-32 rounded-xl bg-white p-1 shadow-xl overflow-hidden border-2 border-white/20">
|
||||
{/* Raw Photo */}
|
||||
<img
|
||||
src="/management/pages/home/sections/how-it-works/media/before.jpg"
|
||||
alt="Source Photo"
|
||||
className={`absolute inset-1 w-[calc(100%-8px)] h-[calc(100%-8px)] object-cover rounded-lg transition-opacity duration-700 ${
|
||||
activeStep === 1 ? 'opacity-100' : 'opacity-0'
|
||||
}`}
|
||||
/>
|
||||
{/* Transformed Photo */}
|
||||
<img
|
||||
src="/management/pages/home/sections/how-it-works/media/after.jpg"
|
||||
alt="Transformed Photo"
|
||||
className={`absolute inset-1 w-[calc(100%-8px)] h-[calc(100%-8px)] object-cover rounded-lg transition-opacity duration-700 ${
|
||||
activeStep >= 2 ? 'opacity-100' : 'opacity-0'
|
||||
}`}
|
||||
/>
|
||||
|
||||
{/* Laser Beam during magic step */}
|
||||
{activeStep === 2 && (
|
||||
<div className="absolute inset-y-1 w-8 bg-gradient-to-r from-transparent via-cyan-400 to-transparent animate-laser-scan pointer-events-none z-20" />
|
||||
)}
|
||||
|
||||
<div className="absolute bottom-2 left-2 right-2 z-30 flex items-center justify-between">
|
||||
<span className={`px-2 py-0.5 rounded-full text-[9px] font-mono font-bold uppercase tracking-wider text-white ${
|
||||
activeStep === 1 ? 'bg-blue-600' : activeStep === 2 ? 'bg-amber-600' : 'bg-emerald-600'
|
||||
}`}>
|
||||
{activeStep === 1 && 'Step 1: Raw Photo'}
|
||||
{activeStep === 2 && 'Step 2: AI Magic'}
|
||||
{activeStep === 3 && 'Step 3: 4K Finished'}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Dotted Step Bar on Mobile */}
|
||||
<div className="mt-3 flex items-center justify-center gap-2">
|
||||
{[1, 2, 3].map((s) => (
|
||||
<button
|
||||
key={s}
|
||||
onClick={() => onSelectStep(s as 1 | 2 | 3)}
|
||||
className={`h-2 rounded-full transition-all duration-300 ${
|
||||
activeStep === s ? 'w-8 bg-amber-400' : 'w-2 bg-slate-700'
|
||||
}`}
|
||||
aria-label={`Go to step ${s}`}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------
|
||||
// Card 1: Upload Your Picture (Super Warm & Visual)
|
||||
// -------------------------------------------------------------
|
||||
function StepUploadCard() {
|
||||
function StepUploadCard({ isActive = false }: { isActive?: boolean }) {
|
||||
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 className={`group relative flex flex-col justify-between rounded-[36px] bg-white border p-7 shadow-cream-sm transition-all duration-500 ${
|
||||
isActive
|
||||
? 'border-blue-400 ring-4 ring-blue-500/20 shadow-cream-lg -translate-y-2'
|
||||
: 'border-slate-200/90 hover:shadow-cream-lg 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">
|
||||
{isActive && <span className="w-2 h-2 rounded-full bg-blue-600 animate-ping" />}
|
||||
<span>STEP 01</span>
|
||||
</div>
|
||||
<span className="text-xl">📸</span>
|
||||
@@ -171,13 +497,18 @@ function StepUploadCard() {
|
||||
// -------------------------------------------------------------
|
||||
// Card 2: The Magic Happens (Playful & Magical)
|
||||
// -------------------------------------------------------------
|
||||
function StepMagicCard() {
|
||||
function StepMagicCard({ isActive = false }: { isActive?: boolean }) {
|
||||
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 className={`group relative flex flex-col justify-between rounded-[36px] bg-white border p-7 shadow-cream-sm transition-all duration-500 ${
|
||||
isActive
|
||||
? 'border-amber-400 ring-4 ring-amber-500/20 shadow-cream-lg -translate-y-2'
|
||||
: 'border-slate-200/90 hover:shadow-cream-lg 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">
|
||||
{isActive && <span className="w-2 h-2 rounded-full bg-amber-500 animate-ping" />}
|
||||
<span>STEP 02</span>
|
||||
</div>
|
||||
<span className="text-xl">🪄</span>
|
||||
@@ -244,13 +575,18 @@ function StepMagicCard() {
|
||||
// -------------------------------------------------------------
|
||||
// Card 3: Tada! Your Picture is Ready (Celebration & Joy)
|
||||
// -------------------------------------------------------------
|
||||
function StepTadaCard() {
|
||||
function StepTadaCard({ isActive = false }: { isActive?: boolean }) {
|
||||
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 className={`group relative flex flex-col justify-between rounded-[36px] bg-white border p-7 shadow-cream-sm transition-all duration-500 ${
|
||||
isActive
|
||||
? 'border-emerald-400 ring-4 ring-emerald-500/20 shadow-cream-lg -translate-y-2'
|
||||
: 'border-slate-200/90 hover:shadow-cream-lg 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">
|
||||
{isActive && <span className="w-2 h-2 rounded-full bg-emerald-500 animate-ping" />}
|
||||
<span>STEP 03</span>
|
||||
</div>
|
||||
<span className="text-xl">🎉</span>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
import React, { useState, useRef, useEffect, useCallback } from 'react';
|
||||
import Link from 'next/link';
|
||||
import { ArrowRight, Sparkles, Video, Sliders, Image as ImageIcon } from 'lucide-react';
|
||||
import { ArrowRight, Sparkles } from 'lucide-react';
|
||||
import { TextAnimate } from '@/components/magicui/text-animate';
|
||||
import { ToolItem } from '@/types';
|
||||
|
||||
@@ -186,10 +186,14 @@ function ShiftableRow({ items }: { items: ToolMediaItem[] }) {
|
||||
>
|
||||
{/* Window Container with strictly locked pixel height & landscape aspect */}
|
||||
{item.mediaType === 'comparison' ? (
|
||||
<div className="group block relative w-full h-[220px] sm:h-[240px] lg:h-[260px] rounded-2xl sm:rounded-3xl overflow-hidden bg-slate-950 border border-slate-900/[0.08] shadow-cream-sm">
|
||||
<div
|
||||
style={{ borderRadius: '28px' }}
|
||||
className="group block relative w-full h-[220px] sm:h-[240px] lg:h-[260px] rounded-[28px] sm:rounded-[36px] overflow-hidden isolate [mask-image:radial-gradient(white,black)] [-webkit-mask-image:-webkit-radial-gradient(white,black)] bg-slate-950 border border-slate-900/[0.08] shadow-cream-sm"
|
||||
>
|
||||
{/* GPU-Composited Shadow Elevation Layer */}
|
||||
<div
|
||||
className="absolute -inset-px rounded-2xl sm:rounded-3xl shadow-cream-lg opacity-0 group-hover:opacity-100 transition-opacity duration-700 ease-[cubic-bezier(0.16,1,0.3,1)] pointer-events-none z-30"
|
||||
style={{ borderRadius: '28px' }}
|
||||
className="absolute -inset-px rounded-[28px] sm:rounded-[36px] shadow-cream-lg opacity-0 group-hover:opacity-100 transition-opacity duration-700 ease-[cubic-bezier(0.16,1,0.3,1)] pointer-events-none z-30"
|
||||
aria-hidden="true"
|
||||
/>
|
||||
|
||||
@@ -205,41 +209,22 @@ function ShiftableRow({ items }: { items: ToolMediaItem[] }) {
|
||||
<span>TRY TOOL</span>
|
||||
<ArrowRight className="w-2.5 h-2.5" />
|
||||
</Link>
|
||||
|
||||
{/* 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 ease-[cubic-bezier(0.16,1,0.3,1)]"
|
||||
>
|
||||
<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">
|
||||
<Sliders className="w-3 h-3 text-amber-400" />
|
||||
<span>comparison</span>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
) : (
|
||||
<Link
|
||||
href={`/tools/${item.slug}`}
|
||||
className="group block relative w-full h-[220px] sm:h-[240px] lg:h-[260px] rounded-2xl sm:rounded-3xl overflow-hidden bg-slate-950 border border-slate-900/[0.08] shadow-cream-sm cursor-pointer"
|
||||
style={{ borderRadius: '28px' }}
|
||||
className="group block relative w-full h-[220px] sm:h-[240px] lg:h-[260px] rounded-[28px] sm:rounded-[36px] overflow-hidden isolate [mask-image:radial-gradient(white,black)] [-webkit-mask-image:-webkit-radial-gradient(white,black)] bg-slate-950 border border-slate-900/[0.08] shadow-cream-sm cursor-pointer"
|
||||
>
|
||||
{/* GPU-Composited Shadow Elevation Layer (Opacity-only transition, zero paint thrash) */}
|
||||
<div
|
||||
className="absolute -inset-px rounded-2xl sm:rounded-3xl shadow-cream-lg opacity-0 group-hover:opacity-100 transition-opacity duration-700 ease-[cubic-bezier(0.16,1,0.3,1)] pointer-events-none z-30"
|
||||
style={{ borderRadius: '28px' }}
|
||||
className="absolute -inset-px rounded-[28px] sm:rounded-[36px] shadow-cream-lg opacity-0 group-hover:opacity-100 transition-opacity duration-700 ease-[cubic-bezier(0.16,1,0.3,1)] pointer-events-none z-30"
|
||||
aria-hidden="true"
|
||||
/>
|
||||
|
||||
{/* Media Renderer */}
|
||||
<ToolWindowMedia item={item} isHovered={isHovered} />
|
||||
|
||||
{/* Hover Media Type Pill (Smooth GPU Opacity Transition) */}
|
||||
<div
|
||||
className="absolute top-3 left-3 z-20 pointer-events-none opacity-0 group-hover:opacity-100 transition-opacity duration-500 ease-[cubic-bezier(0.16,1,0.3,1)]"
|
||||
>
|
||||
<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 === 'photo' && <ImageIcon className="w-3 h-3 text-emerald-400" />}
|
||||
<span>{item.mediaType}</span>
|
||||
</span>
|
||||
</div>
|
||||
</Link>
|
||||
)}
|
||||
|
||||
@@ -281,7 +266,8 @@ function ToolWindowMedia({ item, isHovered }: { item: ToolMediaItem; isHovered:
|
||||
dividerRef.current.style.left = `${clamped}%`;
|
||||
}
|
||||
if (clipLayerRef.current) {
|
||||
clipLayerRef.current.style.clipPath = `inset(0 ${100 - clamped}% 0 0)`;
|
||||
clipLayerRef.current.style.clipPath = `inset(0 ${100 - clamped}% 0 0 round 28px 0 0 28px)`;
|
||||
(clipLayerRef.current.style as any).webkitClipPath = `inset(0 ${100 - clamped}% 0 0 round 28px 0 0 28px)`;
|
||||
}
|
||||
if (handleRef.current) {
|
||||
handleRef.current.setAttribute('aria-valuenow', `${Math.round(clamped)}`);
|
||||
@@ -465,7 +451,10 @@ function ToolWindowMedia({ item, isHovered }: { item: ToolMediaItem; isHovered:
|
||||
// 1. VIDEO (Strictly locked to fixed 680px centered width - ZERO ZOOM)
|
||||
if (item.mediaType === 'video' && item.videoUrl) {
|
||||
return (
|
||||
<div className="relative w-full h-full overflow-hidden bg-slate-950">
|
||||
<div
|
||||
style={{ borderRadius: '28px' }}
|
||||
className="relative w-full h-full overflow-hidden bg-slate-950 rounded-[28px] sm:rounded-[36px] isolate [mask-image:radial-gradient(white,black)] [-webkit-mask-image:-webkit-radial-gradient(white,black)]"
|
||||
>
|
||||
<video
|
||||
ref={videoRef}
|
||||
src={item.videoUrl}
|
||||
@@ -475,10 +464,14 @@ function ToolWindowMedia({ item, isHovered }: { item: ToolMediaItem; isHovered:
|
||||
loop
|
||||
playsInline
|
||||
preload="auto"
|
||||
className="absolute inset-y-0 left-1/2 -translate-x-1/2 h-full w-[680px] max-w-none object-cover pointer-events-none transform-gpu will-change-transform [backface-visibility:hidden]"
|
||||
style={{ borderRadius: '28px' }}
|
||||
className="absolute inset-y-0 left-1/2 -translate-x-1/2 h-full w-[680px] max-w-none object-cover pointer-events-none [backface-visibility:hidden]"
|
||||
/>
|
||||
{/* GPU-composited overlay (opacity only) */}
|
||||
<div className="absolute inset-0 bg-slate-950/10 opacity-100 group-hover:opacity-0 transition-opacity duration-700 ease-[cubic-bezier(0.16,1,0.3,1)] pointer-events-none" />
|
||||
<div
|
||||
style={{ borderRadius: '28px' }}
|
||||
className="absolute inset-0 bg-slate-950/10 opacity-100 group-hover:opacity-0 transition-opacity duration-700 ease-[cubic-bezier(0.16,1,0.3,1)] pointer-events-none"
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -494,29 +487,36 @@ function ToolWindowMedia({ item, isHovered }: { item: ToolMediaItem; isHovered:
|
||||
onMouseMove={handleContainerPointerMove}
|
||||
onPointerLeave={handleContainerPointerLeave}
|
||||
onMouseLeave={handleContainerPointerLeave}
|
||||
style={{ touchAction: 'pan-y' }}
|
||||
className="relative w-full h-full select-none overflow-hidden bg-slate-950 transform-gpu [backface-visibility:hidden] cursor-ew-resize"
|
||||
style={{
|
||||
touchAction: 'pan-y',
|
||||
borderRadius: '28px',
|
||||
}}
|
||||
className="relative w-full h-full select-none overflow-hidden bg-slate-950 rounded-[28px] sm:rounded-[36px] isolate [mask-image:radial-gradient(white,black)] [-webkit-mask-image:-webkit-radial-gradient(white,black)] cursor-ew-resize"
|
||||
>
|
||||
{/* Layer 1: AFTER Image (Base layer, fixed scale & position, 0% zoom) */}
|
||||
<img
|
||||
src={item.afterUrl}
|
||||
alt="After"
|
||||
className="absolute inset-y-0 left-1/2 -translate-x-1/2 h-full w-[680px] max-w-none object-cover pointer-events-none transform-gpu will-change-transform [backface-visibility:hidden]"
|
||||
style={{ borderRadius: '28px' }}
|
||||
className="absolute inset-y-0 left-1/2 -translate-x-1/2 h-full w-[680px] max-w-none object-cover pointer-events-none [backface-visibility:hidden]"
|
||||
loading="lazy"
|
||||
/>
|
||||
|
||||
{/* Layer 2: BEFORE Image (Clipped container-sized layer - 100% exact alignment with slider divider on phone & desktop) */}
|
||||
<div
|
||||
ref={clipLayerRef}
|
||||
className="absolute inset-0 overflow-hidden pointer-events-none transform-gpu will-change-transform [backface-visibility:hidden]"
|
||||
className="absolute inset-0 overflow-hidden rounded-[28px] sm:rounded-[36px] isolate [mask-image:radial-gradient(white,black)] [-webkit-mask-image:-webkit-radial-gradient(white,black)] pointer-events-none"
|
||||
style={{
|
||||
clipPath: 'inset(0 50% 0 0)',
|
||||
borderRadius: '28px',
|
||||
clipPath: 'inset(0 50% 0 0 round 28px 0 0 28px)',
|
||||
WebkitClipPath: 'inset(0 50% 0 0 round 28px 0 0 28px)',
|
||||
}}
|
||||
>
|
||||
<img
|
||||
src={item.beforeUrl}
|
||||
alt="Before"
|
||||
className="absolute inset-y-0 left-1/2 -translate-x-1/2 h-full w-[680px] max-w-none object-cover pointer-events-none transform-gpu will-change-transform [backface-visibility:hidden]"
|
||||
style={{ borderRadius: '28px' }}
|
||||
className="absolute inset-y-0 left-1/2 -translate-x-1/2 h-full w-[680px] max-w-none object-cover pointer-events-none [backface-visibility:hidden]"
|
||||
loading="lazy"
|
||||
/>
|
||||
</div>
|
||||
@@ -565,15 +565,22 @@ function ToolWindowMedia({ item, isHovered }: { item: ToolMediaItem; isHovered:
|
||||
|
||||
// 3. PHOTO (Strictly locked to fixed 680px centered width - ZERO ZOOM)
|
||||
return (
|
||||
<div className="relative w-full h-full overflow-hidden bg-slate-950">
|
||||
<div
|
||||
style={{ borderRadius: '28px' }}
|
||||
className="relative w-full h-full overflow-hidden bg-slate-950 rounded-[28px] sm:rounded-[36px] isolate [mask-image:radial-gradient(white,black)] [-webkit-mask-image:-webkit-radial-gradient(white,black)]"
|
||||
>
|
||||
<img
|
||||
src={item.imageUrl || item.afterUrl || item.beforeUrl || '/brand/og-default.png'}
|
||||
alt={item.title}
|
||||
className="absolute inset-y-0 left-1/2 -translate-x-1/2 h-full w-[680px] max-w-none object-cover pointer-events-none transform-gpu will-change-transform [backface-visibility:hidden]"
|
||||
style={{ borderRadius: '28px' }}
|
||||
className="absolute inset-y-0 left-1/2 -translate-x-1/2 h-full w-[680px] max-w-none object-cover pointer-events-none [backface-visibility:hidden]"
|
||||
loading="lazy"
|
||||
/>
|
||||
{/* GPU-composited overlay (opacity only) */}
|
||||
<div className="absolute inset-0 bg-slate-950/10 opacity-100 group-hover:opacity-0 transition-opacity duration-700 ease-[cubic-bezier(0.16,1,0.3,1)] pointer-events-none" />
|
||||
<div
|
||||
style={{ borderRadius: '28px' }}
|
||||
className="absolute inset-0 bg-slate-950/10 opacity-100 group-hover:opacity-0 transition-opacity duration-700 ease-[cubic-bezier(0.16,1,0.3,1)] pointer-events-none"
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user