doc: added Carousel and Images to the HeroCarousel component

This commit is contained in:
Leon Xu committed 2023-12-30 12:00:28 -08:00
1 parent d4c21a126f
commit 5c04d8665c
1 file changed
+65
+65
View File
@@ -0,0 +1,65 @@
"use client";
import "react-responsive-carousel/lib/styles/carousel.min.css"; // requires a loader
import { Carousel } from "react-responsive-carousel";
import Image from "next/image";
const heroImages = [
{
imgUrl: "/assets/images/hero-1.svg",
alt: "smart watch",
},
{
imgUrl: "/assets/images/hero-2.svg",
alt: "bag",
},
{
imgUrl: "/assets/images/hero-3.svg",
alt: "lamp",
},
{
imgUrl: "/assets/images/hero-4.svg",
alt: "air fryer",
},
{
imgUrl: "/assets/images/hero-5.svg",
alt: "chair",
},
];
const HeroCarousel = () => {
return (
<div className="hero-carousel">
<Carousel
showThumbs={false}
autoPlay
infiniteLoop
interval={2000}
showArrows={false}
showStatus={false}
>
{heroImages.map((image) => (
<Image
src={image.imgUrl}
alt={image.alt}
width={484}
height={484}
className="object-contain"
key={image.alt}
/>
))}
</Carousel>
<Image
src="assets/icons/hand-drawn-arrow.svg"
alt="arrow"
width={175}
height={175}
className="max-xl:hidden absolute -left-[15%] bottom-0"
/>
</div>
);
};
export default HeroCarousel;