diff --git a/src/App.tsx b/src/App.tsx index f7e2400..e7137f3 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -3,7 +3,7 @@ import ContactSplitEmail from '@/components/sections/contact/ContactSplitEmail'; import FaqSimple from '@/components/sections/faq/FaqSimple'; import FeaturesTaggedCards from '@/components/sections/features/FeaturesTaggedCards'; import FooterSimpleMedia from '@/components/sections/footer/FooterSimpleMedia'; -import HeroBillboardScroll from '@/components/sections/hero/HeroBillboardScroll'; +import HeroBillboardCarousel from '@/components/sections/hero/HeroBillboardCarousel'; import NavbarCentered from '@/components/ui/NavbarCentered'; import ProductVariantCards from '@/components/sections/product/ProductVariantCards'; import TestimonialAvatarCard from '@/components/sections/testimonial/TestimonialAvatarCard'; @@ -40,19 +40,51 @@ export default function App() {
-
diff --git a/src/components/sections/hero/HeroBillboardCarousel.tsx b/src/components/sections/hero/HeroBillboardCarousel.tsx index c54e66f..3eefcb1 100644 --- a/src/components/sections/hero/HeroBillboardCarousel.tsx +++ b/src/components/sections/hero/HeroBillboardCarousel.tsx @@ -1,69 +1,96 @@ +"use client"; + +import useEmblaCarousel from "embla-carousel-react"; +import { ChevronLeft, ChevronRight } from "lucide-react"; +import { motion } from "motion/react"; + import Button from "@/components/ui/Button"; import TextAnimation from "@/components/ui/TextAnimation"; import ImageOrVideo from "@/components/ui/ImageOrVideo"; +import { useCarouselControls } from "@/hooks/useCarouselControls"; -type HeroBillboardCarouselProps = { +type Slide = { tag: string; title: string; description: string; primaryButton: { text: string; href: string }; secondaryButton: { text: string; href: string }; - items: ({ imageSrc: string; videoSrc?: never } | { videoSrc: string; imageSrc?: never })[]; +} & ({ imageSrc: string; videoSrc?: never } | { videoSrc: string; imageSrc?: never }); + +type HeroBillboardCarouselProps = { + slides: Slide[]; }; -const HeroBillboardCarousel = ({ - tag, - title, - description, - primaryButton, - secondaryButton, - items, -}: HeroBillboardCarouselProps) => { - const duplicated = [...items, ...items, ...items, ...items]; +const HeroBillboardCarousel = ({ slides }: HeroBillboardCarouselProps) => { + const [emblaRef, emblaApi] = useEmblaCarousel({ loop: true }); + const { prevDisabled, nextDisabled, scrollPrev, scrollNext, scrollProgress } = useCarouselControls(emblaApi); return ( -
-
- {tag} - - - - - -
-
+
+ + + ))} -
-
- {duplicated.map((item, i) => ( -
- -
- ))} +
+
+ + +
+
+
); }; -export default HeroBillboardCarousel; +export default HeroBillboardCarousel; \ No newline at end of file