Skip to content

Commit

Permalink
fix: new slider styles (#979)
Browse files Browse the repository at this point in the history
* fix: slider new keep autoplay after interaction

* fix: slider new safari fix

* fix: slider new dots classname
  • Loading branch information
qradle-yndx authored Aug 7, 2024
1 parent 3068e0f commit d702a42
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 deletions.
24 changes: 20 additions & 4 deletions src/blocks/SliderNew/Slider.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ $block: '.#{$ns}SliderNewBlock';
}
}

$dotsCn: '.swiper-container-horizontal .swiper-pagination-bullets';

$dotSize: 8px;

#{$block} {
Expand All @@ -33,10 +35,24 @@ $dotSize: 8px;
}
}

&__slide {
&__slide.swiper-slide {
padding: 0 #{$gridGutter};
box-sizing: border-box;
flex-shrink: 0;
height: auto;

@keyframes safari-fix {
from {
transform: translateX(0.001px);
}
to {
transform: translateX(0);
}
}

// fix text under video in safari
&.swiper-slide-visible {
animation: safari-fix 300ms;
}
}

&__arrow {
Expand Down Expand Up @@ -121,7 +137,7 @@ $dotSize: 8px;

padding: 0;

#{$root}__dots {
& #{$dotsCn} {
bottom: $indentSM;
}

Expand Down Expand Up @@ -167,7 +183,7 @@ $dotSize: 8px;
position: relative;
}

#{$root}__dots {
& #{$dotsCn} {
bottom: $indentM;
}

Expand Down
1 change: 1 addition & 0 deletions src/blocks/SliderNew/useSlider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ export const useSlider = ({
setIsLocked,
autoplay: autoplayEnabled && {
delay: autoplayMs,
disableOnInteraction: false,
},
};
};

0 comments on commit d702a42

Please sign in to comment.