'use client'; import { motion, useReducedMotion } from 'framer-motion'; import { useState, useEffect } from 'react'; export default function TeamCompetitionMockup() { const shouldReduceMotion = useReducedMotion(); const [hoveredDriver, setHoveredDriver] = useState(null); const [hoveredTeam, setHoveredTeam] = useState(null); const [isMobile, setIsMobile] = useState(false); useEffect(() => { setIsMobile(window.innerWidth < 768); }, []); const teamColors = ['#198CFF', '#6FE37A', '#FFC556', '#43C9E6', '#9333EA']; if (isMobile) { return (
Drivers
{[1, 2, 3].map((i) => (
{i}
🏎️
))}
Constructors
{[1, 2, 3].map((i) => (
🏁
))}
); } const leftColumnVariants = { hidden: { opacity: 0, x: shouldReduceMotion ? 0 : -20 }, visible: { opacity: 1, x: 0, transition: { type: 'spring' as const, stiffness: 100, damping: 20 } } }; const rightColumnVariants = { hidden: { opacity: 0, x: shouldReduceMotion ? 0 : 20 }, visible: { opacity: 1, x: 0, transition: { type: 'spring' as const, stiffness: 100, damping: 20 } } }; const rowVariants = { hidden: { opacity: 0, scale: shouldReduceMotion ? 1 : 0.95 }, visible: (i: number) => ({ opacity: 1, scale: 1, transition: { delay: shouldReduceMotion ? 0 : 0.3 + i * 0.05, type: 'spring' as const, stiffness: 300, damping: 25 } }) }; return (
Drivers
{[1, 2, 3, 4, 5].map((i) => ( !shouldReduceMotion && setHoveredDriver(i)} onHoverEnd={() => setHoveredDriver(null)} whileHover={shouldReduceMotion ? {} : { scale: 1.02, boxShadow: `0 0 20px ${teamColors[i-1]}40`, transition: { duration: 0.15 } }} >
{i}
🏎️
{hoveredDriver === i && ( )} ))}
Constructors
{[1, 2, 3, 4, 5].map((i) => ( !shouldReduceMotion && setHoveredTeam(i)} onHoverEnd={() => setHoveredTeam(null)} whileHover={shouldReduceMotion ? {} : { scale: 1.02, boxShadow: `0 0 20px ${teamColors[i-1]}40`, transition: { duration: 0.15 } }} >
🏁
{i === 3 && (
=
)} {hoveredTeam === i && ( )} ))}
); }