Skip to content

Commit

Permalink
fix(www): Carousel not working properly
Browse files Browse the repository at this point in the history
  • Loading branch information
babiabeo authored and marvinhagemeister committed Jan 10, 2024
1 parent f637520 commit 8864606
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions www/components/gallery/Carousel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,13 @@ const Carousel = (props: CarouselProps) => {
let incomingSlide = currentSlide.value + 1;
if (outgoingSlide === -1) outgoingSlide = SLIDE_DATA.length - 1;
if (incomingSlide === SLIDE_DATA.length) incomingSlide = 0;
// console.log(outgoingSlide, currentSlide.value, incomingSlide)
const TRANSITION_CLASS = () => {
if (currentSlide.value === idx) return "translate-x-0 z-20";
if (incomingSlide === idx) return "translate-x-full z-10";
if (outgoingSlide === idx) return "-translate-x-full z-10";
return "translate-x-full";
};
return `slide absolute top-0 left-0 transition-all ease-in-out duration-700 transform ${TRANSITION_CLASS}`;
return `slide absolute top-0 left-0 transition-all ease-in-out duration-700 transform ${TRANSITION_CLASS()}`;
};

const nextSlide = () => {
Expand Down

0 comments on commit 8864606

Please sign in to comment.