Fixed swiper style

This commit is contained in:
kvakazyambra 2023-11-06 23:33:57 +03:00
parent 4e1b6ad8b3
commit cd0fb796ab
2 changed files with 17 additions and 13 deletions

View File

@ -41,9 +41,12 @@ export const ArticleCardSwiper = (props: Props) => {
thumbs-swiper={'.thumbSwiper'} thumbs-swiper={'.thumbSwiper'}
observer={true} observer={true}
onSlideChange={handleSlideChange} onSlideChange={handleSlideChange}
slides-per-view={props.slidesPerView ?? 1.5} slides-per-view="1"
space-between={52} space-between={26}
breakpoints={{ 768: { spaceBetween: 26 }, 992: { spaceBetween: 52 } }} breakpoints={{
576: { slidesPerView: props.slidesPerView ?? 1.5 },
992: { spaceBetween: 52 }
}}
loop={true} loop={true}
speed={800} speed={800}
autoplay={{ autoplay={{

View File

@ -1,10 +1,10 @@
$navigation-reserve: 32px;
:root { :root {
--slide-height: 300px; --slide-height: 300px;
--navigation-reserve: 48px;
@include media-breakpoint-up(md) { @include media-breakpoint-up(md) {
--slide-height: 500px; --slide-height: 500px;
--navigation-reserve: 56px;
} }
} }
@ -165,16 +165,14 @@ $navigation-reserve: 32px;
} }
.navigation { .navigation {
background: rgb(0 0 0 / 40%);
display: flex; display: flex;
position: absolute; position: absolute;
top: 0; top: 0;
bottom: 0; bottom: 0;
justify-content: center;
align-items: center; align-items: center;
cursor: pointer; cursor: pointer;
height: var(--slide-height); height: 100%;
width: 52px; width: 12.5%;
z-index: 2; z-index: 2;
&.disabled { &.disabled {
@ -183,16 +181,19 @@ $navigation-reserve: 32px;
} }
&.prev { &.prev {
background-image: linear-gradient(to right, #000, rgb(0 0 0 / 0));
left: 0; left: 0;
} }
&.next { &.next {
background-image: linear-gradient(to left, #000, rgb(0 0 0 / 0));
justify-content: end;
right: 0; right: 0;
} }
.icon { .icon {
height: $navigation-reserve; height: var(--navigation-reserve);
width: $navigation-reserve; width: var(--navigation-reserve);
transition: 0.3s ease-in-out; transition: 0.3s ease-in-out;
} }
@ -242,11 +243,11 @@ $navigation-reserve: 32px;
height: auto; height: auto;
&.prev { &.prev {
left: -$navigation-reserve; left: -var(--navigation-reserve);
} }
&.next { &.next {
right: -$navigation-reserve; right: -var(--navigation-reserve);
} }
} }