website refactor

This commit is contained in:
2026-01-17 02:32:34 +01:00
parent 6a49448e0a
commit 4d5ce9bfd6
43 changed files with 1642 additions and 2022 deletions

View File

@@ -11,7 +11,10 @@ export function DriverProfileMockup() {
const [isMobile, setIsMobile] = useState(false);
useEffect(() => {
setIsMobile(window.innerWidth < 768);
const checkMobile = () => setIsMobile(window.innerWidth < 768);
checkMobile();
window.addEventListener('resize', checkMobile);
return () => window.removeEventListener('resize', checkMobile);
}, []);
const stats = [
@@ -26,77 +29,58 @@ export function DriverProfileMockup() {
if (isMobile) {
return (
<Box position="relative" fullWidth fullHeight bg="bg-gradient-to-br from-deep-graphite via-iron-gray to-deep-graphite" rounded="lg" p={3} overflow="hidden">
<Box position="relative" fullWidth fullHeight bg="graphite-black" rounded="none" p={3} overflow="hidden">
<Stack gap={4}>
<Box>
<Box display="flex" alignItems="center" justifyContent="between" mb={2}>
<Box display="flex" alignItems="center" gap={3}>
<Box position="relative" h="12" w="12" rounded="full" border borderWidth="2px" borderColor="border-primary-blue/50" overflow="hidden" bg="bg-charcoal-outline">
<Box position="absolute" inset="0" display="flex" alignItems="center" justifyContent="center">
<Text size="2xl">🏎</Text>
</Box>
<Box position="relative" h="12" w="12" rounded="none" border borderWidth="1px" borderColor="primary-accent/50" overflow="hidden" bg="panel-gray" display="flex" alignItems="center" justifyContent="center">
<Text size="2xl">🏎</Text>
<Box position="absolute" top="-1px" left="-1px" w="2" h="2" borderTop borderLeft borderColor="primary-accent" />
</Box>
<Box>
<Text weight="bold" color="text-white" block>Driver Profile</Text>
<Text size="xs" color="text-white" opacity={0.5} block>Cross-league</Text>
<Text weight="bold" color="text-white" block className="uppercase tracking-widest">Driver Profile</Text>
<Text size="xs" color="text-gray-500" block font="mono">CROSS-LEAGUE</Text>
</Box>
</Box>
<Text size="2xl" weight="bold" color="text-charcoal-outline">#33</Text>
<Text size="2xl" weight="bold" color="text-gray-800" font="mono">#33</Text>
</Box>
<Box position="relative" h="2" bg="bg-charcoal-outline" rounded="full" overflow="hidden" mb={1}>
<Box position="relative" h="1" bg="white/5" rounded="none" overflow="hidden" mb={1}>
<Box
position="absolute"
insetY="0"
left="0"
bg="bg-gradient-to-r from-primary-blue to-neon-aqua"
rounded="full"
// eslint-disable-next-line gridpilot-rules/component-classification
bg="primary-accent"
style={{ width: '86%' }}
/>
</Box>
<Box display="flex" justifyContent="end">
<Text size="xs" color="text-gray-400">2150 GP Rating</Text>
<Text size="xs" color="text-primary-accent" font="mono" weight="bold">2150 GP RATING</Text>
</Box>
</Box>
<Box>
<Text size="sm" weight="semibold" color="text-white" mb={2} block>Career Stats</Text>
<Text size="xs" weight="bold" color="text-gray-500" mb={2} block className="uppercase tracking-widest">Career Stats</Text>
<Box display="grid" gridCols={3} gap={2}>
{stats.slice(0, 3).map((stat) => (
<Box
key={stat.label}
bg="bg-iron-gray/50"
bg="panel-gray/40"
border
borderColor="border-charcoal-outline"
rounded="lg"
borderColor="border-gray/50"
rounded="none"
p={2}
textAlign="center"
>
<Text weight="bold" color="text-white" font="mono" block>
{stat.value}{stat.suffix}
</Text>
<Text size="xs" color="text-gray-400" mt={0.5} block>{stat.label}</Text>
<Text size="xs" color="text-gray-500" mt={0.5} block className="uppercase tracking-tighter">{stat.label}</Text>
</Box>
))}
</Box>
</Box>
<Box>
<Text size="sm" weight="semibold" color="text-white" mb={2} block>Recent Form</Text>
<Box h="16" bg="bg-iron-gray/30" border borderColor="border-charcoal-outline" rounded="lg" p={2} display="flex" alignItems="end" gap={1}>
{formData.slice(-6).map((value, i) => (
<Box
key={i}
flexGrow={1}
bg="bg-gradient-to-t from-performance-green to-primary-blue"
rounded="sm"
// eslint-disable-next-line gridpilot-rules/component-classification
style={{ height: `${value}%` }}
/>
))}
</Box>
</Box>
</Stack>
</Box>
);
@@ -120,7 +104,7 @@ export function DriverProfileMockup() {
};
return (
<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 position="relative" fullWidth fullHeight bg="graphite-black" rounded="none" p={{ base: 1.5, sm: 3, md: 5, lg: 8 }} overflow="hidden">
<Box
as={motion.div}
initial={{ opacity: 0, y: shouldReduceMotion ? 0 : -10 }}
@@ -129,50 +113,46 @@ export function DriverProfileMockup() {
>
<Box display="flex" alignItems="center" justifyContent="between" mb={{ base: 1.5, sm: 2, md: 3, lg: 4 }}>
<Box display="flex" alignItems="center" gap={{ base: 1.5, sm: 2, md: 3, lg: 4 }}>
<Box position="relative" h={{ base: 8, sm: 10, md: 12, lg: 16 }} w={{ base: 8, sm: 10, md: 12, lg: 16 }} rounded="full" border borderWidth="2px" borderColor="border-primary-blue/50" overflow="hidden" bg="bg-charcoal-outline">
<Box position="absolute" inset="0" display="flex" alignItems="center" justifyContent="center">
<Text size={{ base: 'base', sm: 'xl', md: '2xl', lg: '3xl' }}>🏎</Text>
</Box>
<Box position="relative" h={{ base: 8, sm: 10, md: 12, lg: 16 }} w={{ base: 8, sm: 10, md: 12, lg: 16 }} rounded="none" border borderWidth="1px" borderColor="primary-accent/50" overflow="hidden" bg="panel-gray" display="flex" alignItems="center" justifyContent="center">
<Text size={{ base: 'base', sm: 'xl', md: '2xl', lg: '3xl' }}>🏎</Text>
<Box position="absolute" top="-1px" left="-1px" w="2" h="2" borderTop borderLeft borderColor="primary-accent" />
</Box>
<Box>
<Text size={{ base: 'sm', sm: 'base', md: 'lg', lg: 'xl' }} weight="bold" color="text-white" mb={{ base: 1, sm: 1.5, md: 2 }} block>Driver Profile</Text>
<Text size={{ base: 'sm', sm: 'base', md: 'lg', lg: 'xl' }} weight="bold" color="text-white" mb={{ base: 1, sm: 1.5, md: 2 }} block className="uppercase tracking-widest">Driver Profile</Text>
<Text
// eslint-disable-next-line gridpilot-rules/component-classification
style={{ fontSize: '10px' }}
color="text-white"
opacity={0.5}
color="text-gray-500"
block
font="mono"
className="uppercase tracking-widest"
>
Cross-league racing identity
</Text>
</Box>
</Box>
<Text size={{ base: 'xl', sm: '2xl', md: '3xl', lg: '4xl' }} weight="bold" color="text-charcoal-outline">#33</Text>
<Text size={{ base: 'xl', sm: '2xl', md: '3xl', lg: '4xl' }} weight="bold" color="text-gray-800" font="mono">#33</Text>
</Box>
<Box display="flex" flexWrap="wrap" alignItems="center" gap={{ base: 1, sm: 2, md: 3, lg: 4 }} mb={{ base: 1, sm: 1.5, md: 2 }}>
<Text size="xs" color="text-gray-400">GridPilot Rating:</Text>
<Text size="xs" color="text-gray-500" weight="bold" className="uppercase tracking-widest">GP RATING:</Text>
<AnimatedRating shouldReduceMotion={shouldReduceMotion ?? false} value={2150} />
<Text size="xs" color="text-gray-400">iRating:</Text>
<Text size="xs" color="text-gray-500" weight="bold" className="uppercase tracking-widest ml-4">iRATING:</Text>
<AnimatedRating shouldReduceMotion={shouldReduceMotion ?? false} value={3200} />
</Box>
<Box position="relative" h={{ base: 1.5, sm: 2, md: 2.5, lg: 3 }} bg="bg-charcoal-outline" rounded="full" overflow="hidden">
<Box position="relative" h="1" bg="white/5" rounded="none" overflow="hidden">
<Box
as={motion.div}
position="absolute"
insetY="0"
left="0"
bg="bg-gradient-to-r from-primary-blue to-neon-aqua"
rounded="full"
bg="primary-accent"
initial={{ width: '0%' }}
animate={{ width: '86%' }}
transition={{ delay: shouldReduceMotion ? 0 : 0.4, duration: 0.8, ease: 'easeOut' }}
/>
</Box>
<Box display="flex" justifyContent="end" mt={1}>
<Text size="xs" color="text-gray-400">86%</Text>
</Box>
</Box>
<Box
@@ -182,8 +162,7 @@ export function DriverProfileMockup() {
animate="visible"
mb={{ base: 1.5, sm: 3, md: 4, lg: 6 }}
>
<Text size="sm" weight="semibold" color="text-white" mb={1} block>Career Statistics</Text>
<Text size="xs" color="text-white" opacity={0.5} mb={{ base: 1, sm: 2, md: 3 }} block>Aggregated across all leagues</Text>
<Text size="xs" weight="bold" color="text-gray-500" mb={3} block className="uppercase tracking-[0.2em]">Career Statistics</Text>
<Box display="grid" gridCols={{ base: 2, md: 5 }} gap={{ base: 1.5, sm: 2, md: 3 }}>
{stats.map((stat, index) => (
@@ -191,10 +170,10 @@ export function DriverProfileMockup() {
key={stat.label}
as={motion.div}
variants={itemVariants}
bg="bg-iron-gray/50"
bg="panel-gray/40"
border
borderColor="border-charcoal-outline"
rounded="lg"
borderColor="border-gray/50"
rounded="none"
p={{ base: 1.5, sm: 2, md: 3 }}
textAlign="center"
>
@@ -204,7 +183,7 @@ export function DriverProfileMockup() {
delay={index * 0.1}
suffix={stat.suffix ?? ''}
/>
<Text size="xs" color="text-gray-400" mt={0.5} block>{stat.label}</Text>
<Text size="xs" color="text-gray-500" mt={0.5} block className="uppercase tracking-tighter font-bold">{stat.label}</Text>
</Box>
))}
</Box>
@@ -212,22 +191,20 @@ export function DriverProfileMockup() {
<Box
as={motion.div}
initial={{ opacity: 0, y: shouldReduceMotion ? 0 : 10 }}
initial={{ opacity: 0, y: 10 }}
animate={{ opacity: 1, y: 0 }}
transition={{ delay: shouldReduceMotion ? 0 : 0.6 }}
mb={{ base: 1.5, sm: 3, md: 4, lg: 6 }}
transition={{ delay: 0.6 }}
>
<Text size="sm" weight="semibold" color="text-white" mb={1} block>Recent Form</Text>
<Text size="xs" color="text-white" opacity={0.5} mb={{ base: 1, sm: 2, md: 3 }} block>Performance trend over last 10 races</Text>
<Box h={{ base: 12, sm: 16, md: 20 }} bg="bg-iron-gray/30" border borderColor="border-charcoal-outline" rounded="lg" p={{ base: 1.5, sm: 2, md: 3 }} display="flex" alignItems="end" gap={0.5}>
<Text size="xs" weight="bold" color="text-gray-500" mb={3} block className="uppercase tracking-[0.2em]">Recent Form</Text>
<Box h={{ base: 12, sm: 16, md: 20 }} bg="panel-gray/20" border borderColor="border-gray/50" rounded="none" p={{ base: 1.5, sm: 2, md: 3 }} display="flex" alignItems="end" gap={1}>
{formData.map((value, i) => (
<Box
key={i}
as={motion.div}
flexGrow={1}
bg="bg-gradient-to-t from-performance-green to-primary-blue"
rounded="sm"
bg="primary-accent"
opacity={0.4 + (i * 0.06)}
rounded="none"
initial={{ height: 0 }}
animate={{ height: `${value}%` }}
transition={{
@@ -238,66 +215,6 @@ export function DriverProfileMockup() {
/>
))}
</Box>
<Box display="flex" justifyContent="between" mt={0.5}>
<Text size="xs" color="text-gray-500">Last 10 races</Text>
<Text size="xs" color="text-gray-500">Recent</Text>
</Box>
</Box>
<Box
as={motion.div}
initial={{ opacity: 0, y: shouldReduceMotion ? 0 : 10 }}
animate={{ opacity: 1, y: 0 }}
transition={{ delay: shouldReduceMotion ? 0 : 0.8 }}
>
<Text size="sm" weight="semibold" color="text-white" mb={1} block>Teams</Text>
<Text size="xs" color="text-white" opacity={0.5} mb={{ base: 1, sm: 2, md: 3 }} block>Current and past team memberships</Text>
<Stack gap={{ base: 1, sm: 1.5, md: 2 }}>
{[
{ team: 'Red Bull Racing', status: 'Current', color: 'primary-blue' },
{ team: 'Mercedes AMG', status: '2023', color: 'charcoal-outline' }
].map((team, i) => (
<Box
key={team.team}
as={motion.div}
initial={{ opacity: 0, x: shouldReduceMotion ? 0 : -10 }}
animate={{ opacity: 1, x: 0 }}
transition={{ delay: shouldReduceMotion ? 0 : 0.9 + i * 0.1 }}
display="flex"
alignItems="center"
justifyContent="between"
bg="bg-iron-gray/30"
border
borderColor="border-charcoal-outline"
rounded="lg"
p={{ base: 1, sm: 1.5, md: 2 }}
>
<Box display="flex" alignItems="center" gap={{ base: 2, sm: 3 }}>
<Box h={{ base: 5, sm: 6, md: 8 }} w={{ base: 5, sm: 6, md: 8 }} rounded="sm" border borderColor="border-primary-blue/30" bg="bg-charcoal-outline" display="flex" alignItems="center" justifyContent="center">
<Text size={{ base: 'sm', sm: 'base', md: 'lg' }}>🏁</Text>
</Box>
<Box h={{ base: 1.5, sm: 2, md: 3 }} w={{ base: 16, sm: 20, md: 32 }} bg="bg-white/10" rounded="sm" />
</Box>
<Box as="span" px={{ base: 1, sm: 1.5, md: 2 }} py={0.5} rounded="sm" bg={team.status === 'Current' ? 'bg-primary-blue/20' : 'bg-charcoal-outline'}>
<Text size="xs" color={team.status === 'Current' ? 'text-primary-blue' : 'text-gray-400'}>
{team.status}
</Text>
</Box>
</Box>
))}
</Stack>
<Box
as={motion.div}
initial={{ opacity: 0 }}
animate={{ opacity: 1 }}
transition={{ delay: shouldReduceMotion ? 0 : 1.2 }}
mt={{ base: 2, sm: 3, md: 4 }}
textAlign="center"
>
<Text size="xs" color="text-gray-400">Active in 3 leagues</Text>
</Box>
</Box>
</Box>
);
@@ -318,7 +235,7 @@ function AnimatedRating({ shouldReduceMotion, value }: { shouldReduceMotion: boo
}, [shouldReduceMotion, count, value]);
return (
<Box as={motion.span} weight="bold" color="text-primary-blue" font="mono" size={{ base: 'sm', sm: 'base', md: 'lg' }}>
<Box as={motion.span} weight="bold" color="text-primary-accent" font="mono" size={{ base: 'sm', sm: 'base' }}>
{shouldReduceMotion ? value : <Box as={motion.span}>{rounded}</Box>}
</Box>
);
@@ -348,7 +265,7 @@ function AnimatedCounter({
}, [shouldReduceMotion, count, value, delay]);
return (
<Box weight="bold" color="text-white" font="mono" size={{ base: 'sm', sm: 'base', md: 'lg', lg: 'xl' }}>
<Box weight="bold" color="text-white" font="mono" size={{ base: 'sm', sm: 'base', md: 'lg' }}>
{shouldReduceMotion ? value : <Box as={motion.span}>{rounded}</Box>}{suffix}
</Box>
);