feat: add row height control to BentoGrid and remove gradient blobs from StackSection

This commit is contained in:
2025-09-18 20:26:37 +02:00
parent cde6c90033
commit bf78cde2d8
3 changed files with 47 additions and 41 deletions

View File

@@ -78,7 +78,8 @@ export function BentoReviews() {
whileInView={{ opacity: 1, y: 0 }} whileInView={{ opacity: 1, y: 0 }}
viewport={{ once: false, margin: '0px 0px -100px 0px' }} viewport={{ once: false, margin: '0px 0px -100px 0px' }}
transition={{ duration: 0.8, delay: 0.3 + i * 0.1 }} transition={{ duration: 0.8, delay: 0.3 + i * 0.1 }}
className={cn(i === 3 || i === 6 ? "md:col-span-2" : "", "h-full")} className={cn(i === 3 || i === 6 ? "md:col-span-2" : "")}
rowHeight={i >= 3 ? "h-[22rem]" : ""}
title={item.title} title={item.title}
subtitle={item.subtitle} subtitle={item.subtitle}
description={item.description} description={item.description}

View File

@@ -8,13 +8,6 @@ export function StackSectionPreview() {
return ( return (
<section className="w-full bg-transparent lg:px-0 py-24 px-6 relative"> <section className="w-full bg-transparent lg:px-0 py-24 px-6 relative">
{/* Gradient Blob Component */}
<div
className="absolute w-[400px] h-[200px] bg-gradient-to-br from-[#505050] to-[#7e7e7e] rounded-full blur-[150px] bottom-[200px] left-[-150px] z-0"
/>
<div
className="absolute w-[200px] h-[100px] bg-gradient-to-br from-[#505050] to-[#7e7e7e] rounded-full blur-[150px] top-[200px] right-[-150px] z-0"
/>
<div className="mx-auto max-w-7xl"> <div className="mx-auto max-w-7xl">
<div className="grid grid-cols-1 lg:grid-cols-3 gap-4 lg:gap-16 items-center lg:items-start"> <div className="grid grid-cols-1 lg:grid-cols-3 gap-4 lg:gap-16 items-center lg:items-start">
{/* Left Column - Text (1/3 width) */} {/* Left Column - Text (1/3 width) */}

View File

@@ -23,20 +23,25 @@ export const BentoGrid = ({
); );
}; };
export const BentoGridItem = React.forwardRef<HTMLDivElement, { interface BentoGridItemProps {
className?: string; className?: string;
title?: string | React.ReactNode; title?: string | React.ReactNode;
subtitle?: string | React.ReactNode; subtitle?: string | React.ReactNode;
description?: string | React.ReactNode; description?: string | React.ReactNode;
img?: string; img?: string;
video?: string; video?: string;
}>(({ className, title, subtitle, description, img, video }, ref) => { rowHeight?: string;
}
export const BentoGridItem = React.forwardRef<HTMLDivElement, BentoGridItemProps>(
({ className, title, subtitle, description, img, video, rowHeight }, ref) => {
return ( return (
<div <div
ref={ref} ref={ref}
className={cn( className={cn(
"group/bento shadow-input row-span-1 flex flex-col justify-between rounded-xl border border-black bg-black/10 backdrop-blur-md transition-all duration-300 ease-in-out hover:scale-105 hover:border-black hover:bg-black/40", "group/bento shadow-input row-span-1 flex flex-col justify-between rounded-xl border border-black bg-black/10 backdrop-blur-md transition-all duration-300 ease-in-out hover:scale-105 hover:border-black hover:bg-black/40",
className, rowHeight ? rowHeight : "h-full",
className
)} )}
> >
<div className="flex flex-1 w-full h-full min-h-[6rem] bg-transparent overflow-hidden"> <div className="flex flex-1 w-full h-full min-h-[6rem] bg-transparent overflow-hidden">
@@ -50,7 +55,13 @@ export const BentoGridItem = React.forwardRef<HTMLDivElement, {
className="w-full h-full object-cover opacity-90 group-hover/bento:opacity-100 transition-opacity duration-300" className="w-full h-full object-cover opacity-90 group-hover/bento:opacity-100 transition-opacity duration-300"
/> />
) : img ? ( ) : img ? (
<Image src={img} alt={title as string} width={300} height={300} className="w-full h-full object-cover opacity-90 group-hover/bento:opacity-100 transition-opacity duration-300" /> <Image
src={img}
alt={title as string}
width={300}
height={300}
className="w-full h-full object-cover opacity-90 group-hover/bento:opacity-100 transition-opacity duration-300"
/>
) : null} ) : null}
</div> </div>
<div className="p-4 transition bg-white/5 hover:bg-white/7 backdrop-blur-md duration-200 group-hover/bento:translate-x-2 "> <div className="p-4 transition bg-white/5 hover:bg-white/7 backdrop-blur-md duration-200 group-hover/bento:translate-x-2 ">
@@ -60,8 +71,9 @@ export const BentoGridItem = React.forwardRef<HTMLDivElement, {
</div> </div>
</div> </div>
); );
}); }
);
BentoGridItem.displayName = 'BentoGridItem'; BentoGridItem.displayName = "BentoGridItem";
export const MotionBentoGridItem = motion(BentoGridItem); export const MotionBentoGridItem = motion(BentoGridItem);