Skip to content

Commit b7d89ea

Browse files
authored
fix(lazy): only activate preloader-spin animation when slide is activ… (#5203)
* fix(lazy): only activate preloader-spin animation when slide is active #5202 * chore(lazy): remove unnecessary animation: none * refactor(lazy): animate preloader for all visible slides
1 parent 987a32e commit b7d89ea

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/modules/lazy/lazy.less

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,16 @@
1414
margin-top: -21px;
1515
z-index: 10;
1616
transform-origin: 50%;
17-
animation: swiper-preloader-spin 1s infinite linear;
1817
box-sizing: border-box;
1918
border: 4px solid var(--swiper-preloader-color, var(--swiper-theme-color));
2019
border-radius: 50%;
2120
border-top-color: transparent;
2221
}
2322

23+
.swiper-slide-visible .swiper-lazy-preloader {
24+
animation: swiper-preloader-spin 1s infinite linear;
25+
}
26+
2427
.swiper-lazy-preloader-white {
2528
--swiper-preloader-color: #fff;
2629
}

src/modules/lazy/lazy.scss

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,16 @@
1414
margin-top: -21px;
1515
z-index: 10;
1616
transform-origin: 50%;
17-
animation: swiper-preloader-spin 1s infinite linear;
1817
box-sizing: border-box;
1918
border: 4px solid var(--swiper-preloader-color, var(--swiper-theme-color));
2019
border-radius: 50%;
2120
border-top-color: transparent;
2221
}
2322

23+
.swiper-slide-visible .swiper-lazy-preloader {
24+
animation: swiper-preloader-spin 1s infinite linear;
25+
}
26+
2427
.swiper-lazy-preloader-white {
2528
--swiper-preloader-color: #fff;
2629
}

0 commit comments

Comments
 (0)