website refactor
This commit is contained in:
@@ -2,8 +2,11 @@
|
||||
|
||||
import { motion, useReducedMotion } from 'framer-motion';
|
||||
import { useState, useEffect } from 'react';
|
||||
import { Box } from '@/ui/Box';
|
||||
import { Text } from '@/ui/Text';
|
||||
import { Stack } from '@/ui/Stack';
|
||||
|
||||
export default function CareerProgressionMockup() {
|
||||
export function CareerProgressionMockup() {
|
||||
const shouldReduceMotion = useReducedMotion();
|
||||
const [isMobile, setIsMobile] = useState(false);
|
||||
|
||||
@@ -22,141 +25,191 @@ export default function CareerProgressionMockup() {
|
||||
// Simple mobile version - just the essence
|
||||
if (isMobile) {
|
||||
return (
|
||||
<div className="relative w-full h-full bg-gradient-to-br from-deep-graphite to-iron-gray rounded-lg p-4 overflow-hidden flex items-center justify-center">
|
||||
<motion.div
|
||||
<Box position="relative" fullWidth fullHeight bg="bg-gradient-to-br from-deep-graphite to-iron-gray" rounded="lg" p={4} overflow="hidden" display="flex" alignItems="center" justifyContent="center">
|
||||
<Box
|
||||
as={motion.div}
|
||||
initial="hidden"
|
||||
animate="visible"
|
||||
variants={{
|
||||
visible: { transition: { staggerChildren: 0.1 } }
|
||||
}}
|
||||
className="space-y-4 w-full"
|
||||
w="full"
|
||||
>
|
||||
{/* Clean stat cards */}
|
||||
<motion.div variants={itemVariants} className="grid grid-cols-3 gap-3">
|
||||
{[
|
||||
{ value: '24', label: 'Wins' },
|
||||
{ value: '48', label: 'Podiums' },
|
||||
{ value: '156', label: 'Races' }
|
||||
].map((stat, i) => (
|
||||
<div key={i} className="bg-iron-gray/60 rounded-lg p-3 border border-primary-blue/20 text-center">
|
||||
<div className="text-2xl font-bold text-primary-blue font-mono">{stat.value}</div>
|
||||
<div className="text-[11px] text-white/50 mt-1">{stat.label}</div>
|
||||
</div>
|
||||
))}
|
||||
</motion.div>
|
||||
<Stack gap={4}>
|
||||
{/* Clean stat cards */}
|
||||
<Box as={motion.div} variants={itemVariants} display="grid" gridCols={3} gap={3}>
|
||||
{[
|
||||
{ value: '24', label: 'Wins' },
|
||||
{ value: '48', label: 'Podiums' },
|
||||
{ value: '156', label: 'Races' }
|
||||
].map((stat, i) => (
|
||||
<Box key={i} bg="bg-iron-gray/60" rounded="lg" p={3} border borderColor="border-primary-blue/20" textAlign="center">
|
||||
<Text size="2xl" weight="bold" color="text-primary-blue" font="mono" block>{stat.value}</Text>
|
||||
<Text
|
||||
// eslint-disable-next-line gridpilot-rules/component-classification
|
||||
style={{ fontSize: '11px' }}
|
||||
color="text-white"
|
||||
opacity={0.5}
|
||||
mt={1}
|
||||
block
|
||||
>
|
||||
{stat.label}
|
||||
</Text>
|
||||
</Box>
|
||||
))}
|
||||
</Box>
|
||||
|
||||
{/* Single elegant season card */}
|
||||
<motion.div variants={itemVariants}>
|
||||
<div className="bg-iron-gray/40 rounded-lg p-3 border border-charcoal-outline">
|
||||
<div className="flex items-center justify-between">
|
||||
<span className="text-sm text-white/70">GT3 Championship</span>
|
||||
<span className="px-2.5 py-1 bg-performance-green/20 rounded text-xs text-performance-green font-semibold">P2</span>
|
||||
</div>
|
||||
</div>
|
||||
</motion.div>
|
||||
</motion.div>
|
||||
</div>
|
||||
{/* Single elegant season card */}
|
||||
<Box as={motion.div} variants={itemVariants}>
|
||||
<Box bg="bg-iron-gray/40" rounded="lg" p={3} border borderColor="border-charcoal-outline">
|
||||
<Box display="flex" alignItems="center" justifyContent="between">
|
||||
<Text size="sm" color="text-white" opacity={0.7}>GT3 Championship</Text>
|
||||
<Box as="span" px={2.5} py={1} bg="bg-performance-green/20" rounded="sm">
|
||||
<Text size="xs" color="text-performance-green" weight="semibold">P2</Text>
|
||||
</Box>
|
||||
</Box>
|
||||
</Box>
|
||||
</Box>
|
||||
</Stack>
|
||||
</Box>
|
||||
</Box>
|
||||
);
|
||||
}
|
||||
|
||||
// Desktop version - more detailed
|
||||
return (
|
||||
<div className="relative w-full h-full bg-gradient-to-br from-deep-graphite via-iron-gray to-deep-graphite rounded-lg p-1.5 sm:p-3 md:p-5 lg:p-8 overflow-hidden">
|
||||
<motion.div
|
||||
<Box position="relative" fullWidth fullHeight bg="bg-gradient-to-br from-deep-graphite via-iron-gray to-deep-graphite" rounded="lg" p={{ base: 1.5, sm: 3, md: 5, lg: 8 }} overflow="hidden">
|
||||
<Box
|
||||
as={motion.div}
|
||||
initial="hidden"
|
||||
animate="visible"
|
||||
variants={{
|
||||
visible: { transition: { staggerChildren: shouldReduceMotion ? 0 : 0.08 } }
|
||||
}}
|
||||
className="space-y-1.5 sm:space-y-3 md:space-y-4 lg:space-y-6"
|
||||
>
|
||||
{/* Driver Header */}
|
||||
<motion.div variants={itemVariants} className="flex items-center gap-1.5 sm:gap-2 md:gap-3 lg:gap-4 pb-1.5 sm:pb-3 md:pb-4 lg:pb-6 border-b border-charcoal-outline">
|
||||
<div className="h-8 w-8 sm:h-10 sm:w-10 md:h-12 md:w-12 lg:h-16 lg:w-16 bg-charcoal-outline rounded-full border-2 border-primary-blue/30 flex items-center justify-center text-base sm:text-xl md:text-2xl lg:text-3xl overflow-hidden">
|
||||
🏎️
|
||||
</div>
|
||||
<div className="flex-1">
|
||||
<div className="text-[9px] sm:text-xs md:text-sm font-semibold text-white/90 mb-1 sm:mb-1.5 md:mb-2">Your Racing Identity</div>
|
||||
<div className="flex items-center gap-1 sm:gap-2 md:gap-3">
|
||||
<span className="text-[8px] sm:text-[10px] md:text-xs text-primary-blue/70">Multi-league profile</span>
|
||||
<span className="text-[8px] sm:text-[10px] md:text-xs text-performance-green/70">Career tracking</span>
|
||||
</div>
|
||||
</div>
|
||||
</motion.div>
|
||||
<Stack gap={{ base: 1.5, sm: 3, md: 4, lg: 6 }}>
|
||||
{/* Driver Header */}
|
||||
<Box as={motion.div} variants={itemVariants} display="flex" alignItems="center" gap={{ base: 1.5, sm: 2, md: 3, lg: 4 }} pb={{ base: 1.5, sm: 3, md: 4, lg: 6 }} borderBottom borderColor="border-charcoal-outline">
|
||||
<Box h={{ base: 8, sm: 10, md: 12, lg: 16 }} w={{ base: 8, sm: 10, md: 12, lg: 16 }} bg="bg-charcoal-outline" rounded="full" border borderWidth="2px" borderColor="border-primary-blue/30" display="flex" alignItems="center" justifyContent="center" overflow="hidden">
|
||||
<Text size={{ base: 'base', sm: 'xl', md: '2xl', lg: '3xl' }}>🏎️</Text>
|
||||
</Box>
|
||||
<Box flexGrow={1}>
|
||||
<Text size={{ base: 'xs', sm: 'sm', md: 'base' }} weight="semibold" color="text-white" opacity={0.9} mb={{ base: 1, sm: 1.5, md: 2 }} block>Your Racing Identity</Text>
|
||||
<Box display="flex" alignItems="center" gap={{ base: 1, sm: 2, md: 3 }}>
|
||||
<Text
|
||||
// eslint-disable-next-line gridpilot-rules/component-classification
|
||||
style={{ fontSize: '10px' }}
|
||||
color="text-primary-blue"
|
||||
opacity={0.7}
|
||||
>
|
||||
Multi-league profile
|
||||
</Text>
|
||||
<Text
|
||||
// eslint-disable-next-line gridpilot-rules/component-classification
|
||||
style={{ fontSize: '10px' }}
|
||||
color="text-performance-green"
|
||||
opacity={0.7}
|
||||
>
|
||||
Career tracking
|
||||
</Text>
|
||||
</Box>
|
||||
</Box>
|
||||
</Box>
|
||||
|
||||
{/* Career Stats */}
|
||||
<motion.div variants={itemVariants}>
|
||||
<div className="text-[9px] sm:text-xs md:text-sm font-semibold text-white/60 mb-1 sm:mb-2 md:mb-3">Career Overview</div>
|
||||
<div className="grid grid-cols-3 gap-1 sm:gap-2 md:gap-3">
|
||||
{[
|
||||
{ label: 'Wins', value: '24' },
|
||||
{ label: 'Podiums', value: '48' },
|
||||
{ label: 'Races', value: '156' }
|
||||
].map((stat, i) => (
|
||||
<motion.div
|
||||
key={i}
|
||||
className="bg-iron-gray rounded-lg p-1 sm:p-2 md:p-3 border border-charcoal-outline"
|
||||
whileHover={shouldReduceMotion ? {} : {
|
||||
y: -2,
|
||||
boxShadow: '0 4px 16px rgba(0,0,0,0.3)',
|
||||
transition: { duration: 0.15 }
|
||||
}}
|
||||
>
|
||||
<div className="text-sm sm:text-base md:text-lg font-bold text-primary-blue font-mono mb-0.5">{stat.value}</div>
|
||||
<div className="text-[8px] sm:text-[10px] md:text-xs text-white/40">{stat.label}</div>
|
||||
</motion.div>
|
||||
))}
|
||||
</div>
|
||||
</motion.div>
|
||||
|
||||
{/* Season Timeline */}
|
||||
<motion.div variants={itemVariants}>
|
||||
<div className="text-[9px] sm:text-xs md:text-sm font-semibold text-white/60 mb-1 sm:mb-2 md:mb-3">Season History</div>
|
||||
<div className="space-y-1 sm:space-y-1.5 md:space-y-2">
|
||||
{[
|
||||
{ league: 'GT3 Championship', season: 'S3', position: 'P2', points: '248' },
|
||||
{ league: 'Endurance Series', season: 'S2', position: 'P1', points: '312' },
|
||||
{ league: 'Formula Sprint', season: 'S1', position: 'P5', points: '186' }
|
||||
].map((season, i) => (
|
||||
<motion.div
|
||||
key={i}
|
||||
className="flex items-center gap-1.5 sm:gap-2 md:gap-3 bg-iron-gray rounded-lg p-1.5 sm:p-2 md:p-3 border border-charcoal-outline"
|
||||
whileHover={shouldReduceMotion ? {} : {
|
||||
x: 4,
|
||||
boxShadow: '0 2px 12px rgba(25,140,255,0.2)',
|
||||
transition: { duration: 0.15 }
|
||||
}}
|
||||
>
|
||||
<div className="h-5 w-5 sm:h-6 sm:w-6 md:h-8 md:w-8 bg-charcoal-outline rounded border border-primary-blue/20 flex items-center justify-center text-xs sm:text-sm md:text-base">
|
||||
🏁
|
||||
</div>
|
||||
<div className="flex-1">
|
||||
<div className="text-[9px] sm:text-xs text-white/80 mb-0.5 sm:mb-1">{season.league}</div>
|
||||
<div className="text-[8px] sm:text-xs text-white/40">Season complete</div>
|
||||
</div>
|
||||
<div className="flex gap-1 sm:gap-1.5 md:gap-2">
|
||||
<div className="px-1 sm:px-1.5 md:px-2 py-0.5 bg-performance-green/20 rounded text-[8px] sm:text-[10px] md:text-xs text-performance-green font-semibold">{season.position}</div>
|
||||
<div className="px-1 sm:px-1.5 md:px-2 py-0.5 bg-primary-blue/20 rounded text-[8px] sm:text-[10px] md:text-xs text-primary-blue font-mono">{season.points}</div>
|
||||
</div>
|
||||
</motion.div>
|
||||
))}
|
||||
</div>
|
||||
</motion.div>
|
||||
|
||||
{/* Multi-League Badge */}
|
||||
<motion.div variants={itemVariants}>
|
||||
<div className="flex items-center gap-1 sm:gap-1.5 md:gap-2 bg-charcoal-outline rounded-lg p-1.5 sm:p-2 md:p-3 border border-primary-blue/30">
|
||||
<div className="flex -space-x-2">
|
||||
{[1, 2, 3].map((i) => (
|
||||
<div key={i} className="h-4 w-4 sm:h-5 sm:w-5 md:h-6 md:w-6 bg-iron-gray rounded-full border-2 border-charcoal-outline flex items-center justify-center text-[8px] sm:text-[10px] md:text-xs">
|
||||
🏆
|
||||
</div>
|
||||
{/* Career Stats */}
|
||||
<Box as={motion.div} variants={itemVariants}>
|
||||
<Text size={{ base: 'xs', sm: 'sm', md: 'base' }} weight="semibold" color="text-white" opacity={0.6} mb={{ base: 1, sm: 2, md: 3 }} block>Career Overview</Text>
|
||||
<Box display="grid" gridCols={3} gap={{ base: 1, sm: 2, md: 3 }}>
|
||||
{[
|
||||
{ label: 'Wins', value: '24' },
|
||||
{ label: 'Podiums', value: '48' },
|
||||
{ label: 'Races', value: '156' }
|
||||
].map((stat, i) => (
|
||||
<Box
|
||||
key={i}
|
||||
as={motion.div}
|
||||
bg="bg-iron-gray"
|
||||
rounded="lg"
|
||||
p={{ base: 1, sm: 2, md: 3 }}
|
||||
border
|
||||
borderColor="border-charcoal-outline"
|
||||
whileHover={shouldReduceMotion ? {} : {
|
||||
y: -2,
|
||||
boxShadow: '0 4px 16px rgba(0,0,0,0.3)',
|
||||
transition: { duration: 0.15 }
|
||||
}}
|
||||
>
|
||||
<Text size={{ base: 'sm', sm: 'base', md: 'lg' }} weight="bold" color="text-primary-blue" font="mono" mb={0.5} block>{stat.value}</Text>
|
||||
<Text size={{ base: 'xs', sm: 'sm' }} color="text-white" opacity={0.4} block>{stat.label}</Text>
|
||||
</Box>
|
||||
))}
|
||||
</div>
|
||||
<span className="text-[8px] sm:text-[10px] md:text-xs text-white/60">Active in 3 leagues across seasons</span>
|
||||
</div>
|
||||
</motion.div>
|
||||
</motion.div>
|
||||
</div>
|
||||
</Box>
|
||||
</Box>
|
||||
|
||||
{/* Season Timeline */}
|
||||
<Box as={motion.div} variants={itemVariants}>
|
||||
<Text size={{ base: 'xs', sm: 'sm', md: 'base' }} weight="semibold" color="text-white" opacity={0.6} mb={{ base: 1, sm: 2, md: 3 }} block>Season History</Text>
|
||||
<Stack gap={{ base: 1, sm: 1.5, md: 2 }}>
|
||||
{[
|
||||
{ league: 'GT3 Championship', season: 'S3', position: 'P2', points: '248' },
|
||||
{ league: 'Endurance Series', season: 'S2', position: 'P1', points: '312' },
|
||||
{ league: 'Formula Sprint', season: 'S1', position: 'P5', points: '186' }
|
||||
].map((season, i) => (
|
||||
<Box
|
||||
key={i}
|
||||
as={motion.div}
|
||||
display="flex"
|
||||
alignItems="center"
|
||||
gap={{ base: 1.5, sm: 2, md: 3 }}
|
||||
bg="bg-iron-gray"
|
||||
rounded="lg"
|
||||
p={{ base: 1.5, sm: 2, md: 3 }}
|
||||
border
|
||||
borderColor="border-charcoal-outline"
|
||||
whileHover={shouldReduceMotion ? {} : {
|
||||
x: 4,
|
||||
boxShadow: '0 2px 12px rgba(25,140,255,0.2)',
|
||||
transition: { duration: 0.15 }
|
||||
}}
|
||||
>
|
||||
<Box h={{ base: 5, sm: 6, md: 8 }} w={{ base: 5, sm: 6, md: 8 }} bg="bg-charcoal-outline" rounded border borderColor="border-primary-blue/20" display="flex" alignItems="center" justifyContent="center">
|
||||
<Text size={{ base: 'xs', sm: 'sm', md: 'base' }}>🏁</Text>
|
||||
</Box>
|
||||
<Box flexGrow={1}>
|
||||
<Text size={{ base: 'xs', sm: 'sm' }} color="text-white" opacity={0.8} mb={{ base: 0.5, sm: 1 }} block>{season.league}</Text>
|
||||
<Text size={{ base: 'xs', sm: 'sm' }} color="text-white" opacity={0.4} block>Season complete</Text>
|
||||
</Box>
|
||||
<Box display="flex" gap={{ base: 1, sm: 1.5, md: 2 }}>
|
||||
<Box as="span" px={{ base: 1, sm: 1.5, md: 2 }} py={0.5} bg="bg-performance-green/20" rounded="sm">
|
||||
<Text size={{ base: 'xs', sm: 'sm' }} color="text-performance-green" weight="semibold">{season.position}</Text>
|
||||
</Box>
|
||||
<Box as="span" px={{ base: 1, sm: 1.5, md: 2 }} py={0.5} bg="bg-primary-blue/20" rounded="sm">
|
||||
<Text size={{ base: 'xs', sm: 'sm' }} color="text-primary-blue" font="mono">{season.points}</Text>
|
||||
</Box>
|
||||
</Box>
|
||||
</Box>
|
||||
))}
|
||||
</Stack>
|
||||
</Box>
|
||||
|
||||
{/* Multi-League Badge */}
|
||||
<Box as={motion.div} variants={itemVariants}>
|
||||
<Box display="flex" alignItems="center" gap={{ base: 1, sm: 1.5, md: 2 }} bg="bg-charcoal-outline" rounded="lg" p={{ base: 1.5, sm: 2, md: 3 }} border borderColor="border-primary-blue/30">
|
||||
<Box display="flex"
|
||||
// eslint-disable-next-line gridpilot-rules/component-classification
|
||||
className="-space-x-2"
|
||||
>
|
||||
{[1, 2, 3].map((i) => (
|
||||
<Box key={i} h={{ base: 4, sm: 5, md: 6 }} w={{ base: 4, sm: 5, md: 6 }} bg="bg-iron-gray" rounded="full" border borderWidth="2px" borderColor="border-charcoal-outline" display="flex" alignItems="center" justifyContent="center">
|
||||
<Text size={{ base: 'xs', sm: 'sm' }}>🏆</Text>
|
||||
</Box>
|
||||
))}
|
||||
</Box>
|
||||
<Text size={{ base: 'xs', sm: 'sm' }} color="text-white" opacity={0.6}>Active in 3 leagues across seasons</Text>
|
||||
</Box>
|
||||
</Box>
|
||||
</Stack>
|
||||
</Box>
|
||||
</Box>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user