website refactor

This commit is contained in:
2026-01-18 16:18:18 +01:00
parent 0b301feb61
commit 13567d51af
329 changed files with 4701 additions and 4750 deletions

View File

@@ -2,9 +2,8 @@
import { motion, useReducedMotion, useMotionValue, useSpring, useTransform } from 'framer-motion';
import { useEffect, useState } from 'react';
import { Box } from '@/ui/Box';
import { Text } from '@/ui/Text';
import { Stack } from '@/ui/Stack';
import { Text } from '@/ui/Text';
export function DriverProfileMockup() {
const shouldReduceMotion = useReducedMotion();
@@ -29,42 +28,42 @@ export function DriverProfileMockup() {
if (isMobile) {
return (
<Box position="relative" fullWidth fullHeight bg="graphite-black" rounded="none" p={3} overflow="hidden">
<Stack 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="none" border borderWidth="1px" borderColor="primary-accent/50" overflow="hidden" bg="panel-gray" display="flex" alignItems="center" justifyContent="center">
<Stack>
<Stack display="flex" alignItems="center" justifyContent="between" mb={2}>
<Stack display="flex" alignItems="center" gap={3}>
<Stack 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>
<Stack position="absolute" top="-1px" left="-1px" w="2" h="2" borderTop borderLeft borderColor="primary-accent" />
</Stack>
<Stack>
<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>
</Stack>
</Stack>
<Text size="2xl" weight="bold" color="text-gray-800" font="mono">#33</Text>
</Box>
</Stack>
<Box position="relative" h="1" bg="white/5" rounded="none" overflow="hidden" mb={1}>
<Box
<Stack position="relative" h="1" bg="white/5" rounded="none" overflow="hidden" mb={1}>
<Stack
position="absolute"
insetY="0"
left="0"
bg="primary-accent"
style={{ width: '86%' }}
/>
</Box>
<Box display="flex" justifyContent="end">
</Stack>
<Stack display="flex" justifyContent="end">
<Text size="xs" color="text-primary-accent" font="mono" weight="bold">2150 GP RATING</Text>
</Box>
</Box>
</Stack>
</Stack>
<Box>
<Stack>
<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}>
<Stack display="grid" gridCols={3} gap={2}>
{stats.slice(0, 3).map((stat) => (
<Box
<Stack
key={stat.label}
bg="panel-gray/40"
border
@@ -77,12 +76,12 @@ export function DriverProfileMockup() {
{stat.value}{stat.suffix}
</Text>
<Text size="xs" color="text-gray-500" mt={0.5} block className="uppercase tracking-tighter">{stat.label}</Text>
</Box>
</Stack>
))}
</Box>
</Box>
</Stack>
</Stack>
</Stack>
</Box>
</Stack>
);
}
@@ -104,20 +103,20 @@ export function DriverProfileMockup() {
};
return (
<Box position="relative" fullWidth fullHeight bg="graphite-black" rounded="none" p={{ base: 1.5, sm: 3, md: 5, lg: 8 }} overflow="hidden">
<Box
<Stack position="relative" fullWidth fullHeight bg="graphite-black" rounded="none" p={{ base: 1.5, sm: 3, md: 5, lg: 8 }} overflow="hidden">
<Stack
as={motion.div}
initial={{ opacity: 0, y: shouldReduceMotion ? 0 : -10 }}
animate={{ opacity: 1, y: 0 }}
mb={{ base: 1.5, sm: 3, md: 4, lg: 6 }}
>
<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="none" border borderWidth="1px" borderColor="primary-accent/50" overflow="hidden" bg="panel-gray" display="flex" alignItems="center" justifyContent="center">
<Stack display="flex" alignItems="center" justifyContent="between" mb={{ base: 1.5, sm: 2, md: 3, lg: 4 }}>
<Stack display="flex" alignItems="center" gap={{ base: 1.5, sm: 2, md: 3, lg: 4 }}>
<Stack 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>
<Stack position="absolute" top="-1px" left="-1px" w="2" h="2" borderTop borderLeft borderColor="primary-accent" />
</Stack>
<Stack>
<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
@@ -129,20 +128,20 @@ export function DriverProfileMockup() {
>
Cross-league racing identity
</Text>
</Box>
</Box>
</Stack>
</Stack>
<Text size={{ base: 'xl', sm: '2xl', md: '3xl', lg: '4xl' }} weight="bold" color="text-gray-800" font="mono">#33</Text>
</Box>
</Stack>
<Box display="flex" flexWrap="wrap" alignItems="center" gap={{ base: 1, sm: 2, md: 3, lg: 4 }} mb={{ base: 1, sm: 1.5, md: 2 }}>
<Stack 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-500" weight="bold" className="uppercase tracking-widest">GP RATING:</Text>
<AnimatedRating shouldReduceMotion={shouldReduceMotion ?? false} value={2150} />
<Text size="xs" color="text-gray-500" weight="bold" className="uppercase tracking-widest ml-4">iRATING:</Text>
<AnimatedRating shouldReduceMotion={shouldReduceMotion ?? false} value={3200} />
</Box>
</Stack>
<Box position="relative" h="1" bg="white/5" rounded="none" overflow="hidden">
<Box
<Stack position="relative" h="1" bg="white/5" rounded="none" overflow="hidden">
<Stack
as={motion.div}
position="absolute"
insetY="0"
@@ -152,10 +151,10 @@ export function DriverProfileMockup() {
animate={{ width: '86%' }}
transition={{ delay: shouldReduceMotion ? 0 : 0.4, duration: 0.8, ease: 'easeOut' }}
/>
</Box>
</Box>
</Stack>
</Stack>
<Box
<Stack
as={motion.div}
variants={containerVariants}
initial="hidden"
@@ -164,9 +163,9 @@ export function DriverProfileMockup() {
>
<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 }}>
<Stack display="grid" gridCols={{ base: 2, md: 5 }} gap={{ base: 1.5, sm: 2, md: 3 }}>
{stats.map((stat, index) => (
<Box
<Stack
key={stat.label}
as={motion.div}
variants={itemVariants}
@@ -184,21 +183,21 @@ export function DriverProfileMockup() {
suffix={stat.suffix ?? ''}
/>
<Text size="xs" color="text-gray-500" mt={0.5} block className="uppercase tracking-tighter font-bold">{stat.label}</Text>
</Box>
</Stack>
))}
</Box>
</Box>
</Stack>
</Stack>
<Box
<Stack
as={motion.div}
initial={{ opacity: 0, y: 10 }}
animate={{ opacity: 1, y: 0 }}
transition={{ delay: 0.6 }}
>
<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}>
<Stack 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
<Stack
key={i}
as={motion.div}
flexGrow={1}
@@ -214,9 +213,9 @@ export function DriverProfileMockup() {
}}
/>
))}
</Box>
</Box>
</Box>
</Stack>
</Stack>
</Stack>
);
}
@@ -235,9 +234,9 @@ function AnimatedRating({ shouldReduceMotion, value }: { shouldReduceMotion: boo
}, [shouldReduceMotion, count, value]);
return (
<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>
<Stack as={motion.span} weight="bold" color="text-primary-accent" font="mono" size={{ base: 'sm', sm: 'base' }}>
{shouldReduceMotion ? value : <Stack as={motion.span}>{rounded}</Stack>}
</Stack>
);
}
@@ -265,8 +264,8 @@ function AnimatedCounter({
}, [shouldReduceMotion, count, value, delay]);
return (
<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>
<Stack weight="bold" color="text-white" font="mono" size={{ base: 'sm', sm: 'base', md: 'lg' }}>
{shouldReduceMotion ? value : <Stack as={motion.span}>{rounded}</Stack>}{suffix}
</Stack>
);
}