Skip to content

Commit

Permalink
fix(core): animate preloader in visible slides if watchSlidesProgress…
Browse files Browse the repository at this point in the history
… is enabled
  • Loading branch information
nolimits4web committed Apr 24, 2022
1 parent de47f09 commit 8174b5a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/core/classes/addClasses.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export default function addClasses() {
{ 'ios': device.ios },
{ 'css-mode': params.cssMode },
{ 'centered': params.cssMode && params.centeredSlides },
{ 'watch-progress': params.watchSlidesProgress },
], params.containerModifierClass);
classNames.push(...suffixes);
$el.addClass([...classNames].join(' '));
Expand Down
8 changes: 6 additions & 2 deletions src/modules/lazy/lazy.less
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,13 @@
border: 4px solid var(--swiper-preloader-color, var(--swiper-theme-color));
border-radius: 50%;
border-top-color: transparent;
animation: swiper-preloader-spin 1s infinite linear;
}

.swiper:not(.swiper-watch-progress),
.swiper-watch-progress .swiper-slide-visible {
.swiper-lazy-preloader {
animation: swiper-preloader-spin 1s infinite linear;
}
}
.swiper-lazy-preloader-white {
--swiper-preloader-color: #fff;
}
Expand Down
7 changes: 6 additions & 1 deletion src/modules/lazy/lazy.scss
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,12 @@
border: 4px solid var(--swiper-preloader-color, var(--swiper-theme-color));
border-radius: 50%;
border-top-color: transparent;
animation: swiper-preloader-spin 1s infinite linear;
}
.swiper:not(.swiper-watch-progress),
.swiper-watch-progress .swiper-slide-visible {
.swiper-lazy-preloader {
animation: swiper-preloader-spin 1s infinite linear;
}
}

.swiper-lazy-preloader-white {
Expand Down

0 comments on commit 8174b5a

Please sign in to comment.