PartnerSlider.js
1.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
import React from "react";
import Image from "next/image";
import { cleanImage } from "@/layout/imageHandling";
const PartnerSlider = ({ Clientel = [] }) => {
return (
<div className="partner-area py-2 overflow-hidden">
<div className="container">
<div className="marquee-wrapper position-relative">
<div className="marquee-track d-flex align-items-center">
{/* Duplicate logos for seamless looping */}
{Clientel.concat(Clientel).map((logo, index) => (
<div
className="single-partner-item d-flex justify-content-center align-items-center px-3"
key={`${logo.id}-${index}`}
style={{ flex: "0 0 auto", width: "350px", height: "80px" }}
>
<Image
src={cleanImage(logo?.logos?.[0]?.url)}
alt={logo.altText || "partner logo"}
width={120}
height={60}
className="img-fluid image"
/>
</div>
))}
</div>
</div>
</div>
{/* Smooth marquee animation styles */}
<style jsx>{`
.marquee-wrapper {
width: 100%;
overflow: hidden;
}
.marquee-track {
width: max-content;
animation: scroll-left 30s linear infinite;
}
@keyframes scroll-left {
0% {
transform: translateX(0%);
}
100% {
transform: translateX(-50%);
}
}
`}</style>
</div>
);
};
export default PartnerSlider;