From a09643d4c237e2734b967e5d1c699d99d10ee2c3 Mon Sep 17 00:00:00 2001 From: bender Date: Mon, 9 Mar 2026 08:26:41 +0000 Subject: [PATCH] Switch to version 1: modified src/components/sections/hero/HeroBillboardGallery.tsx --- .../sections/hero/HeroBillboardGallery.tsx | 215 ++++++++++++++++-- 1 file changed, 191 insertions(+), 24 deletions(-) diff --git a/src/components/sections/hero/HeroBillboardGallery.tsx b/src/components/sections/hero/HeroBillboardGallery.tsx index 08a4a0c..83075b7 100644 --- a/src/components/sections/hero/HeroBillboardGallery.tsx +++ b/src/components/sections/hero/HeroBillboardGallery.tsx @@ -1,33 +1,200 @@ -import React from "react"; +"use client"; + +import TextBox from "@/components/Textbox"; +import MediaContent from "@/components/shared/MediaContent"; import AutoCarousel from "@/components/cardStack/layouts/carousels/AutoCarousel"; +import HeroBackgrounds, { type HeroBackgroundVariantProps } from "@/components/background/HeroBackgrounds"; +import { cls } from "@/lib/utils"; +import { useButtonAnimation } from "@/components/hooks/useButtonAnimation"; +import type { LucideIcon } from "lucide-react"; +import type { ButtonConfig, ButtonAnimationType } from "@/types/button"; + +export interface MediaItem { + imageSrc?: string; + videoSrc?: string; + imageAlt?: string; + videoAriaLabel?: string; +} + +type HeroBillboardGalleryBackgroundProps = Extract< + HeroBackgroundVariantProps, + | { variant: "plain" } + | { variant: "animated-grid" } + | { variant: "canvas-reveal" } + | { variant: "cell-wave" } + | { variant: "downward-rays-animated" } + | { variant: "downward-rays-animated-grid" } + | { variant: "downward-rays-static" } + | { variant: "downward-rays-static-grid" } + | { variant: "gradient-bars" } + | { variant: "radial-gradient" } + | { variant: "rotated-rays-animated" } + | { variant: "rotated-rays-animated-grid" } + | { variant: "rotated-rays-static" } + | { variant: "rotated-rays-static-grid" } + | { variant: "sparkles-gradient" } +>; interface HeroBillboardGalleryProps { - title?: string; - description?: string; - textboxLayout?: string; - animationType?: string; - className?: string; - carouselClassName?: string; - containerClassName?: string; - itemClassName?: string; + title: string; + description: string; + background: HeroBillboardGalleryBackgroundProps; + tag?: string; + tagIcon?: LucideIcon; + tagAnimation?: ButtonAnimationType; + buttons?: ButtonConfig[]; + buttonAnimation?: ButtonAnimationType; + mediaItems: MediaItem[]; + mediaAnimation: ButtonAnimationType; ariaLabel?: string; - mediaItems?: Array<{ imageSrc?: string; videoSrc?: string; imageAlt?: string }>; + className?: string; + containerClassName?: string; + textBoxClassName?: string; + titleClassName?: string; + descriptionClassName?: string; + tagClassName?: string; + buttonContainerClassName?: string; + buttonClassName?: string; + buttonTextClassName?: string; + mediaWrapperClassName?: string; + imageClassName?: string; } -export default function HeroBillboardGallery({ - title = "Gallery", description = "Welcome", textboxLayout = "default", animationType = "slide-up", className = "", carouselClassName = "", containerClassName = "", itemClassName = "", ariaLabel = "Gallery section", mediaItems = [], -}: HeroBillboardGalleryProps) { - const items = mediaItems.map((item) => ({ - imageSrc: item.imageSrc, - videoSrc: item.videoSrc, - imageAlt: item.imageAlt, - })); +const HeroBillboardGallery = ({ + title, + description, + background, + tag, + tagIcon, + tagAnimation, + buttons, + buttonAnimation, + mediaItems, + mediaAnimation, + ariaLabel = "Hero section", + className = "", + containerClassName = "", + textBoxClassName = "", + titleClassName = "", + descriptionClassName = "", + tagClassName = "", + buttonContainerClassName = "", + buttonClassName = "", + buttonTextClassName = "", + mediaWrapperClassName = "", + imageClassName = "", +}: HeroBillboardGalleryProps) => { + const { containerRef: mediaContainerRef } = useButtonAnimation({ animationType: mediaAnimation }); - return ( -
-

{title}

-

{description}

- + const renderCarouselItem = (item: MediaItem, index: number) => ( +
+
); -} + + const itemCount = mediaItems?.length || 0; + const desktopWidthClass = itemCount === 3 ? "md:w-[24%]" : itemCount === 4 ? "md:w-[24%]" : "md:w-[23%]"; + + return ( +
+ +
+ + +
+
+ + {mediaItems?.slice(0, 5).map(renderCarouselItem)} + +
+ +
+
+ {mediaItems?.slice(0, 5).map((item, index) => { + const rotations = ["-rotate-6", "rotate-6", "-rotate-6", "rotate-6", "-rotate-6"]; + const zIndexes = ["z-10", "z-20", "z-30", "z-40", "z-50"]; + const translates = ["-translate-y-5", "translate-y-5", "-translate-y-5", "translate-y-5", "-translate-y-5"]; + const marginClass = index > 0 ? "-ml-12 md:-ml-15" : ""; + + return ( +
+ +
+ ); + })} +
+
+
+
+
+ ); +}; + +HeroBillboardGallery.displayName = "HeroBillboardGallery"; + +export default HeroBillboardGallery;