"use client"; import { AnimatePresence, motion, useScroll, useTransform } from "motion/react"; import { useRef } from "react"; import { ExpandedGifOverlay, useExpandedGif } from "@/components/ui/expanded-gif-overlay"; const walkthroughSteps = [ { step: 1, title: "Login", description: "Login to get started.", src: "/homepage/hero_tutorial/LoginFlowGif.gif", }, { step: 2, title: "Connect & Sync", description: "Connect your connectors and sync. Enable periodic syncing to keep them updated.", src: "/homepage/hero_tutorial/ConnectorFlowGif.gif", }, { step: 3, title: "Upload Documents", description: "While connectors index, upload your documents directly.", src: "/homepage/hero_tutorial/DocUploadGif.gif", }, ]; function WalkthroughCard({ i, step, title, description, src, progress, range, targetScale, }: { i: number; step: number; title: string; description: string; src: string; progress: ReturnType["scrollYProgress"]; range: [number, number]; targetScale: number; }) { const container = useRef(null); const scale = useTransform(progress, range, [1, targetScale]); const { expanded, open, close } = useExpandedGif(); return ( <>
{step}

{title}

{description}

{title}
{expanded && } ); } function WalkthroughScroll() { const container = useRef(null); const { scrollYProgress } = useScroll({ target: container, offset: ["start start", "end end"], }); return (
{walkthroughSteps.map((project, i) => { const targetScale = Math.max(0.6, 1 - (walkthroughSteps.length - i - 1) * 0.05); return ( ); })}
); } export { WalkthroughScroll, WalkthroughCard };