112 lines
5.9 KiB
TypeScript
112 lines
5.9 KiB
TypeScript
import Button from "@/components/ui/Button";
|
|
import HeroBackgroundSlot from "@/components/ui/HeroBackgroundSlot";
|
|
import TextAnimation from "@/components/ui/TextAnimation";
|
|
import ImageOrVideo from "@/components/ui/ImageOrVideo";
|
|
import AvatarGroup from "@/components/ui/AvatarGroup";
|
|
|
|
type HeroCenteredLogosProps = {
|
|
avatars: { src: string }[];
|
|
avatarText: string;
|
|
title: string;
|
|
description: string;
|
|
primaryButton: { text: string; href: string };
|
|
secondaryButton: { text: string; href: string };
|
|
logos: string[];
|
|
hideMedia?: boolean;
|
|
} & ({ imageSrc: string; videoSrc?: never } | { videoSrc: string; imageSrc?: never });
|
|
|
|
const HeroCenteredLogos = ({
|
|
avatars,
|
|
avatarText,
|
|
title,
|
|
description,
|
|
primaryButton,
|
|
secondaryButton,
|
|
logos,
|
|
imageSrc,
|
|
videoSrc,
|
|
hideMedia = false,
|
|
}: HeroCenteredLogosProps) => {
|
|
return (
|
|
<section aria-label="Hero section" className="relative h-svh flex flex-col mb-20">
|
|
<HeroBackgroundSlot />
|
|
{!hideMedia && (
|
|
<div className="absolute inset-0 z-0">
|
|
<ImageOrVideo imageSrc={imageSrc} videoSrc={videoSrc} className="size-full object-cover" />
|
|
<div className="absolute inset-0 bg-background/80" />
|
|
</div>
|
|
)}
|
|
|
|
<div className="relative z-10 flex-1 flex items-center justify-center">
|
|
<div className="flex flex-col items-center gap-3 pt-8 w-content-width mx-auto text-center">
|
|
<div className="flex items-center gap-2">
|
|
<AvatarGroup avatars={avatars} label={avatarText} size="lg" />
|
|
<div className="flex items-center gap-1 text-yellow-400">
|
|
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="currentColor" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-star"><polygon points="12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2"/></svg>
|
|
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="currentColor" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-star"><polygon points="12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2"/></svg>
|
|
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="currentColor" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-star"><polygon points="12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2"/></svg>
|
|
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="currentColor" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-star"><polygon points="12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2"/></svg>
|
|
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="currentColor" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-star"><polygon points="12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2"/></svg>
|
|
<span className="text-sm text-foreground/70 ml-1">5.0 (120 Reviews)</span>
|
|
</div>
|
|
</div>
|
|
|
|
<TextAnimation
|
|
text={title}
|
|
variant="fade"
|
|
gradientText={true}
|
|
tag="h1"
|
|
className="md:max-w-8/10 text-6xl font-medium text-balance"
|
|
/>
|
|
|
|
<TextAnimation
|
|
text={description}
|
|
variant="fade"
|
|
gradientText={false}
|
|
tag="p"
|
|
className="md:max-w-6/10 text-base md:text-lg leading-tight text-balance"
|
|
/>
|
|
|
|
<div className="flex flex-wrap justify-center gap-3 mt-2">
|
|
<Button
|
|
text={primaryButton.text}
|
|
href={primaryButton.href}
|
|
variant="primary"
|
|
className="relative overflow-hidden shadow-lg shadow-primary/50 hover:shadow-xl hover:shadow-primary transition-all duration-300 ease-in-out z-10 group"
|
|
>
|
|
<span className="relative z-10 text-white group-hover:text-white">
|
|
{primaryButton.text}
|
|
</span>
|
|
<span className="absolute inset-0 bg-gradient-to-br from-primary/80 to-primary/20 transition-transform duration-500 ease-out group-hover:scale-110 group-active:scale-90" />
|
|
</Button>
|
|
<Button
|
|
text={secondaryButton.text}
|
|
href={secondaryButton.href}
|
|
variant="secondary"
|
|
animationDelay={0.1}
|
|
className="relative overflow-hidden shadow-lg shadow-background/50 hover:shadow-xl hover:shadow-background transition-all duration-300 ease-in-out z-10 group"
|
|
>
|
|
<span className="relative z-10 text-foreground group-hover:text-foreground">
|
|
{secondaryButton.text}
|
|
</span>
|
|
<span className="absolute inset-0 bg-gradient-to-br from-background/80 to-background/20 transition-transform duration-500 ease-out group-hover:scale-110 group-active:scale-90" />
|
|
</Button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div className="relative z-10 w-content-width mx-auto pb-8 overflow-hidden mask-fade-x">
|
|
<div className="flex w-max animate-marquee-horizontal" style={{ animationDuration: "30s" }}>
|
|
{[...logos, ...logos, ...logos, ...logos].map((logo, index) => (
|
|
<div key={index} className="shrink-0 mx-3 px-4 py-2 card rounded">
|
|
<span className="text-xl font-semibold whitespace-nowrap text-foreground/75">{logo}</span>
|
|
</div>
|
|
))}
|
|
</div>
|
|
</div>
|
|
</section>
|
|
);
|
|
};
|
|
|
|
export default HeroCenteredLogos;
|