Skip to content

Commit

Permalink
fixed padding of hidden carousel dots
Browse files Browse the repository at this point in the history
  • Loading branch information
Resaki1 committed Oct 19, 2023
1 parent 5ec471c commit 652adf0
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 21 deletions.
37 changes: 21 additions & 16 deletions src/components/Feedback/FeedbackCarousel.scss
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
all: unset;
padding: 16px 8px;
cursor: pointer;
transition: all 0.4s cubic-bezier(0.7, 0.53, 0.17, 0.99);

&:hover > .feedback-carousel__dot {
transform: scale(1.4);
Expand All @@ -33,35 +34,39 @@
&:focus-visible > .feedback-carousel__dot {
outline: 3px solid var(--darkmode-pink);
}
}

.feedback-carousel__dot {
display: block;
width: 8px;
height: 8px;
border-radius: 50%;
background-color: var(--lightmode-pink);
opacity: 0.5;

transition: all 0.4s cubic-bezier(0.7, 0.53, 0.17, 0.99);

&.active {
&.active > .feedback-carousel__dot {
transform: scale(1.2);
opacity: 1;
}

&.small {
&.small > .feedback-carousel__dot {
width: 4px;
height: 4px;
}

&.hidden {
width: 0px;
height: 0px;
margin: 0;
padding: 0;

> .feedback-carousel__dot {
width: 0px;
height: 0px;
margin: 0;
}
}
}

.feedback-carousel__dot {
display: block;
width: 8px;
height: 8px;
border-radius: 50%;
background-color: var(--lightmode-pink);
opacity: 0.5;

transition: all 0.4s cubic-bezier(0.7, 0.53, 0.17, 0.99);
}

.use-spring-carousel-item {
justify-content: center;
}
Expand Down
7 changes: 2 additions & 5 deletions src/components/Feedback/FeedbackCarousel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -126,16 +126,13 @@ const FeedbackCarousel = ({ items }: FeedbackCarouselProps) => {
return (
<button
key={index}
className="feedback-carousel__button"
className={`feedback-carousel__button ${dotState}`}
onClick={() => {
slideToItem(index);
setActiveSlide(index);
}}
>
<div
className={`feedback-carousel__dot ${dotState}
`}
/>
<div className="feedback-carousel__dot" />
</button>
);
})}
Expand Down

0 comments on commit 652adf0

Please sign in to comment.