Skip to content

Commit

Permalink
sponsors animation fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
vishnu1345 committed Oct 30, 2024
1 parent ead92de commit d1c5567
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
4 changes: 3 additions & 1 deletion src/Pages/AboutUs/components/projects.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,9 @@ const Projects = (props) => {
onClick={() => handleAccordionClick(index)}
style={{ height: activeIndex === index ? contentHeight + 40 : 40 }}
>
<p ref={el => (paraRef.current[index] = el)}>
<p ref={el => (paraRef.current[index] = el)}
className={clickedIndex === index ? style.whiteText : style.grayText}
>
{title[index]}
</p>
<div
Expand Down
15 changes: 8 additions & 7 deletions src/Pages/Sponsors/Carousel.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,14 @@ export default function Carroussel(props) {
}, [props.offset, props.showArrows, props.autoPlay]);

useEffect(() => {
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 (
<div
Expand All @@ -36,8 +39,6 @@ export default function Carroussel(props) {
offsetRadius={offsetRadius}
showNavigation={showArrows}
animationConfig={config.gentle}
autoPlay={true}
interval={2}
/>
</div>
);
Expand Down

0 comments on commit d1c5567

Please sign in to comment.