From d1c5567591fe416070e7010e3814d49fe41f3f35 Mon Sep 17 00:00:00 2001 From: Vishnu1345 Date: Thu, 31 Oct 2024 00:20:46 +0530 Subject: [PATCH] sponsors animation fixed --- src/Pages/AboutUs/components/projects.jsx | 4 +++- src/Pages/Sponsors/Carousel.jsx | 15 ++++++++------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/Pages/AboutUs/components/projects.jsx b/src/Pages/AboutUs/components/projects.jsx index b035c77..129184f 100644 --- a/src/Pages/AboutUs/components/projects.jsx +++ b/src/Pages/AboutUs/components/projects.jsx @@ -143,7 +143,9 @@ const Projects = (props) => { onClick={() => handleAccordionClick(index)} style={{ height: activeIndex === index ? contentHeight + 40 : 40 }} > -

(paraRef.current[index] = el)}> +

(paraRef.current[index] = el)} + className={clickedIndex === index ? style.whiteText : style.grayText} + > {title[index]}

{ - setInterval(1000, () => { - console.log("Running", goToSlide); - setGoToSlide(goToSlide + (1 % 3)); - }); - }, []); + if (autoPlay) { + const intervalId = setInterval(() => { + setGoToSlide((prevSlide) => (prevSlide + 1) % cards.length); + }, props.interval * 1000); + + return () => clearInterval(intervalId); + } + }, [autoPlay, cards.length, props.interval]); return (
);