website refactor
This commit is contained in:
@@ -2,10 +2,9 @@
|
||||
|
||||
import { useState } from 'react';
|
||||
import { motion } from 'framer-motion';
|
||||
import { Box } from '@/ui/Box';
|
||||
import { Stack } from '@/ui/Stack';
|
||||
import { Text } from '@/ui/Text';
|
||||
import { Heading } from '@/ui/Heading';
|
||||
import { Stack } from '@/ui/Stack';
|
||||
import { Icon } from '@/ui/Icon';
|
||||
import { ChevronDown } from 'lucide-react';
|
||||
|
||||
@@ -40,7 +39,7 @@ function FAQItem({ faq, index }: { faq: typeof faqs[0]; index: number }) {
|
||||
const [isOpen, setIsOpen] = useState(false);
|
||||
|
||||
return (
|
||||
<Box
|
||||
<Stack
|
||||
as={motion.div}
|
||||
initial={{ opacity: 0, y: 20 }}
|
||||
whileInView={{ opacity: 1, y: 0 }}
|
||||
@@ -48,8 +47,8 @@ function FAQItem({ faq, index }: { faq: typeof faqs[0]; index: number }) {
|
||||
transition={{ delay: index * 0.1 }}
|
||||
group
|
||||
>
|
||||
<Box rounded="none" bg="panel-gray/40" border borderColor="border-gray/50" transition hoverBorderColor="primary-accent/30">
|
||||
<Box
|
||||
<Stack rounded="none" bg="panel-gray/40" border borderColor="border-gray/50" transition hoverBorderColor="primary-accent/30">
|
||||
<Stack
|
||||
as="button"
|
||||
onClick={() => setIsOpen(!isOpen)}
|
||||
fullWidth
|
||||
@@ -59,14 +58,14 @@ function FAQItem({ faq, index }: { faq: typeof faqs[0]; index: number }) {
|
||||
minHeight="44px"
|
||||
className="relative overflow-hidden"
|
||||
>
|
||||
<Box display="flex" alignItems="center" justifyContent="between" gap={{ base: 2, md: 4 }}>
|
||||
<Stack display="flex" alignItems="center" justifyContent="between" gap={{ base: 2, md: 4 }}>
|
||||
<Stack direction="row" align="center" gap={4}>
|
||||
<Box w="1" h="4" bg={isOpen ? "primary-accent" : "border-gray"} transition className="group-hover:bg-primary-accent" />
|
||||
<Stack w="1" h="4" bg={isOpen ? "primary-accent" : "border-gray"} transition className="group-hover:bg-primary-accent" />
|
||||
<Heading level={3} fontSize={{ base: 'sm', md: 'base' }} weight="bold" color="text-white" groupHoverColor="primary-accent" transition className="tracking-wide">
|
||||
{faq.question}
|
||||
</Heading>
|
||||
</Stack>
|
||||
<Box
|
||||
<Stack
|
||||
as={motion.div}
|
||||
animate={{ rotate: isOpen ? 180 : 0 }}
|
||||
transition={{ duration: 0.15, ease: 'easeInOut' }}
|
||||
@@ -76,10 +75,10 @@ function FAQItem({ faq, index }: { faq: typeof faqs[0]; index: number }) {
|
||||
flexShrink={0}
|
||||
>
|
||||
<Icon icon={ChevronDown} size="full" />
|
||||
</Box>
|
||||
</Box>
|
||||
</Box>
|
||||
<Box
|
||||
</Stack>
|
||||
</Stack>
|
||||
</Stack>
|
||||
<Stack
|
||||
as={motion.div}
|
||||
initial={false}
|
||||
animate={{
|
||||
@@ -92,22 +91,22 @@ function FAQItem({ faq, index }: { faq: typeof faqs[0]; index: number }) {
|
||||
}}
|
||||
overflow="hidden"
|
||||
>
|
||||
<Box px={{ base: 4, md: 6 }} pb={{ base: 4, md: 6 }} pt={0} ml={5}>
|
||||
<Stack px={{ base: 4, md: 6 }} pb={{ base: 4, md: 6 }} pt={0} ml={5}>
|
||||
<Text size="sm" color="text-gray-400" weight="normal" leading="relaxed" className="max-w-2xl">
|
||||
{faq.answer}
|
||||
</Text>
|
||||
</Box>
|
||||
</Box>
|
||||
</Box>
|
||||
</Box>
|
||||
</Stack>
|
||||
</Stack>
|
||||
</Stack>
|
||||
</Stack>
|
||||
);
|
||||
}
|
||||
|
||||
export function FAQ() {
|
||||
return (
|
||||
<Box as="section" position="relative" py={{ base: 20, md: 32 }} bg="graphite-black" overflow="hidden" borderBottom borderColor="border-gray/50">
|
||||
<Stack as="section" position="relative" py={{ base: 20, md: 32 }} bg="graphite-black" overflow="hidden" borderBottom borderColor="border-gray/50">
|
||||
{/* Background image with mask */}
|
||||
<Box
|
||||
<Stack
|
||||
position="absolute"
|
||||
inset="0"
|
||||
bg="url(/images/porsche.jpeg)"
|
||||
@@ -116,23 +115,23 @@ export function FAQ() {
|
||||
opacity={0.03}
|
||||
/>
|
||||
|
||||
<Box maxWidth="4xl" mx="auto" px={{ base: 4, md: 6 }} position="relative" zIndex={10}>
|
||||
<Box textAlign="center" mb={{ base: 12, md: 16 }}>
|
||||
<Box borderLeft borderRight borderStyle="solid" borderColor="primary-accent" px={4} display="inline-block" mb={4}>
|
||||
<Stack maxWidth="4xl" mx="auto" px={{ base: 4, md: 6 }} position="relative" zIndex={10}>
|
||||
<Stack textAlign="center" mb={{ base: 12, md: 16 }}>
|
||||
<Stack borderLeft borderRight borderStyle="solid" borderColor="primary-accent" px={4} display="inline-block" mb={4}>
|
||||
<Text size="xs" weight="bold" color="text-primary-accent" className="uppercase tracking-[0.2em]">
|
||||
Support & Information
|
||||
</Text>
|
||||
</Box>
|
||||
</Stack>
|
||||
<Heading level={2} fontSize={{ base: '3xl', md: '4xl' }} weight="bold" color="text-white" mb={4} className="tracking-tight">
|
||||
Frequently Asked Questions
|
||||
</Heading>
|
||||
</Box>
|
||||
<Box display="flex" flexDirection="column" gap={4}>
|
||||
</Stack>
|
||||
<Stack display="flex" flexDirection="column" gap={4}>
|
||||
{faqs.map((faq, index) => (
|
||||
<FAQItem key={faq.question} faq={faq} index={index} />
|
||||
))}
|
||||
</Box>
|
||||
</Box>
|
||||
</Box>
|
||||
</Stack>
|
||||
</Stack>
|
||||
</Stack>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user