'use client' import { useEffect, useMemo, useState } from 'react' import Image from 'next/image' import { motion, AnimatePresence } from 'framer-motion' import { wrap } from 'popmotion' import { Button } from '@/components/Button' const galleryItems = [ { text: 'Navigate and interact with any web interface', image: '/images/interface.png' }, { text: 'Process documents across all formats', image: '/images/docs.png' }, { text: 'Execute multi-step workflows autonomously', image: '/images/flow.png' }, { text: 'Manage calendars, emails, and tasks', image: '/images/calendar.png' }, { text: 'Perform deep semantic search across all data sources', image: '/images/data.png' }, { text: 'Identify patterns in complex datasets', image: '/images/datasets.png' }, { text: 'Provide real-time market intelligence', image: '/images/market.png' }, { text: 'Generate and debug code in multiple languages', image: '/images/code.png' }, { text: 'Create consistent branded content', image: '/images/branding.png' }, { text: 'Translate and localize materials', image: '/images/translate.png' }, { text: 'Transform and migrate data structures', image: '/images/structure.png' }, ] // 🔧 Carousel Config const VISIBLE = 4 const CARD_SIZE = 450 // square size on desktop const GAP = 380 // spacing for larger cards const ROT_Y = 18 const DEPTH = 260 const SCALE_DROP = 0.12 const AUTOPLAY_MS = 3200 export function ClickableGallery() { const [active, setActive] = useState(0) const [hovering, setHovering] = useState(false) // autoplay useEffect(() => { if (hovering) return const id = setInterval(() => setActive((i) => wrap(0, galleryItems.length, i + 1)), AUTOPLAY_MS) return () => clearInterval(id) }, [hovering]) const indices = useMemo( () => [...Array(VISIBLE * 2 + 1)].map((_, i) => wrap(0, galleryItems.length, active + i - VISIBLE)), [active] ) const next = () => setActive((i) => wrap(0, galleryItems.length, i + 1)) const prev = () => setActive((i) => wrap(0, galleryItems.length, i - 1)) return ( <>