Skip to content

Commit

Permalink
fix(lazy): only activate preloader-spin animation when slide is active
Browse files Browse the repository at this point in the history
  • Loading branch information
aynzad committed Nov 16, 2021
1 parent 2824b0c commit 72fbda5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/modules/lazy/lazy.less
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,17 @@
margin-top: -21px;
z-index: 10;
transform-origin: 50%;
animation: swiper-preloader-spin 1s infinite linear;
animation: none;
box-sizing: border-box;
border: 4px solid var(--swiper-preloader-color, var(--swiper-theme-color));
border-radius: 50%;
border-top-color: transparent;
}

.swiper-slide-active .swiper-lazy-preloader {
animation: swiper-preloader-spin 1s infinite linear;
}

.swiper-lazy-preloader-white {
--swiper-preloader-color: #fff;
}
Expand Down
6 changes: 5 additions & 1 deletion src/modules/lazy/lazy.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,17 @@
margin-top: -21px;
z-index: 10;
transform-origin: 50%;
animation: swiper-preloader-spin 1s infinite linear;
animation: none;
box-sizing: border-box;
border: 4px solid var(--swiper-preloader-color, var(--swiper-theme-color));
border-radius: 50%;
border-top-color: transparent;
}

.swiper-slide-active .swiper-lazy-preloader {
animation: swiper-preloader-spin 1s infinite linear;
}

.swiper-lazy-preloader-white {
--swiper-preloader-color: #fff;
}
Expand Down

0 comments on commit 72fbda5

Please sign in to comment.