Skip to content

Commit

Permalink
added
Browse files Browse the repository at this point in the history
  • Loading branch information
mithelan committed Oct 28, 2024
1 parent adf3b2d commit 6e44484
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 1 deletion.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
},
"dependencies": {
"react": "^18.3.1",
"react-dom": "^18.3.1"
"react-dom": "^18.3.1",
"react-multi-carousel": "^2.8.5"
},
"devDependencies": {
"@eslint/js": "^9.11.1",
Expand Down
55 changes: 55 additions & 0 deletions src/components/Carousel/Carousel.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
import Carousel from "react-multi-carousel";
import "react-multi-carousel/lib/styles.css";

const CarouselCustom = () => {
const responsive = {
superLargeDesktop: {
breakpoint: { max: 4000, min: 1024 },
items: 6,
},
desktop: {
breakpoint: { max: 1024, min: 768 },
items: 4,
},
tablet: {
breakpoint: { max: 768, min: 464 },
items: 2,
},
mobile: {
breakpoint: { max: 464, min: 0 },
items: 1,
},
};

const logos = [
{ src: "https://images.unsplash.com/photo-1496200186974-4293800e2c20?w=800&auto=format&fit=crop&q=60&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxzZWFyY2h8Nnx8bG9nb3xlbnwwfHwwfHx8MA%3D%3D", alt: "UFC Logo" },
{ src: "https://images.unsplash.com/photo-1496200186974-4293800e2c20?w=800&auto=format&fit=crop&q=60&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxzZWFyY2h8Nnx8bG9nb3xlbnwwfHwwfHx8MA%3D%3D", alt: "UFC Logo" },
{ src: "https://images.unsplash.com/photo-1496200186974-4293800e2c20?w=800&auto=format&fit=crop&q=60&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxzZWFyY2h8Nnx8bG9nb3xlbnwwfHwwfHx8MA%3D%3D", alt: "UFC Logo" },
];

return (
<div style={{ padding: "20px", backgroundColor: "#001e36" }}>
<Carousel
responsive={responsive}
infinite={true}
autoPlay={true}
autoPlaySpeed={2000}
customTransition="transform 0.5s ease"
transitionDuration={500}
containerClass="carousel-container"
>
{logos.map((logo, index) => (
<div key={index} style={{ display: "flex", justifyContent: "center", alignItems: "center" }}>
<img
src={logo.src}
alt={logo.alt}
style={{ width: "150px", height: "auto", maxWidth: "100%" }}
/>
</div>
))}
</Carousel>
</div>
);
};

export default CarouselCustom;

0 comments on commit 6e44484

Please sign in to comment.