function Testimonials() { const items = [ { name: 'Mia', role: 'Personal brand', initial: 'M', from: '#f472b6', to: '#9d174d', caption: ['feels ', 'effortless'], tone: 'e', wistia: 'gtb75gvmzd' }, { name: 'Raphael Goop', role: 'Founder, Goop Studios', initial: 'RG', from: '#4a8eff', to: '#1a3a8e', caption: ['inbound leads ', 'tripled'], tone: 'a' }, { name: 'Brennan Vitali', role: 'CEO, Vitali Group', initial: 'BV', from: '#a78bfa', to: '#5b21b6', caption: ['drives ', 'qualified calls'], tone: 'b' }, { name: 'Justin Godsey', role: 'Creator', initial: 'JG', from: '#34d399', to: '#065f46', caption: ['best ', 'decision'], tone: 'c' }, { name: 'Matthew Reyes', role: 'Coach', initial: 'MR', from: '#fbbf24', to: '#92400e', caption: ['feels ', 'premium'], tone: 'd' }, { name: 'Haya Bitar', role: 'Personal brand', initial: 'HB', from: '#f472b6', to: '#9d174d', caption: ['reach is ', 'up 4x'], tone: 'e' }, { name: 'Tina Chen', role: 'Founder', initial: 'TC', from: '#22d3ee', to: '#0e7490', caption: ['my ', 'go-to'], tone: 'f' }, { name: 'Marcus Lane', role: 'Operator', initial: 'ML', from: '#fb7185', to: '#9f1239', caption: ['changed ', 'everything'], tone: 'g' }, { name: 'Priya Shah', role: 'Consultant', initial: 'PS', from: '#60a5fa', to: '#1e40af', caption: ['just ', 'flowed'], tone: 'h' }, ]; const [index, setIndex] = useState(0); const [perView, setPerView] = useState(3); const [isMobile, setIsMobile] = useState(false); const [trackW, setTrackW] = useState(0); const [playing, setPlaying] = useState(null); const [withTransition, setWithTransition] = useState(true); const [hovered, setHovered] = useState(false); const trackRef = useRef(null); useEffect(() => { if (document.getElementById('wistia-script')) return; const s = document.createElement('script'); s.id = 'wistia-script'; s.src = 'https://fast.wistia.com/assets/external/E-v1.js'; s.async = true; document.body.appendChild(s); }, []); // Auto-advance — pauses while hovered or while a video is playing useEffect(() => { if (hovered || playing !== null) return; const t = setInterval(() => { setWithTransition(true); setIndex(i => i + 1); }, 4500); return () => clearInterval(t); }, [hovered, playing]); useEffect(() => { const update = () => { const w = window.innerWidth; setIsMobile(w <= 640); if (w <= 640) setPerView(2); else if (w <= 1024) setPerView(2.5); else setPerView(3.5); const vp = trackRef.current?.parentElement?.clientWidth || 0; setTrackW(vp); }; update(); window.addEventListener('resize', update); return () => window.removeEventListener('resize', update); }, []); const fullVisible = Math.floor(perView); const safeIndex = index; // Double the track so we can wrap seamlessly const loopItems = useMemo(() => [...items, ...items], []); const offsetPx = useMemo(() => { const gapPx = 18; const viewport = trackW || trackRef.current?.parentElement?.clientWidth || 0; if (!viewport) return 0; const cardWidth = (viewport - gapPx * Math.floor(perView)) / perView; const quarterPeek = (perView % 1 === 0) ? 0 : (cardWidth + gapPx) / 4; return -(safeIndex * (cardWidth + gapPx) + quarterPeek); }, [safeIndex, perView, trackW]); // After a transition into the second copy, snap back invisibly const onTransitionEnd = () => { if (safeIndex >= items.length) { setWithTransition(false); setIndex(safeIndex - items.length); } }; const goNext = () => { setWithTransition(true); setIndex(i => i + 1); }; const goPrev = () => { if (safeIndex === 0) { // jump to mirror position in the second copy without animation, then animate back one setWithTransition(false); setIndex(items.length); requestAnimationFrame(() => requestAnimationFrame(() => { setWithTransition(true); setIndex(items.length - 1); })); } else { setWithTransition(true); setIndex(i => i - 1); } }; const dots = Array.from({ length: items.length }); const toneBg = (tone) => ({ a: 'linear-gradient(135deg, #1a2848 0%, #0a0e18 100%)', b: 'linear-gradient(135deg, #2a1f48 0%, #0a0e18 100%)', c: 'linear-gradient(135deg, #1a3328 0%, #0a0e18 100%)', d: 'linear-gradient(135deg, #3a2a18 0%, #0a0e18 100%)', e: 'linear-gradient(135deg, #3a1f33 0%, #0a0e18 100%)', f: 'linear-gradient(135deg, #163844 0%, #0a0e18 100%)', g: 'linear-gradient(135deg, #3a1820 0%, #0a0e18 100%)', h: 'linear-gradient(135deg, #1c2848 0%, #0a0e18 100%)', }[tone] || '#0a0e18'); return (

Hear What They're
Saying About Us

setHovered(true)} onMouseLeave={() => setHovered(false)}> {/* Nav buttons */} {/* Viewport */}
{loopItems.map((t, i) => { const logical = i % items.length; return (
{ if (t.wistia && playing !== i) setPlaying(i); }} style={{ position: 'relative', flex: `0 0 calc((100% - (18px * ${Math.floor(perView)})) / ${perView})`, aspectRatio: '9 / 16', borderRadius: 22, overflow: 'hidden', background: toneBg(t.tone), border: '1px solid var(--line)', boxShadow: '0 24px 60px -20px rgba(0,0,0,0.6)', cursor: t.wistia ? 'pointer' : 'default', transition: 'transform 0.3s ease, border-color 0.3s ease', }} className="lift" > {playing === i && t.wistia ? (
 
) : ( <> {t.wistia ? ( {t.name} ) : ( /* Striped placeholder so it reads as "video to drop in" */
)}
{/* Top-left label removed for cleaner look */} {/* Play button */}
{/* Caption pill */}
{t.caption[0]}{t.caption[1]}
{/* Person pill */}
{t.initial}
{t.name}
{t.role}
)}
); })}
{/* Dots */}
{dots.map((_, i) => { const activeLogical = safeIndex % items.length; const isActive = i === activeLogical; return (
); } Object.assign(window, { Testimonials });