61 lines
1.9 KiB
TypeScript
61 lines
1.9 KiB
TypeScript
import { motion } from "motion/react";
|
|
import Button from "@/components/ui/Button";
|
|
import TextAnimation from "@/components/ui/TextAnimation";
|
|
import ImageOrVideo from "@/components/ui/ImageOrVideo";
|
|
|
|
type HeroSplitImageProps = {
|
|
title: string;
|
|
description: string;
|
|
primaryCtaText?: string;
|
|
secondaryCtaText?: string;
|
|
imageSrc?: string;
|
|
imageAlt?: string;
|
|
};
|
|
|
|
const HeroSplitImage = ({
|
|
title,
|
|
description,
|
|
primaryCtaText,
|
|
secondaryCtaText,
|
|
imageSrc,
|
|
}: HeroSplitImageProps) => {
|
|
return (
|
|
<section aria-label="Hero section" className="pt-25 pb-20 md:py-30">
|
|
<div className="mx-auto w-content-width grid grid-cols-1 md:grid-cols-2 gap-12 items-center">
|
|
<div className="flex flex-col gap-6 items-start">
|
|
<TextAnimation
|
|
text={title}
|
|
variant="slide-up"
|
|
tag="h1"
|
|
className="text-6xl font-medium text-balance"
|
|
/>
|
|
|
|
<TextAnimation
|
|
text={description}
|
|
variant="slide-up"
|
|
tag="p"
|
|
className="text-base md:text-lg leading-tight text-balance"
|
|
/>
|
|
|
|
{(primaryCtaText || secondaryCtaText) && (
|
|
<div className="flex flex-wrap gap-4 mt-2">
|
|
{primaryCtaText && <Button text={primaryCtaText} href="#contact" variant="primary" animate />}
|
|
{secondaryCtaText && <Button text={secondaryCtaText} href="#about" variant="secondary" animate delay={0.1} />}
|
|
</div>
|
|
)}
|
|
</div>
|
|
|
|
<motion.div
|
|
initial={{ opacity: 0, y: 20 }}
|
|
animate={{ opacity: 1, y: 0 }}
|
|
transition={{ duration: 0.6, ease: "easeOut", delay: 0.2 }}
|
|
className="w-full p-3 md:p-5 card rounded overflow-hidden"
|
|
>
|
|
<ImageOrVideo imageSrc={imageSrc} className="aspect-4/5 md:aspect-square rounded-lg shadow-lg" />
|
|
</motion.div>
|
|
</div>
|
|
</section>
|
|
);
|
|
};
|
|
|
|
export default HeroSplitImage; |