const { useState, useEffect, useLayoutEffect, useRef, useMemo, useImperativeHandle, forwardRef } = React; const JourneysInLogos = ({ wrapperClassName = "w-full mt-32" }) => { const scrollRef = useRef(null); const partners = [ { name: "Knack", type: "Global Talent Platform", src: "logos/logo-journey/knack.jpeg" }, { name: "Apple", type: "Global Tech Company", src: "logos/logo-journey/apple.png" }, { name: "Juventus", type: "Sports Club", src: "logos/logo-journey/juventus.png" }, { name: "Flux Logistics", type: "Logistics Group", src: "logos/logo-journey/flux.png" }, { name: "Meta", type: "Global Tech Company", src: "logos/logo-journey/meta.png" }, { name: "Casa", type: "Lifestyle Furniture Brand", src: "logos/logo-journey/casa.png" }, { name: "SMAC", type: "Sports Entertainment", src: "logos/logo-journey/smac.png" } ]; const loopedPartners = [...partners, ...partners, ...partners, ...partners, ...partners]; useEffect(() => { const el = scrollRef.current; if (!el) return; const itemWidth = 280 + 24; // Width (280px) + Gap (6 * 4 = 24px) const totalSetWidth = partners.length * itemWidth; const handleScroll = () => { const { scrollLeft, scrollWidth, clientWidth } = el; // If we've scrolled near the end of the looped content, jump back to the middle set if (scrollLeft + clientWidth >= scrollWidth - itemWidth) { el.scrollLeft = scrollLeft - totalSetWidth; } // If we've scrolled near the start, jump forward if (scrollLeft <= itemWidth) { el.scrollLeft = scrollLeft + totalSetWidth; } }; el.addEventListener('scroll', handleScroll); // Initial scroll to the second set of logos to allow infinite scroll in both directions el.scrollLeft = totalSetWidth; return () => el.removeEventListener('scroll', handleScroll); }, []); const scroll = (direction) => { if (scrollRef.current) { const scrollAmount = 400; const { scrollLeft, scrollWidth, clientWidth } = scrollRef.current; if (direction === "right" && scrollLeft >= scrollWidth - clientWidth - 10) { scrollRef.current.scrollTo({ left: 0, behavior: "smooth" }); } else if (direction === "left" && scrollLeft <= 10) { scrollRef.current.scrollTo({ left: scrollWidth - clientWidth, behavior: "smooth" }); } else { scrollRef.current.scrollBy({ left: direction === "left" ? -scrollAmount : scrollAmount, behavior: "smooth" }); } } }; return (

Our journey in logos

{loopedPartners.map((partner, i) => (
{partner.src ? ( {`${partner.name} ) : (
{partner.name}
)}
{partner.type}
))}
); }; window.JourneysInLogos = JourneysInLogos;