website refactor
This commit is contained in:
@@ -16,15 +16,15 @@ export function TeamCompetitionMockup() {
|
||||
setIsMobile(window.innerWidth < 768);
|
||||
}, []);
|
||||
|
||||
const teamColors = ['#198CFF', '#6FE37A', '#FFC556', '#43C9E6', '#9333EA'];
|
||||
const teamColors = ['#198CFF', '#6FE37A', '#FFBE4D', '#4ED4E0', '#9333EA'];
|
||||
|
||||
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>
|
||||
<Text size="sm" weight="semibold" color="text-white" mb={3} block>Drivers</Text>
|
||||
<Stack gap={2}>
|
||||
<Text size="xs" weight="bold" color="text-gray-500" mb={3} block className="uppercase tracking-widest">Drivers</Text>
|
||||
<Stack gap={1}>
|
||||
{[1, 2, 3].map((i) => (
|
||||
<Box
|
||||
key={i}
|
||||
@@ -32,11 +32,11 @@ export function TeamCompetitionMockup() {
|
||||
display="flex"
|
||||
alignItems="center"
|
||||
gap={2}
|
||||
bg="bg-iron-gray"
|
||||
rounded="lg"
|
||||
bg="panel-gray/40"
|
||||
rounded="none"
|
||||
p={2}
|
||||
border
|
||||
borderColor="border-charcoal-outline"
|
||||
borderColor="border-gray/20"
|
||||
overflow="hidden"
|
||||
>
|
||||
<Box
|
||||
@@ -44,54 +44,40 @@ export function TeamCompetitionMockup() {
|
||||
left="0"
|
||||
top="0"
|
||||
bottom="0"
|
||||
w="1"
|
||||
// eslint-disable-next-line gridpilot-rules/component-classification
|
||||
w="0.5"
|
||||
style={{ backgroundColor: teamColors[i-1] }}
|
||||
/>
|
||||
<Box
|
||||
h="5"
|
||||
w="5"
|
||||
rounded="full"
|
||||
rounded="none"
|
||||
display="flex"
|
||||
alignItems="center"
|
||||
justifyContent="center"
|
||||
weight="semibold"
|
||||
// eslint-disable-next-line gridpilot-rules/component-classification
|
||||
weight="bold"
|
||||
style={{
|
||||
fontSize: '10px',
|
||||
borderColor: teamColors[i-1],
|
||||
backgroundColor: `${teamColors[i-1]}20`,
|
||||
borderWidth: '2px'
|
||||
backgroundColor: `${teamColors[i-1]}10`,
|
||||
borderWidth: '1px'
|
||||
}}
|
||||
>
|
||||
<Text color="text-white">{i}</Text>
|
||||
</Box>
|
||||
<Box h="6" w="6" rounded="full" display="flex" alignItems="center" justifyContent="center"
|
||||
// eslint-disable-next-line gridpilot-rules/component-classification
|
||||
style={{ backgroundColor: `${teamColors[i-1]}20`, borderWidth: '1px', borderColor: teamColors[i-1], fontSize: '14px' }}
|
||||
>
|
||||
<Text>🏎️</Text>
|
||||
<Text color="text-white" font="mono">{i}</Text>
|
||||
</Box>
|
||||
<Box flexGrow={1}>
|
||||
<Box h="2.5" w="full" bg="bg-white/10" rounded="sm" />
|
||||
<Box h="1.5" w="full" bg="white/10" rounded="none" />
|
||||
</Box>
|
||||
<Box h="3" w="10" bg="bg-charcoal-outline" rounded="sm" display="flex" alignItems="center" justifyContent="center" color="text-white" opacity={0.7}
|
||||
// eslint-disable-next-line gridpilot-rules/component-classification
|
||||
style={{ fontSize: '10px' }}
|
||||
/>
|
||||
<Box h="3" w="10" bg="graphite-black" rounded="none" border borderColor="border-gray/30" />
|
||||
</Box>
|
||||
))}
|
||||
</Stack>
|
||||
</Box>
|
||||
|
||||
<Box h="px"
|
||||
// eslint-disable-next-line gridpilot-rules/component-classification
|
||||
className="bg-gradient-to-r from-transparent via-charcoal-outline to-transparent"
|
||||
/>
|
||||
<Box h="px" bg="border-gray/30" />
|
||||
|
||||
<Box>
|
||||
<Text size="sm" weight="semibold" color="text-white" mb={3} block>Constructors</Text>
|
||||
<Stack gap={2}>
|
||||
<Text size="xs" weight="bold" color="text-gray-500" mb={3} block className="uppercase tracking-widest">Constructors</Text>
|
||||
<Stack gap={1}>
|
||||
{[1, 2, 3].map((i) => (
|
||||
<Box
|
||||
key={i}
|
||||
@@ -99,11 +85,11 @@ export function TeamCompetitionMockup() {
|
||||
display="flex"
|
||||
alignItems="center"
|
||||
gap={2}
|
||||
bg="bg-iron-gray"
|
||||
rounded="lg"
|
||||
bg="panel-gray/40"
|
||||
rounded="none"
|
||||
p={2}
|
||||
border
|
||||
borderColor="border-charcoal-outline"
|
||||
borderColor="border-gray/20"
|
||||
overflow="hidden"
|
||||
>
|
||||
<Box
|
||||
@@ -111,37 +97,16 @@ export function TeamCompetitionMockup() {
|
||||
left="0"
|
||||
top="0"
|
||||
bottom="0"
|
||||
w="1"
|
||||
// eslint-disable-next-line gridpilot-rules/component-classification
|
||||
w="0.5"
|
||||
style={{ backgroundColor: teamColors[i-1] }}
|
||||
/>
|
||||
<Box
|
||||
h="6"
|
||||
w="6"
|
||||
rounded="sm"
|
||||
display="flex"
|
||||
alignItems="center"
|
||||
justifyContent="center"
|
||||
border
|
||||
borderWidth="2px"
|
||||
// eslint-disable-next-line gridpilot-rules/component-classification
|
||||
style={{
|
||||
borderColor: teamColors[i-1],
|
||||
backgroundColor: `${teamColors[i-1]}20`,
|
||||
fontSize: '14px'
|
||||
}}
|
||||
>
|
||||
<Text>🏁</Text>
|
||||
</Box>
|
||||
<Box flexGrow={1}>
|
||||
<Box h="2.5" w="full" bg="bg-white/10" rounded="sm" mb={1} />
|
||||
<Box position="relative" h="1.5" bg="bg-charcoal-outline" rounded="full" overflow="hidden">
|
||||
<Box h="1.5" w="full" bg="white/10" rounded="none" mb={1.5} />
|
||||
<Box position="relative" h="1" bg="graphite-black" rounded="none" overflow="hidden">
|
||||
<Box
|
||||
position="absolute"
|
||||
insetY="0"
|
||||
left="0"
|
||||
rounded="full"
|
||||
// eslint-disable-next-line gridpilot-rules/component-classification
|
||||
style={{ backgroundColor: teamColors[i-1], width: `${100 - (i-1) * 15}%` }}
|
||||
/>
|
||||
</Box>
|
||||
@@ -160,11 +125,7 @@ export function TeamCompetitionMockup() {
|
||||
visible: {
|
||||
opacity: 1,
|
||||
x: 0,
|
||||
transition: {
|
||||
type: 'spring' as const,
|
||||
stiffness: 100,
|
||||
damping: 20
|
||||
}
|
||||
transition: { duration: 0.4 }
|
||||
}
|
||||
};
|
||||
|
||||
@@ -173,30 +134,24 @@ export function TeamCompetitionMockup() {
|
||||
visible: {
|
||||
opacity: 1,
|
||||
x: 0,
|
||||
transition: {
|
||||
type: 'spring' as const,
|
||||
stiffness: 100,
|
||||
damping: 20
|
||||
}
|
||||
transition: { duration: 0.4 }
|
||||
}
|
||||
};
|
||||
|
||||
const rowVariants = {
|
||||
hidden: { opacity: 0, scale: shouldReduceMotion ? 1 : 0.95 },
|
||||
hidden: { opacity: 0, x: shouldReduceMotion ? 0 : -10 },
|
||||
visible: (i: number) => ({
|
||||
opacity: 1,
|
||||
scale: 1,
|
||||
x: 0,
|
||||
transition: {
|
||||
delay: shouldReduceMotion ? 0 : 0.3 + i * 0.05,
|
||||
type: 'spring' as const,
|
||||
stiffness: 300,
|
||||
damping: 25
|
||||
duration: 0.3
|
||||
}
|
||||
})
|
||||
};
|
||||
|
||||
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: 4, lg: 6 }} overflow="hidden">
|
||||
<Box position="relative" fullWidth fullHeight bg="graphite-black" rounded="none" p={{ base: 1.5, sm: 3, md: 4, lg: 6 }} overflow="hidden">
|
||||
<Box display="grid" gridCols={2} gap={{ base: 2, sm: 3, md: 4, lg: 6 }} fullHeight>
|
||||
<Box
|
||||
as={motion.div}
|
||||
@@ -205,17 +160,10 @@ export function TeamCompetitionMockup() {
|
||||
animate="visible"
|
||||
position="relative"
|
||||
>
|
||||
<Box h={{ base: 3, sm: 4, md: 5 }} w={{ base: 16, sm: 20, md: 24 }} bg="bg-white/10" rounded="sm" mb={{ base: 1.5, sm: 2, md: 3, lg: 4 }} display="flex" alignItems="center" justifyContent="center">
|
||||
<Text
|
||||
// eslint-disable-next-line gridpilot-rules/component-classification
|
||||
style={{ fontSize: '10px' }}
|
||||
color="text-white"
|
||||
weight="semibold"
|
||||
>
|
||||
Drivers
|
||||
</Text>
|
||||
<Box h="6" w="24" bg="panel-gray" rounded="none" mb={4} display="flex" alignItems="center" justifyContent="center" border borderColor="border-gray/30">
|
||||
<Text size="xs" color="text-gray-400" weight="bold" className="uppercase tracking-widest">DRIVERS</Text>
|
||||
</Box>
|
||||
<Stack gap={{ base: 1, sm: 1.5, md: 2 }}>
|
||||
<Stack gap={1}>
|
||||
{[1, 2, 3, 4, 5].map((i) => (
|
||||
<Box
|
||||
key={i}
|
||||
@@ -227,18 +175,18 @@ export function TeamCompetitionMockup() {
|
||||
position="relative"
|
||||
display="flex"
|
||||
alignItems="center"
|
||||
gap={{ base: 1.5, sm: 2, md: 2.5, lg: 3 }}
|
||||
bg="bg-iron-gray"
|
||||
rounded="lg"
|
||||
p={{ base: 1, sm: 1.5, md: 2, lg: 2.5 }}
|
||||
gap={3}
|
||||
bg="panel-gray/20"
|
||||
rounded="none"
|
||||
p={2}
|
||||
border
|
||||
borderColor="border-charcoal-outline"
|
||||
borderColor="border-gray/20"
|
||||
overflow="hidden"
|
||||
onHoverStart={() => !shouldReduceMotion && setHoveredDriver(i)}
|
||||
onHoverEnd={() => setHoveredDriver(null)}
|
||||
whileHover={shouldReduceMotion ? {} : {
|
||||
scale: 1.02,
|
||||
boxShadow: `0 0 20px ${teamColors[i-1]}40`,
|
||||
x: 4,
|
||||
borderColor: `${teamColors[i-1]}40`,
|
||||
transition: { duration: 0.15 }
|
||||
}}
|
||||
>
|
||||
@@ -248,65 +196,35 @@ export function TeamCompetitionMockup() {
|
||||
top="0"
|
||||
bottom="0"
|
||||
w="0.5"
|
||||
// eslint-disable-next-line gridpilot-rules/component-classification
|
||||
style={{ backgroundColor: teamColors[i-1] }}
|
||||
/>
|
||||
<Box
|
||||
h={{ base: 3.5, sm: 4, md: 5 }}
|
||||
w={{ base: 3.5, sm: 4, md: 5 }}
|
||||
rounded="full"
|
||||
h="5"
|
||||
w="5"
|
||||
rounded="none"
|
||||
display="flex"
|
||||
alignItems="center"
|
||||
justifyContent="center"
|
||||
weight="semibold"
|
||||
weight="bold"
|
||||
border
|
||||
borderWidth="2px"
|
||||
// eslint-disable-next-line gridpilot-rules/component-classification
|
||||
borderWidth="1px"
|
||||
style={{
|
||||
fontSize: '10px',
|
||||
borderColor: teamColors[i-1],
|
||||
backgroundColor: `${teamColors[i-1]}20`
|
||||
backgroundColor: `${teamColors[i-1]}10`
|
||||
}}
|
||||
>
|
||||
<Text color="text-white">{i}</Text>
|
||||
</Box>
|
||||
<Box h={{ base: 5, sm: 6, md: 7 }} w={{ base: 5, sm: 6, md: 7 }} rounded="full" display="flex" alignItems="center" justifyContent="center"
|
||||
// eslint-disable-next-line gridpilot-rules/component-classification
|
||||
style={{ backgroundColor: `${teamColors[i-1]}20`, borderWidth: '1px', borderColor: teamColors[i-1], fontSize: '12px' }}
|
||||
>
|
||||
<Text>🏎️</Text>
|
||||
<Text color="text-white" font="mono">{i}</Text>
|
||||
</Box>
|
||||
<Box flexGrow={1} minWidth="0">
|
||||
<Box h={{ base: 1.5, sm: 2, md: 2.5 }} w="full" bg="bg-white/10" rounded="sm" />
|
||||
<Box h="1.5" w="full" bg="white/10" rounded="none" />
|
||||
</Box>
|
||||
<Box h={{ base: 2, sm: 2.5, md: 3 }} w={{ base: 8, sm: 10, md: 12 }} bg="bg-charcoal-outline" rounded="sm" font="mono" display="flex" alignItems="center" justifyContent="center" color="text-white" opacity={0.7}
|
||||
// eslint-disable-next-line gridpilot-rules/component-classification
|
||||
style={{ fontSize: '10px' }}
|
||||
/>
|
||||
{hoveredDriver === i && (
|
||||
<Box
|
||||
as={motion.div}
|
||||
position="absolute"
|
||||
inset="0"
|
||||
pointerEvents="none"
|
||||
initial={{ opacity: 0 }}
|
||||
animate={{ opacity: 1 }}
|
||||
// eslint-disable-next-line gridpilot-rules/component-classification
|
||||
style={{
|
||||
background: `linear-gradient(90deg, ${teamColors[i-1]}10 0%, transparent 100%)`
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
<Box h="3" w="12" bg="graphite-black" rounded="none" border borderColor="border-gray/30" />
|
||||
</Box>
|
||||
))}
|
||||
</Stack>
|
||||
</Box>
|
||||
|
||||
<Box position="absolute" left="1/2" top="8" bottom="8" w="px"
|
||||
// eslint-disable-next-line gridpilot-rules/component-classification
|
||||
className="bg-gradient-to-b from-transparent via-charcoal-outline to-transparent backdrop-blur-sm"
|
||||
/>
|
||||
|
||||
<Box
|
||||
as={motion.div}
|
||||
variants={rightColumnVariants}
|
||||
@@ -314,17 +232,10 @@ export function TeamCompetitionMockup() {
|
||||
animate="visible"
|
||||
position="relative"
|
||||
>
|
||||
<Box h={{ base: 3, sm: 4, md: 5 }} w={{ base: 20, sm: 24, md: 32 }} bg="bg-white/10" rounded="sm" mb={{ base: 1.5, sm: 2, md: 3, lg: 4 }} display="flex" alignItems="center" justifyContent="center">
|
||||
<Text
|
||||
// eslint-disable-next-line gridpilot-rules/component-classification
|
||||
style={{ fontSize: '10px' }}
|
||||
color="text-white"
|
||||
weight="semibold"
|
||||
>
|
||||
Constructors
|
||||
</Text>
|
||||
<Box h="6" w="32" bg="panel-gray" rounded="none" mb={4} display="flex" alignItems="center" justifyContent="center" border borderColor="border-gray/30">
|
||||
<Text size="xs" color="text-gray-400" weight="bold" className="uppercase tracking-widest">CONSTRUCTORS</Text>
|
||||
</Box>
|
||||
<Stack gap={{ base: 1, sm: 1.5, md: 2 }}>
|
||||
<Stack gap={1}>
|
||||
{[1, 2, 3, 4, 5].map((i) => (
|
||||
<Box
|
||||
key={i}
|
||||
@@ -336,58 +247,37 @@ export function TeamCompetitionMockup() {
|
||||
position="relative"
|
||||
display="flex"
|
||||
alignItems="center"
|
||||
gap={{ base: 1.5, sm: 2, md: 2.5, lg: 3 }}
|
||||
bg="bg-iron-gray"
|
||||
rounded="lg"
|
||||
p={{ base: 1, sm: 1.5, md: 2, lg: 2.5 }}
|
||||
gap={3}
|
||||
bg="panel-gray/20"
|
||||
rounded="none"
|
||||
p={2}
|
||||
border
|
||||
borderColor="border-charcoal-outline"
|
||||
borderColor="border-gray/20"
|
||||
overflow="hidden"
|
||||
onHoverStart={() => !shouldReduceMotion && setHoveredTeam(i)}
|
||||
onHoverEnd={() => setHoveredTeam(null)}
|
||||
whileHover={shouldReduceMotion ? {} : {
|
||||
scale: 1.02,
|
||||
boxShadow: `0 0 20px ${teamColors[i-1]}40`,
|
||||
x: -4,
|
||||
borderColor: `${teamColors[i-1]}40`,
|
||||
transition: { duration: 0.15 }
|
||||
}}
|
||||
>
|
||||
<Box
|
||||
position="absolute"
|
||||
left="0"
|
||||
right="0"
|
||||
top="0"
|
||||
bottom="0"
|
||||
w="0.5"
|
||||
// eslint-disable-next-line gridpilot-rules/component-classification
|
||||
style={{ backgroundColor: teamColors[i-1] }}
|
||||
/>
|
||||
<Box
|
||||
h={{ base: 5, sm: 6, md: 7 }}
|
||||
w={{ base: 5, sm: 6, md: 7 }}
|
||||
rounded="sm"
|
||||
display="flex"
|
||||
alignItems="center"
|
||||
justifyContent="center"
|
||||
border
|
||||
borderWidth="2px"
|
||||
// eslint-disable-next-line gridpilot-rules/component-classification
|
||||
style={{
|
||||
fontSize: '12px',
|
||||
borderColor: teamColors[i-1],
|
||||
backgroundColor: `${teamColors[i-1]}20`
|
||||
}}
|
||||
>
|
||||
<Text>🏁</Text>
|
||||
</Box>
|
||||
<Box flexGrow={1} minWidth="0">
|
||||
<Box h={{ base: 1.5, sm: 2, md: 2.5 }} w="full" bg="bg-white/10" rounded="sm" mb={{ base: 0.5, sm: 1, md: 1.5 }} />
|
||||
<Box position="relative" h={{ base: 0.5, sm: 1, md: 1.5 }} bg="bg-charcoal-outline" rounded="full" overflow="hidden">
|
||||
<Box h="1.5" w="full" bg="white/10" rounded="none" mb={1.5} />
|
||||
<Box position="relative" h="1" bg="graphite-black" rounded="none" overflow="hidden">
|
||||
<Box
|
||||
as={motion.div}
|
||||
position="absolute"
|
||||
insetY="0"
|
||||
left="0"
|
||||
rounded="full"
|
||||
// eslint-disable-next-line gridpilot-rules/component-classification
|
||||
style={{ backgroundColor: teamColors[i-1] }}
|
||||
initial={{ width: '0%' }}
|
||||
animate={{ width: `${100 - (i-1) * 15}%` }}
|
||||
@@ -395,30 +285,6 @@ export function TeamCompetitionMockup() {
|
||||
/>
|
||||
</Box>
|
||||
</Box>
|
||||
{i === 3 && (
|
||||
<Box h={{ base: 3, sm: 3.5, md: 4 }} px={{ base: 0.5, sm: 1, md: 1.5 }} bg="bg-warning-amber/20" rounded="sm" display="flex" alignItems="center" justifyContent="center" color="text-warning-amber" weight="semibold" border borderColor="border-warning-amber/30">
|
||||
<Text
|
||||
// eslint-disable-next-line gridpilot-rules/component-classification
|
||||
style={{ fontSize: '10px' }}
|
||||
>
|
||||
=
|
||||
</Text>
|
||||
</Box>
|
||||
)}
|
||||
{hoveredTeam === i && (
|
||||
<Box
|
||||
as={motion.div}
|
||||
position="absolute"
|
||||
inset="0"
|
||||
pointerEvents="none"
|
||||
initial={{ opacity: 0 }}
|
||||
animate={{ opacity: 1 }}
|
||||
// eslint-disable-next-line gridpilot-rules/component-classification
|
||||
style={{
|
||||
background: `linear-gradient(90deg, ${teamColors[i-1]}10 0%, transparent 100%)`
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
</Box>
|
||||
))}
|
||||
</Stack>
|
||||
|
||||
Reference in New Issue
Block a user