import { useState } from 'react'; import { motion, AnimatePresence } from 'framer-motion'; import { Hand, Sun, Eye, ArrowRight, X } from 'lucide-react'; interface Props { onComplete: () => void; } const STEPS = [ { icon: Hand, title: 'Position Your Hand', body: 'Hold your hand 30–60 cm from the camera with the palm facing forward. Make sure all five fingers are clearly visible.', color: '#00f5d4', }, { icon: Sun, title: 'Check Your Lighting', body: 'Ensure your hand is well-lit from the front. Avoid strong back-lighting or dark backgrounds for best accuracy.', color: '#fee440', }, { icon: Eye, title: 'Sign Clearly', body: 'Form each Gujarati sign deliberately. The system detects one hand at a time. Signs appear instantly in the HUD.', color: '#9b5de5', }, ] as const; const variants = { enter: (dir: number) => ({ x: dir > 0 ? 80 : -80, opacity: 0 }), center: { x: 0, opacity: 1 }, exit: (dir: number) => ({ x: dir > 0 ? -80 : 80, opacity: 0 }), }; /** * 3-step animated onboarding wizard shown on first visit. */ export function OnboardingGuide({ onComplete }: Props) { const [step, setStep] = useState(0); const [dir, setDir] = useState(1); const go = (next: number) => { setDir(next > step ? 1 : -1); setStep(next); }; const { icon: Icon, title, body, color } = STEPS[step]; return (
{/* Skip / close */} {/* Step indicator */}
{STEPS.map((_, i) => (
))}
{/* Animated step content */}

{title}

{body}

{/* Navigation */}
{step > 0 ? ( ) :
} {step < STEPS.length - 1 ? ( ) : ( )}
); }