'use client'; import { useEffect, useRef, useState } from 'react'; import { ArrowLeft, ArrowRight, AtSign, CircleUserRound, Globe2, } from 'lucide-react'; import Image from 'next/image'; import Link from 'next/link'; import * as Badge from '@/components/ui/badge'; import { cn } from '@/utils/cn'; const teamData = [ { id: 'member1', name: 'James Turner', role: 'Brand Strategy Director', image: 'https://alignui.com/images/blocks/teams-5-image-4.png', socials: { instagram: '/', facebook: '/', twitter: '/', }, }, { id: 'member5', name: 'Sarah Bennett', role: 'Brand Strategy Director', image: 'https://alignui.com/images/blocks/teams-5-image-5.png', socials: { instagram: '/', facebook: '/', twitter: '/', }, }, { id: 'member6', name: 'Daniel Kim', role: 'Creative Marketing Partner', image: 'https://alignui.com/images/blocks/teams-5-image-6.png', socials: { instagram: '/', facebook: '/', twitter: '/', }, }, { id: 'member7', name: 'Sophia Williams', role: 'Experience Innovation Lead', image: 'https://alignui.com/images/blocks/teams-5-image-7.png', socials: { instagram: '/', facebook: '/', twitter: '/', }, }, { id: 'member4', name: 'Emily Park', role: 'Digital Solutions Expert', image: 'https://alignui.com/images/blocks/teams-5-image-1.png', socials: { instagram: '/', facebook: '/', twitter: '/', }, }, { id: 'member2', name: 'Ommar Johnson', role: 'Product Designer', image: 'https://alignui.com/images/blocks/teams-5-image-2.png', socials: { instagram: '/', facebook: '/', twitter: '/', }, }, { id: 'member3', name: 'Emma Wright', role: 'Experience Innovation Lead', image: 'https://alignui.com/images/blocks/teams-5-image-3.png', socials: { instagram: '/', facebook: '/', twitter: '/', }, }, ]; const DESKTOP_SLOTS = [ { offset: -3, w: 156, h: 180, y: 0, radius: 'rounded-[28px]', bg: 'bg-pink-100', }, { offset: -2, w: 156, h: 180, y: 80, radius: 'rounded-[28px]', bg: 'bg-neutral-200', }, { offset: -1, w: 156, h: 180, y: 0, radius: 'rounded-[28px]', bg: 'bg-green-100', }, { offset: 0, w: 296, h: 342, y: 0, radius: 'rounded-[40px]', bg: 'bg-blue-100', }, { offset: 1, w: 156, h: 180, y: 0, radius: 'rounded-[28px]', bg: 'bg-orange-100', }, { offset: 2, w: 156, h: 180, y: 80, radius: 'rounded-[28px]', bg: 'bg-purple-100', }, { offset: 3, w: 156, h: 180, y: 0, radius: 'rounded-[28px]', bg: 'bg-yellow-100', }, ]; const MOBILE_SLOTS = [ { offset: -3, w: 120, h: 120, y: 0, radius: 'rounded-[20px]', bg: 'bg-pink-100', }, { offset: -2, w: 120, h: 120, y: 0, radius: 'rounded-[20px]', bg: 'bg-neutral-200', }, { offset: -1, w: 120, h: 120, y: 0, radius: 'rounded-[20px]', bg: 'bg-green-100', }, { offset: 0, w: 220, h: 220, y: 0, radius: 'rounded-[24px]', bg: 'bg-blue-100', }, { offset: 1, w: 120, h: 120, y: 0, radius: 'rounded-[20px]', bg: 'bg-orange-100', }, { offset: 2, w: 120, h: 120, y: 0, radius: 'rounded-[20px]', bg: 'bg-purple-100', }, { offset: 3, w: 120, h: 120, y: 0, radius: 'rounded-[20px]', bg: 'bg-yellow-100', }, ]; export default function ProgressMakersTeamCarousel() { const [activeIndex, setActiveIndex] = useState(0); const previousActiveIndexRef = useRef(0); const [isMobile, setIsMobile] = useState(false); useEffect(() => { const mediaQuery = window.matchMedia('(max-width: 1023px)'); const handleChange = (event: MediaQueryListEvent) => { setIsMobile(event.matches); }; setIsMobile(mediaQuery.matches); mediaQuery.addEventListener('change', handleChange); return () => mediaQuery.removeEventListener('change', handleChange); }, []); useEffect(() => { previousActiveIndexRef.current = activeIndex; }, [activeIndex]); const handlePrevious = () => { setActiveIndex( (previous) => (previous - 1 + teamData.length) % teamData.length, ); }; const handleNext = () => { setActiveIndex((previous) => (previous + 1) % teamData.length); }; const activeMember = teamData[activeIndex]; const slots = isMobile ? MOBILE_SLOTS : DESKTOP_SLOTS; const activeHeight = isMobile ? 220 : 342; const gap = isMobile ? 16 : 24; return (
Inspiring change, breaking molds, and fostering teamwork.