well-waterfall 1.2.5 → 1.2.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.es.js +1057 -1052
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +2 -2
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/index.ts +2 -0
- package/src/modules/playback.ts +7 -1
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -100,7 +100,9 @@ function initConfig(el: HTMLElement, index: number) {
|
|
|
100
100
|
|
|
101
101
|
// Initialize swiper
|
|
102
102
|
const swiperEl = el.querySelector(".swiper");
|
|
103
|
+
if (debug) console.log("SWIPER: ", swiperEl);
|
|
103
104
|
const slides = swiperEl?.querySelectorAll(".swiper-slide") || [];
|
|
105
|
+
if (debug) console.log("SWIPER SLIDES: ", slides);
|
|
104
106
|
if (slides.length === 0) {
|
|
105
107
|
console.warn(`Skipping "${name}": no .swiper-slide elements found.`);
|
|
106
108
|
return;
|
package/src/modules/playback.ts
CHANGED
|
@@ -39,11 +39,17 @@ export function playbackConfig(config: SwiperOptions, el: HTMLElement) {
|
|
|
39
39
|
config.loopPreventsSliding = parseBoolean(el, ATTR_LOOP_PREVENTS_SLIDING, true);
|
|
40
40
|
// Autoplay
|
|
41
41
|
const autoplayMode = parseBoolean(el, ATTR_AUTOPLAY, false);
|
|
42
|
+
|
|
43
|
+
// Smooth Autoplay
|
|
44
|
+
const smoothAutoplay = parseBoolean(el, ATTR_SMOOTH_AUTOPLAY, false);
|
|
45
|
+
let delay = parseNumber(el, ATTR_DELAY, undefined);
|
|
46
|
+
if (smoothAutoplay) delay = 0;
|
|
47
|
+
|
|
42
48
|
if (autoplayMode) {
|
|
43
49
|
// Add CSS for Smooth Autoplay
|
|
44
50
|
setSmoothAutoplay();
|
|
45
51
|
config.autoplay = {
|
|
46
|
-
delay
|
|
52
|
+
delay,
|
|
47
53
|
disableOnInteraction: parseBoolean(el, ATTR_DISABLE_ON_INTERACTION, false), // documentation says default is true, doesn't appear to be correct
|
|
48
54
|
reverseDirection: parseBoolean(el, ATTR_REVERSE_DIRECTION, false),
|
|
49
55
|
pauseOnMouseEnter: parseBoolean(el, ATTR_PAUSE_ON_MOUSE_ENTER, false),
|