"use client"; import { useEffect, useRef, useState } from "react"; import { AnimatePresence, motion } from "framer-motion"; import AnimatedButton from "@/components/ui/AnimatedButton"; import { ArrowRight } from "@/components/ui/icons"; /** * Testimonials — immersive stage. One cinematic full-width panel: the active * client's video fills the stage, their quote overlays it bottom-left, * playback + navigation live on the frame, and circular avatar tabs (top * right) switch clients. Auto-advances; pauses while a video plays. * Placeholder videos/quotes — swap with real client clips. */ const TESTIMONIALS = [ { src: "/videos/Technology.mp4", poster: "/images/opt/HeroBanner1.webp", name: "Priya Sharma", role: "Founder, Fintech startup", quote: "Cerkel took us from a whiteboard sketch to a live product in fourteen weeks — and it hasn't missed a beat since.", metric: { value: "14 wks", label: "idea to launch" }, }, { src: "/videos/Technology1.mp4", poster: "/images/opt/HeroBanner2.webp", name: "Daniel Reyes", role: "Product Lead, SaaS", quote: "The team thinks like owners. They challenged our roadmap where it mattered and shipped exactly what our users needed.", metric: { value: "2.4×", label: "user activation" }, }, { src: "/videos/Technology.mp4", poster: "/images/opt/HeroBanner3.png", name: "Aisha Khan", role: "COO, Logistics platform", quote: "Our AI assistant now handles half of our support volume. Cerkel made the complex feel simple.", metric: { value: "−50%", label: "support tickets" }, }, ]; const EASE = [0.21, 0.47, 0.32, 0.98]; const rise = { hidden: { opacity: 0, y: 36 }, show: { opacity: 1, y: 0, transition: { duration: 0.6, ease: EASE } }, }; const quoteStagger = { hidden: {}, show: { transition: { staggerChildren: 0.09, delayChildren: 0.2 } } }; const lineUp = { hidden: { opacity: 0, y: 24 }, show: { opacity: 1, y: 0, transition: { duration: 0.5, ease: EASE } }, }; function Stars({ className = "h-4 w-4" }) { return ( {Array.from({ length: 5 }).map((_, i) => ( ))} ); } function PlayIcon({ className = "h-5 w-5" }) { return ( ); } function PauseIcon({ className = "h-5 w-5" }) { return ( ); } export default function Testimonials() { const [active, setActive] = useState(0); const [playing, setPlaying] = useState(false); const videoRef = useRef(null); const len = TESTIMONIALS.length; const t = TESTIMONIALS[active]; const go = (i) => { setPlaying(false); setActive((i + len) % len); }; // Auto-advance unless a video is playing. useEffect(() => { if (playing) return; const id = setTimeout(() => go(active + 1), 7000); return () => clearTimeout(id); }, [active, playing]); const togglePlay = () => { const vid = videoRef.current; if (!vid) return; if (playing) { vid.pause(); setPlaying(false); } else { vid.muted = false; vid.play(); setPlaying(true); } }; return (
{/* Header */} Testimonials

Hear it from{" "} the teams themselves.

{/* Immersive stage */} {/* Media layers — poster crossfade; video element for the active one */}
{TESTIMONIALS.map((item, i) => ( {i === active ? ( ))} {/* washes for legibility */} {/* Avatar tabs — top right */}
{TESTIMONIALS.map((item, i) => ( ))}
{/* Quote overlay — bottom left */}
{t.metric.value} {t.metric.label} “{t.quote}” {t.name .split(" ") .map((n) => n[0]) .join("")} {t.name} {t.role}
{/* Controls — bottom right */}
{/* progress — thin bar along the very bottom */}
{!playing && (
)}
{/* CTA */} Become our next story
); }