well-waterfall 0.1.42 → 0.1.44

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/waterfall.js CHANGED
@@ -150,6 +150,16 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
150
150
 
151
151
  /***/ }),
152
152
 
153
+ /***/ "./src/modules/general.ts":
154
+ /*!********************************!*\
155
+ !*** ./src/modules/general.ts ***!
156
+ \********************************/
157
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
158
+
159
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ generalConfig: () => (/* binding */ generalConfig)\n/* harmony export */ });\n/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../util */ \"./src/util.ts\");\n\nfunction generalConfig($this) {\n return {\n a11y: {\n prevSlideMessage: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'a11y-prev-message', 'Previous Slide'),\n nextSlideMessage: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'a11y-next-message', 'Next Slide'),\n },\n allowSlideNext: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'allow-slide-next', true),\n allowSlidePrev: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'allow-slide-prev', true),\n allowTouchMove: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'allow-touch-move', true),\n autoHeight: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'auto-height', false),\n breakpointsBase: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'breakpoints-base', 'window'),\n centerInsufficientSlides: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'center-insufficient-slides', false),\n centeredSlides: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'centered-slides', false),\n containerModifierClass: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'container-modifier-class', 'swiper-'),\n createElements: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'create-elements', false),\n cssMode: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'css-mode', false),\n direction: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'direction', 'horizontal'),\n edgeSwipeDetection: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'edge-swipe-detection', false),\n edgeSwipeThreshold: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'edge-swipe-threshold', 20),\n effect: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'effect', 'slide'),\n enabled: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'enabled', true),\n eventsPrefix: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'events-prefix', 'swiper'),\n focusableElements: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'focusable-elements', 'input, select, option, textarea, button, video, label'),\n followFinger: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'follow-finger', true),\n freeMode: {\n enabled: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'free-mode-enabled', false),\n sticky: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'free-mode-sticky', false),\n },\n grabCursor: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'grab-cursor', false),\n //hashNavigation: null,\n height: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'height', null),\n //history: null,\n init: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'init', true),\n initialSlide: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'initial-slide', 0),\n //injectStyles: null, // not needed\n //injectStylesUrls: null, // not needed\n lazyPreloadPrevNext: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'lazy-preload-prev-next', 0),\n lazyPreloaderClass: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'lazy-preloader-class', 'swiper-lazy-preloader'),\n longSwipes: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'long-swipes', true), // no effect\n longSwipesMs: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'long-swipes-ms', 300), // no effect\n longSwipesRatio: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'long-swipes-ratio', 0.5), // no effect\n loop: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'loop-mode', false),\n loopAddBlankSlides: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'loop-add-blank-slides', true),\n loopAdditionalSlides: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'loop-additional-slides', 0),\n loopPreventsSliding: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'loop-prevents-sliding', true),\n maxBackfaceHiddenSlides: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'max-backface-hidden-slides', 10),\n //modules: null, // take a look at this\n //mouseWheel: null,\n //navigation: null,\n nested: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'nested', false),\n noSwiping: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'no-swiping', true),\n noSwipingClass: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'no-swiping-class', 'swiper-no-swiping'),\n noSwipingSelector: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'no-swiping-selector', null),\n normalizeSlideIndex: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'normalize-slide-index', true),\n observeParents: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'observe-parents', false),\n observeSlideChildren: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'observe-slide-children', false),\n //observer: null,\n //on: null,\n //onAny: null,\n oneWayMovement: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'data-one-way-movement', false),\n //parallax: null,\n passiveListeners: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'passive-listeners', true),\n preventClicks: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'prevent-clicks', true),\n preventClicksPropagation: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'prevent-clicks-propagation', true),\n preventInteractionOnTransition: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'prevent-interaction-on-transition', false),\n resistance: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'resistance', true),\n resistanceRatio: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'resistance-ratio', 0.85),\n resizeObserver: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'resize-observer', true),\n rewind: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'rewind', false),\n roundLengths: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'round-lengths', false),\n runCallbacksOnInit: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'run-callbacks-on-init', true),\n // setWrapperSize: getAttr($this, 'set-wrapper-size', false),\n shortSwipes: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'short-swipes', true),\n simulateTouch: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'simulate-touch', true),\n slideActiveClass: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'slide-active-class', 'swiper-slide-active'),\n slideBlankClass: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'slide-blank-class', 'swiper-slide-blank'),\n slideClass: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'slide-class', 'swiper-slide'),\n slideFullyVisibleClass: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'slide-fully-visible-class', 'swiper-slide-fully-visible'),\n slideNextClass: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'slide-next-class', 'swiper-slide-next'),\n slidePrevClass: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'slide-prev-class', 'swiper-slide-prev'),\n slideToClickedSlide: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'slide-to-clicked-slide', false),\n slideVisibleClass: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'slide-visible-class', 'swiper-slide-visible'),\n slidesOffsetAfter: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'slides-offset-after', 0),\n slidesOffsetBefore: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'slides-offset-before', 0),\n slidesPerGroup: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'slides-per-group', 1),\n slidesPerGroupAuto: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'slides-per-group-auto', false),\n slidesPerGroupSkip: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'slides-per-group-skip', 0),\n slidesPerView: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'slides-per-view', '1'),\n spaceBetween: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'space-between', 0),\n speed: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'speed', 300),\n // swipeHandler: getAttr($this, \"swipe-handler\", null),\n swiperElementNodeName: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'swiper-element-node-name', 'SWIPER-CONTAINER'),\n threshold: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'threshold', 5),\n touchAngle: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'touch-angle', 45),\n touchEventsTarget: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'touch-events-target', 'wrapper'),\n touchMoveStopPropagation: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'touch-move-stop-propagation', false),\n touchRatio: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'touch-ratio', 1),\n touchReleaseOnEdges: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'touch-release-on-edges', false),\n touchStartForcePreventDefault: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'touch-start-force-prevent-default', false),\n touchStartPreventDefault: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'touch-start-prevent-default', true),\n uniqueNavElements: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'unique-nav-elements', true),\n updateOnWindowResize: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'update-on-window-resize', true),\n //url: getAttr($this, \"url\", \"null\"),\n //userAgent: getAttr($this, \"user-agent\", \"null\"),\n //virtual: null,\n virtualTranslate: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'virtual-translate', false),\n watchOverflow: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'watch-overflow', true),\n watchSlidesProgress: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'watch-slides-progress', false),\n width: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'width', null),\n wrapperClass: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'wrapper-class', 'swiper-wrapper'),\n //zoom: null,\n };\n}\n\n\n//# sourceURL=webpack://Waterfall/./src/modules/general.ts?");
160
+
161
+ /***/ }),
162
+
153
163
  /***/ "./src/modules/layout.ts":
154
164
  /*!*******************************!*\
155
165
  !*** ./src/modules/layout.ts ***!
@@ -200,6 +210,16 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
200
210
 
201
211
  /***/ }),
202
212
 
213
+ /***/ "./src/modules/slideCount.ts":
214
+ /*!***********************************!*\
215
+ !*** ./src/modules/slideCount.ts ***!
216
+ \***********************************/
217
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
218
+
219
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ initSlideCount: () => (/* binding */ initSlideCount)\n/* harmony export */ });\n/**\n * Creates a Slide Count element that displays the current slide number.\n */\nfunction initSlideCount() {\n document.querySelectorAll('.swiper-wrapper').forEach((swiperWrapper) => {\n swiperWrapper.querySelectorAll('.swiper-slide').forEach((slide, index) => {\n const countEl = slide.querySelector('[waterfall-el=\"slide-count\"]');\n if (countEl) {\n countEl.textContent = (index + 1).toString();\n }\n });\n });\n}\n\n\n//# sourceURL=webpack://Waterfall/./src/modules/slideCount.ts?");
220
+
221
+ /***/ }),
222
+
203
223
  /***/ "./src/util.ts":
204
224
  /*!*********************!*\
205
225
  !*** ./src/util.ts ***!
@@ -216,7 +236,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
216
236
  \**************************/
217
237
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
218
238
 
219
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var swiper_bundle__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! swiper/bundle */ \"./node_modules/swiper/swiper-bundle.mjs\");\n/* harmony import */ var swiper_css_bundle__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! swiper/css/bundle */ \"./node_modules/swiper/swiper-bundle.css\");\n/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./util */ \"./src/util.ts\");\n/* harmony import */ var _modules_navigation__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./modules/navigation */ \"./src/modules/navigation.ts\");\n/* harmony import */ var _modules_breakpoints__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./modules/breakpoints */ \"./src/modules/breakpoints.ts\");\n/* harmony import */ var _modules_pagination__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./modules/pagination */ \"./src/modules/pagination.ts\");\n/* harmony import */ var _modules_scrollbar__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./modules/scrollbar */ \"./src/modules/scrollbar.ts\");\n/* harmony import */ var _modules_playback__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./modules/playback */ \"./src/modules/playback.ts\");\n/* harmony import */ var _modules_effect__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./modules/effect */ \"./src/modules/effect.ts\");\n/* harmony import */ var _modules_layout__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./modules/layout */ \"./src/modules/layout.ts\");\n\n\n\n\n\n\n\n\n\n\nconsole.log(`🚿 Hello from Wellflow Waterfall v${\"0.1.42\"}`);\nconst sliders = [];\n$('[waterfall]').each(function (index) {\n const $this = $(this);\n const name = (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseString)($this, 'waterfall', `Swiper ${index}`);\n if (!name)\n return;\n const debug = Boolean((0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'debug-mode', false) || false);\n console.log(`Initializing Waterfall: ${name} ${debug ? '[DEBUG MODE]' : ''}`);\n const swiperConfig = {\n a11y: {\n prevSlideMessage: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'a11y-prev-message', 'Previous Slide'),\n nextSlideMessage: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'a11y-next-message', 'Next Slide'),\n },\n allowSlideNext: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'allow-slide-next', true),\n allowSlidePrev: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'allow-slide-prev', true),\n allowTouchMove: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'allow-touch-move', true),\n autoHeight: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'auto-height', false),\n breakpointsBase: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'breakpoints-base', 'window'),\n centerInsufficientSlides: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'center-insufficient-slides', false),\n centeredSlides: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'centered-slides', false),\n containerModifierClass: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'container-modifier-class', 'swiper-'),\n createElements: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'create-elements', false),\n cssMode: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'css-mode', false),\n direction: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'direction', 'horizontal'),\n edgeSwipeDetection: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'edge-swipe-detection', false),\n edgeSwipeThreshold: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'edge-swipe-threshold', 20),\n effect: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'effect', 'slide'),\n enabled: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'enabled', true),\n eventsPrefix: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'events-prefix', 'swiper'),\n focusableElements: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'focusable-elements', 'input, select, option, textarea, button, video, label'),\n followFinger: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'follow-finger', true),\n freeMode: {\n enabled: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'free-mode-enabled', false),\n sticky: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'free-mode-sticky', false),\n },\n grabCursor: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'grab-cursor', false),\n //hashNavigation: null,\n height: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'height', null),\n //history: null,\n init: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'init', true),\n initialSlide: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'initial-slide', 0),\n //injectStyles: null, // not needed\n //injectStylesUrls: null, // not needed\n lazyPreloadPrevNext: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'lazy-preload-prev-next', 0),\n lazyPreloaderClass: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'lazy-preloader-class', 'swiper-lazy-preloader'),\n longSwipes: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'long-swipes', true), // no effect\n longSwipesMs: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'long-swipes-ms', 300), // no effect\n longSwipesRatio: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'long-swipes-ratio', 0.5), // no effect\n loop: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'loop-mode', false),\n loopAddBlankSlides: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'loop-add-blank-slides', true),\n loopAdditionalSlides: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'loop-additional-slides', 0),\n loopPreventsSliding: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'loop-prevents-sliding', true),\n maxBackfaceHiddenSlides: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'max-backface-hidden-slides', 10),\n //modules: null, // take a look at this\n //mouseWheel: null,\n //navigation: null,\n nested: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'nested', false),\n noSwiping: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'no-swiping', true),\n noSwipingClass: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'no-swiping-class', 'swiper-no-swiping'),\n noSwipingSelector: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'no-swiping-selector', null),\n normalizeSlideIndex: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'normalize-slide-index', true),\n observeParents: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'observe-parents', false),\n observeSlideChildren: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'observe-slide-children', false),\n //observer: null,\n //on: null,\n //onAny: null,\n oneWayMovement: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'data-one-way-movement', false),\n //parallax: null,\n passiveListeners: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'passive-listeners', true),\n preventClicks: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'prevent-clicks', true),\n preventClicksPropagation: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'prevent-clicks-propagation', true),\n preventInteractionOnTransition: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'prevent-interaction-on-transition', false),\n resistance: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'resistance', true),\n resistanceRatio: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'resistance-ratio', 0.85),\n resizeObserver: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'resize-observer', true),\n rewind: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'rewind', false),\n roundLengths: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'round-lengths', false),\n runCallbacksOnInit: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'run-callbacks-on-init', true),\n // setWrapperSize: getAttr($this, 'set-wrapper-size', false),\n shortSwipes: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'short-swipes', true),\n simulateTouch: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'simulate-touch', true),\n slideActiveClass: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'slide-active-class', 'swiper-slide-active'),\n slideBlankClass: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'slide-blank-class', 'swiper-slide-blank'),\n slideClass: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'slide-class', 'swiper-slide'),\n slideFullyVisibleClass: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'slide-fully-visible-class', 'swiper-slide-fully-visible'),\n slideNextClass: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'slide-next-class', 'swiper-slide-next'),\n slidePrevClass: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'slide-prev-class', 'swiper-slide-prev'),\n slideToClickedSlide: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'slide-to-clicked-slide', false),\n slideVisibleClass: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'slide-visible-class', 'swiper-slide-visible'),\n slidesOffsetAfter: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'slides-offset-after', 0),\n slidesOffsetBefore: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'slides-offset-before', 0),\n slidesPerGroup: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'slides-per-group', 1),\n slidesPerGroupAuto: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'slides-per-group-auto', false),\n slidesPerGroupSkip: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'slides-per-group-skip', 0),\n slidesPerView: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'slides-per-view', '1'),\n spaceBetween: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'space-between', 0),\n speed: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'speed', 300),\n // swipeHandler: getAttr($this, \"swipe-handler\", null),\n swiperElementNodeName: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'swiper-element-node-name', 'SWIPER-CONTAINER'),\n threshold: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'threshold', 5),\n touchAngle: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'touch-angle', 45),\n touchEventsTarget: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'touch-events-target', 'wrapper'),\n touchMoveStopPropagation: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'touch-move-stop-propagation', false),\n touchRatio: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'touch-ratio', 1),\n touchReleaseOnEdges: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'touch-release-on-edges', false),\n touchStartForcePreventDefault: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'touch-start-force-prevent-default', false),\n touchStartPreventDefault: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'touch-start-prevent-default', true),\n uniqueNavElements: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'unique-nav-elements', true),\n updateOnWindowResize: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'update-on-window-resize', true),\n //url: getAttr($this, \"url\", \"null\"),\n //userAgent: getAttr($this, \"user-agent\", \"null\"),\n //virtual: null,\n virtualTranslate: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'virtual-translate', false),\n watchOverflow: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'watch-overflow', true),\n watchSlidesProgress: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'watch-slides-progress', false),\n width: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'width', null),\n wrapperClass: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'wrapper-class', 'swiper-wrapper'),\n //zoom: null,\n };\n // BREAKPOINTS\n swiperConfig.breakpoints = (0,_modules_breakpoints__WEBPACK_IMPORTED_MODULE_4__.breakpointsConfig)($this);\n // PLAYBACK\n const playbackMode = (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'playback-mode', 'none');\n if (playbackMode === 'loop')\n swiperConfig.loop = true;\n if (playbackMode === 'rewind')\n swiperConfig.rewind = true;\n if (playbackMode === 'none') {\n swiperConfig.loop = false;\n swiperConfig.rewind = false;\n }\n swiperConfig.autoplay = (0,_modules_playback__WEBPACK_IMPORTED_MODULE_7__.autoplayConfig)($this);\n // NAVIGATION\n swiperConfig.navigation = (0,_modules_navigation__WEBPACK_IMPORTED_MODULE_3__.navigationConfig)($this, name);\n // PAGINATION\n let pagination = $this.find(\"[waterfall-el='pagination-bullet']\").length;\n if (pagination)\n swiperConfig.pagination = (0,_modules_pagination__WEBPACK_IMPORTED_MODULE_5__.paginationConfig)($this);\n // SCROLLBAR\n const $scrollbar = $this.find(\"[waterfall-el='scrollbar']\");\n if ($scrollbar)\n swiperConfig.scrollbar = (0,_modules_scrollbar__WEBPACK_IMPORTED_MODULE_6__.scrollbarConfig)($this);\n // EFFECT\n swiperConfig.fadeEffect = (0,_modules_effect__WEBPACK_IMPORTED_MODULE_8__.fadeConfig)($this);\n swiperConfig.coverflowEffect = (0,_modules_effect__WEBPACK_IMPORTED_MODULE_8__.coverflowEffect)($this);\n swiperConfig.flipEffect = (0,_modules_effect__WEBPACK_IMPORTED_MODULE_8__.flipEffect)($this);\n swiperConfig.cardsEffect = (0,_modules_effect__WEBPACK_IMPORTED_MODULE_8__.cardsEffect)($this);\n swiperConfig.cubeEffect = (0,_modules_effect__WEBPACK_IMPORTED_MODULE_8__.cubeEffect)($this);\n // FREE MODE\n swiperConfig.freeMode = (0,_modules_playback__WEBPACK_IMPORTED_MODULE_7__.freeModeConfig)($this);\n // GRID\n swiperConfig.grid = (0,_modules_layout__WEBPACK_IMPORTED_MODULE_9__.gridConfig)($this);\n // Clean up the config and debug\n const config = (0,_util__WEBPACK_IMPORTED_MODULE_2__.removeNullKeys)(swiperConfig);\n (0,_util__WEBPACK_IMPORTED_MODULE_2__.printDebug)(debug, 'CONFIG', config);\n // Initialize swiper\n const swiper = new swiper_bundle__WEBPACK_IMPORTED_MODULE_0__[\"default\"]($this.find('.swiper')[0], config);\n // Add to sliders array\n sliders.push({ name, slider: swiper });\n});\n// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-\n// --- SLIDE COUNT ----------------------------\n// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-\ndocument.querySelectorAll('.swiper-wrapper').forEach((swiperWrapper) => {\n swiperWrapper.querySelectorAll('.swiper-slide').forEach((slide, index) => {\n const countEl = slide.querySelector('[waterfall-el=\"slide-count\"]');\n if (countEl) {\n countEl.textContent = (index + 1).toString();\n }\n });\n});\n\n\n//# sourceURL=webpack://Waterfall/./src/waterfall.ts?");
239
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var swiper_bundle__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! swiper/bundle */ \"./node_modules/swiper/swiper-bundle.mjs\");\n/* harmony import */ var swiper_css_bundle__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! swiper/css/bundle */ \"./node_modules/swiper/swiper-bundle.css\");\n/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./util */ \"./src/util.ts\");\n/* harmony import */ var _modules_navigation__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./modules/navigation */ \"./src/modules/navigation.ts\");\n/* harmony import */ var _modules_breakpoints__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./modules/breakpoints */ \"./src/modules/breakpoints.ts\");\n/* harmony import */ var _modules_pagination__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./modules/pagination */ \"./src/modules/pagination.ts\");\n/* harmony import */ var _modules_scrollbar__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./modules/scrollbar */ \"./src/modules/scrollbar.ts\");\n/* harmony import */ var _modules_playback__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./modules/playback */ \"./src/modules/playback.ts\");\n/* harmony import */ var _modules_effect__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./modules/effect */ \"./src/modules/effect.ts\");\n/* harmony import */ var _modules_layout__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./modules/layout */ \"./src/modules/layout.ts\");\n/* harmony import */ var _modules_general__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./modules/general */ \"./src/modules/general.ts\");\n/* harmony import */ var _modules_slideCount__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./modules/slideCount */ \"./src/modules/slideCount.ts\");\n\n\n\n\n\n\n\n\n\n\n\n\nconsole.log(`🚿 Hello from Wellflow Waterfall v${\"0.1.44\"}`);\nconst sliders = [];\n$(\"[waterfall:not([waterfall-el='thumbs'])]\").each((index, el) => initConfig(el, index));\n$(\"[waterfall:is([waterfall-el='thumbs'])]\").each((index, el) => initConfig(el, index));\nfunction initConfig(el, index) {\n {\n const $this = $(el);\n const name = (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseString)($this, 'waterfall', `Swiper ${index}`);\n if (!name)\n return;\n const debug = Boolean((0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'debug-mode', false) || false);\n console.log(`Initializing Waterfall: ${name} ${debug ? '[DEBUG MODE]' : ''}`);\n // GENERAL CONFIG\n const swiperConfig = (0,_modules_general__WEBPACK_IMPORTED_MODULE_10__.generalConfig)($this);\n // BREAKPOINTS\n swiperConfig.breakpoints = (0,_modules_breakpoints__WEBPACK_IMPORTED_MODULE_4__.breakpointsConfig)($this);\n // PLAYBACK\n const playbackMode = (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'playback-mode', 'none');\n if (playbackMode === 'loop')\n swiperConfig.loop = true;\n if (playbackMode === 'rewind')\n swiperConfig.rewind = true;\n if (playbackMode === 'none') {\n swiperConfig.loop = false;\n swiperConfig.rewind = false;\n }\n swiperConfig.autoplay = (0,_modules_playback__WEBPACK_IMPORTED_MODULE_7__.autoplayConfig)($this);\n // NAVIGATION\n swiperConfig.navigation = (0,_modules_navigation__WEBPACK_IMPORTED_MODULE_3__.navigationConfig)($this, name);\n // PAGINATION\n let pagination = $this.find(\"[waterfall-el='pagination-bullet']\").length;\n if (pagination)\n swiperConfig.pagination = (0,_modules_pagination__WEBPACK_IMPORTED_MODULE_5__.paginationConfig)($this);\n // SCROLLBAR\n const $scrollbar = $this.find(\"[waterfall-el='scrollbar']\");\n if ($scrollbar)\n swiperConfig.scrollbar = (0,_modules_scrollbar__WEBPACK_IMPORTED_MODULE_6__.scrollbarConfig)($this);\n // EFFECT\n swiperConfig.fadeEffect = (0,_modules_effect__WEBPACK_IMPORTED_MODULE_8__.fadeConfig)($this);\n swiperConfig.coverflowEffect = (0,_modules_effect__WEBPACK_IMPORTED_MODULE_8__.coverflowEffect)($this);\n swiperConfig.flipEffect = (0,_modules_effect__WEBPACK_IMPORTED_MODULE_8__.flipEffect)($this);\n swiperConfig.cardsEffect = (0,_modules_effect__WEBPACK_IMPORTED_MODULE_8__.cardsEffect)($this);\n swiperConfig.cubeEffect = (0,_modules_effect__WEBPACK_IMPORTED_MODULE_8__.cubeEffect)($this);\n // FREE MODE\n swiperConfig.freeMode = (0,_modules_playback__WEBPACK_IMPORTED_MODULE_7__.freeModeConfig)($this);\n // GRID\n swiperConfig.grid = (0,_modules_layout__WEBPACK_IMPORTED_MODULE_9__.gridConfig)($this);\n // Clean up the config and debug\n const config = (0,_util__WEBPACK_IMPORTED_MODULE_2__.removeNullKeys)(swiperConfig);\n (0,_util__WEBPACK_IMPORTED_MODULE_2__.printDebug)(debug, 'CONFIG', config);\n // Initialize swiper\n const swiper = new swiper_bundle__WEBPACK_IMPORTED_MODULE_0__[\"default\"]($this.find('.swiper')[0], config);\n // Add to sliders array\n sliders.push({ name, slider: swiper });\n }\n}\n(0,_modules_slideCount__WEBPACK_IMPORTED_MODULE_11__.initSlideCount)();\n\n\n//# sourceURL=webpack://Waterfall/./src/waterfall.ts?");
220
240
 
221
241
  /***/ }),
222
242
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "well-waterfall",
3
- "version": "0.1.42",
3
+ "version": "0.1.44",
4
4
  "description": "An attribute-based wrapper of SwiperJS for Webflow",
5
5
  "main": "waterfall.js",
6
6
  "scripts": {
File without changes
@@ -0,0 +1,171 @@
1
+ import { parseAttr } from '../util';
2
+
3
+ export function generalConfig($this: JQuery<HTMLElement>) {
4
+ return {
5
+ a11y: {
6
+ prevSlideMessage: parseAttr($this, 'a11y-prev-message', 'Previous Slide'),
7
+ nextSlideMessage: parseAttr($this, 'a11y-next-message', 'Next Slide'),
8
+ },
9
+ allowSlideNext: parseAttr($this, 'allow-slide-next', true),
10
+ allowSlidePrev: parseAttr($this, 'allow-slide-prev', true),
11
+ allowTouchMove: parseAttr($this, 'allow-touch-move', true),
12
+ autoHeight: parseAttr($this, 'auto-height', false),
13
+ breakpointsBase: parseAttr($this, 'breakpoints-base', 'window'),
14
+ centerInsufficientSlides: parseAttr(
15
+ $this,
16
+ 'center-insufficient-slides',
17
+ false,
18
+ ),
19
+ centeredSlides: parseAttr($this, 'centered-slides', false),
20
+ containerModifierClass: parseAttr(
21
+ $this,
22
+ 'container-modifier-class',
23
+ 'swiper-',
24
+ ),
25
+ createElements: parseAttr($this, 'create-elements', false),
26
+ cssMode: parseAttr($this, 'css-mode', false),
27
+ direction: parseAttr($this, 'direction', 'horizontal'),
28
+ edgeSwipeDetection: parseAttr($this, 'edge-swipe-detection', false),
29
+ edgeSwipeThreshold: parseAttr($this, 'edge-swipe-threshold', 20),
30
+ effect: parseAttr($this, 'effect', 'slide'),
31
+ enabled: parseAttr($this, 'enabled', true),
32
+ eventsPrefix: parseAttr($this, 'events-prefix', 'swiper'),
33
+ focusableElements: parseAttr(
34
+ $this,
35
+ 'focusable-elements',
36
+ 'input, select, option, textarea, button, video, label',
37
+ ),
38
+ followFinger: parseAttr($this, 'follow-finger', true),
39
+ freeMode: {
40
+ enabled: parseAttr($this, 'free-mode-enabled', false),
41
+ sticky: parseAttr($this, 'free-mode-sticky', false),
42
+ },
43
+ grabCursor: parseAttr($this, 'grab-cursor', false),
44
+ //hashNavigation: null,
45
+ height: parseAttr($this, 'height', null),
46
+ //history: null,
47
+ init: parseAttr($this, 'init', true),
48
+ initialSlide: parseAttr($this, 'initial-slide', 0),
49
+ //injectStyles: null, // not needed
50
+ //injectStylesUrls: null, // not needed
51
+ lazyPreloadPrevNext: parseAttr($this, 'lazy-preload-prev-next', 0),
52
+ lazyPreloaderClass: parseAttr(
53
+ $this,
54
+ 'lazy-preloader-class',
55
+ 'swiper-lazy-preloader',
56
+ ),
57
+ longSwipes: parseAttr($this, 'long-swipes', true), // no effect
58
+ longSwipesMs: parseAttr($this, 'long-swipes-ms', 300), // no effect
59
+ longSwipesRatio: parseAttr($this, 'long-swipes-ratio', 0.5), // no effect
60
+ loop: parseAttr($this, 'loop-mode', false),
61
+ loopAddBlankSlides: parseAttr($this, 'loop-add-blank-slides', true),
62
+ loopAdditionalSlides: parseAttr($this, 'loop-additional-slides', 0),
63
+ loopPreventsSliding: parseAttr($this, 'loop-prevents-sliding', true),
64
+ maxBackfaceHiddenSlides: parseAttr($this, 'max-backface-hidden-slides', 10),
65
+ //modules: null, // take a look at this
66
+ //mouseWheel: null,
67
+ //navigation: null,
68
+ nested: parseAttr($this, 'nested', false),
69
+ noSwiping: parseAttr($this, 'no-swiping', true),
70
+ noSwipingClass: parseAttr($this, 'no-swiping-class', 'swiper-no-swiping'),
71
+ noSwipingSelector: parseAttr($this, 'no-swiping-selector', null),
72
+ normalizeSlideIndex: parseAttr($this, 'normalize-slide-index', true),
73
+ observeParents: parseAttr($this, 'observe-parents', false),
74
+ observeSlideChildren: parseAttr($this, 'observe-slide-children', false),
75
+ //observer: null,
76
+ //on: null,
77
+ //onAny: null,
78
+ oneWayMovement: parseAttr($this, 'data-one-way-movement', false),
79
+ //parallax: null,
80
+ passiveListeners: parseAttr($this, 'passive-listeners', true),
81
+ preventClicks: parseAttr($this, 'prevent-clicks', true),
82
+ preventClicksPropagation: parseAttr(
83
+ $this,
84
+ 'prevent-clicks-propagation',
85
+ true,
86
+ ),
87
+ preventInteractionOnTransition: parseAttr(
88
+ $this,
89
+ 'prevent-interaction-on-transition',
90
+ false,
91
+ ),
92
+ resistance: parseAttr($this, 'resistance', true),
93
+ resistanceRatio: parseAttr($this, 'resistance-ratio', 0.85),
94
+ resizeObserver: parseAttr($this, 'resize-observer', true),
95
+ rewind: parseAttr($this, 'rewind', false),
96
+ roundLengths: parseAttr($this, 'round-lengths', false),
97
+ runCallbacksOnInit: parseAttr($this, 'run-callbacks-on-init', true),
98
+ // setWrapperSize: getAttr($this, 'set-wrapper-size', false),
99
+ shortSwipes: parseAttr($this, 'short-swipes', true),
100
+ simulateTouch: parseAttr($this, 'simulate-touch', true),
101
+ slideActiveClass: parseAttr(
102
+ $this,
103
+ 'slide-active-class',
104
+ 'swiper-slide-active',
105
+ ),
106
+ slideBlankClass: parseAttr(
107
+ $this,
108
+ 'slide-blank-class',
109
+ 'swiper-slide-blank',
110
+ ),
111
+ slideClass: parseAttr($this, 'slide-class', 'swiper-slide'),
112
+ slideFullyVisibleClass: parseAttr(
113
+ $this,
114
+ 'slide-fully-visible-class',
115
+ 'swiper-slide-fully-visible',
116
+ ),
117
+ slideNextClass: parseAttr($this, 'slide-next-class', 'swiper-slide-next'),
118
+ slidePrevClass: parseAttr($this, 'slide-prev-class', 'swiper-slide-prev'),
119
+ slideToClickedSlide: parseAttr($this, 'slide-to-clicked-slide', false),
120
+ slideVisibleClass: parseAttr(
121
+ $this,
122
+ 'slide-visible-class',
123
+ 'swiper-slide-visible',
124
+ ),
125
+ slidesOffsetAfter: parseAttr($this, 'slides-offset-after', 0),
126
+ slidesOffsetBefore: parseAttr($this, 'slides-offset-before', 0),
127
+ slidesPerGroup: parseAttr($this, 'slides-per-group', 1),
128
+ slidesPerGroupAuto: parseAttr($this, 'slides-per-group-auto', false),
129
+ slidesPerGroupSkip: parseAttr($this, 'slides-per-group-skip', 0),
130
+ slidesPerView: parseAttr($this, 'slides-per-view', '1'),
131
+ spaceBetween: parseAttr($this, 'space-between', 0),
132
+ speed: parseAttr($this, 'speed', 300),
133
+ // swipeHandler: getAttr($this, "swipe-handler", null),
134
+ swiperElementNodeName: parseAttr(
135
+ $this,
136
+ 'swiper-element-node-name',
137
+ 'SWIPER-CONTAINER',
138
+ ),
139
+ threshold: parseAttr($this, 'threshold', 5),
140
+ touchAngle: parseAttr($this, 'touch-angle', 45),
141
+ touchEventsTarget: parseAttr($this, 'touch-events-target', 'wrapper'),
142
+ touchMoveStopPropagation: parseAttr(
143
+ $this,
144
+ 'touch-move-stop-propagation',
145
+ false,
146
+ ),
147
+ touchRatio: parseAttr($this, 'touch-ratio', 1),
148
+ touchReleaseOnEdges: parseAttr($this, 'touch-release-on-edges', false),
149
+ touchStartForcePreventDefault: parseAttr(
150
+ $this,
151
+ 'touch-start-force-prevent-default',
152
+ false,
153
+ ),
154
+ touchStartPreventDefault: parseAttr(
155
+ $this,
156
+ 'touch-start-prevent-default',
157
+ true,
158
+ ),
159
+ uniqueNavElements: parseAttr($this, 'unique-nav-elements', true),
160
+ updateOnWindowResize: parseAttr($this, 'update-on-window-resize', true),
161
+ //url: getAttr($this, "url", "null"),
162
+ //userAgent: getAttr($this, "user-agent", "null"),
163
+ //virtual: null,
164
+ virtualTranslate: parseAttr($this, 'virtual-translate', false),
165
+ watchOverflow: parseAttr($this, 'watch-overflow', true),
166
+ watchSlidesProgress: parseAttr($this, 'watch-slides-progress', false),
167
+ width: parseAttr($this, 'width', null),
168
+ wrapperClass: parseAttr($this, 'wrapper-class', 'swiper-wrapper'),
169
+ //zoom: null,
170
+ };
171
+ }
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Creates a Slide Count element that displays the current slide number.
3
+ */
4
+ export function initSlideCount() {
5
+ document.querySelectorAll('.swiper-wrapper').forEach((swiperWrapper) => {
6
+ swiperWrapper.querySelectorAll('.swiper-slide').forEach((slide, index) => {
7
+ const countEl = slide.querySelector('[waterfall-el="slide-count"]');
8
+ if (countEl) {
9
+ countEl.textContent = (index + 1).toString();
10
+ }
11
+ });
12
+ });
13
+ }
package/src/waterfall.ts CHANGED
@@ -14,244 +14,83 @@ import {
14
14
  cubeEffect,
15
15
  } from './modules/effect';
16
16
  import { gridConfig } from './modules/layout';
17
+ import { generalConfig } from './modules/general';
18
+ import { initSlideCount } from './modules/slideCount';
17
19
 
18
20
  console.log(`🚿 Hello from Wellflow Waterfall v${APP_VERSION}`);
19
21
 
20
22
  const sliders: any[] = [];
21
23
 
22
- $('[waterfall]').each(function (index) {
23
- const $this = $(this);
24
+ $("[waterfall:not([waterfall-el='thumbs'])]").each((index, el) =>
25
+ initConfig(el, index),
26
+ );
24
27
 
25
- const name = parseString($this, 'waterfall', `Swiper ${index}`);
26
- if (!name) return;
28
+ $("[waterfall:is([waterfall-el='thumbs'])]").each((index, el) =>
29
+ initConfig(el, index),
30
+ );
27
31
 
28
- const debug = Boolean(parseAttr($this, 'debug-mode', false) || false);
32
+ function initConfig(el: HTMLElement, index: number) {
33
+ {
34
+ const $this = $(el);
29
35
 
30
- console.log(`Initializing Waterfall: ${name} ${debug ? '[DEBUG MODE]' : ''}`);
36
+ const name = parseString($this, 'waterfall', `Swiper ${index}`);
37
+ if (!name) return;
31
38
 
32
- const swiperConfig: any = {
33
- a11y: {
34
- prevSlideMessage: parseAttr($this, 'a11y-prev-message', 'Previous Slide'),
35
- nextSlideMessage: parseAttr($this, 'a11y-next-message', 'Next Slide'),
36
- },
37
- allowSlideNext: parseAttr($this, 'allow-slide-next', true),
38
- allowSlidePrev: parseAttr($this, 'allow-slide-prev', true),
39
- allowTouchMove: parseAttr($this, 'allow-touch-move', true),
40
- autoHeight: parseAttr($this, 'auto-height', false),
41
- breakpointsBase: parseAttr($this, 'breakpoints-base', 'window'),
42
- centerInsufficientSlides: parseAttr(
43
- $this,
44
- 'center-insufficient-slides',
45
- false,
46
- ),
47
- centeredSlides: parseAttr($this, 'centered-slides', false),
48
- containerModifierClass: parseAttr(
49
- $this,
50
- 'container-modifier-class',
51
- 'swiper-',
52
- ),
53
- createElements: parseAttr($this, 'create-elements', false),
54
- cssMode: parseAttr($this, 'css-mode', false),
55
- direction: parseAttr($this, 'direction', 'horizontal'),
56
- edgeSwipeDetection: parseAttr($this, 'edge-swipe-detection', false),
57
- edgeSwipeThreshold: parseAttr($this, 'edge-swipe-threshold', 20),
58
- effect: parseAttr($this, 'effect', 'slide'),
59
- enabled: parseAttr($this, 'enabled', true),
60
- eventsPrefix: parseAttr($this, 'events-prefix', 'swiper'),
61
- focusableElements: parseAttr(
62
- $this,
63
- 'focusable-elements',
64
- 'input, select, option, textarea, button, video, label',
65
- ),
66
- followFinger: parseAttr($this, 'follow-finger', true),
67
- freeMode: {
68
- enabled: parseAttr($this, 'free-mode-enabled', false),
69
- sticky: parseAttr($this, 'free-mode-sticky', false),
70
- },
71
- grabCursor: parseAttr($this, 'grab-cursor', false),
72
- //hashNavigation: null,
73
- height: parseAttr($this, 'height', null),
74
- //history: null,
75
- init: parseAttr($this, 'init', true),
76
- initialSlide: parseAttr($this, 'initial-slide', 0),
77
- //injectStyles: null, // not needed
78
- //injectStylesUrls: null, // not needed
79
- lazyPreloadPrevNext: parseAttr($this, 'lazy-preload-prev-next', 0),
80
- lazyPreloaderClass: parseAttr(
81
- $this,
82
- 'lazy-preloader-class',
83
- 'swiper-lazy-preloader',
84
- ),
85
- longSwipes: parseAttr($this, 'long-swipes', true), // no effect
86
- longSwipesMs: parseAttr($this, 'long-swipes-ms', 300), // no effect
87
- longSwipesRatio: parseAttr($this, 'long-swipes-ratio', 0.5), // no effect
88
- loop: parseAttr($this, 'loop-mode', false),
89
- loopAddBlankSlides: parseAttr($this, 'loop-add-blank-slides', true),
90
- loopAdditionalSlides: parseAttr($this, 'loop-additional-slides', 0),
91
- loopPreventsSliding: parseAttr($this, 'loop-prevents-sliding', true),
92
- maxBackfaceHiddenSlides: parseAttr($this, 'max-backface-hidden-slides', 10),
93
- //modules: null, // take a look at this
94
- //mouseWheel: null,
95
- //navigation: null,
96
- nested: parseAttr($this, 'nested', false),
97
- noSwiping: parseAttr($this, 'no-swiping', true),
98
- noSwipingClass: parseAttr($this, 'no-swiping-class', 'swiper-no-swiping'),
99
- noSwipingSelector: parseAttr($this, 'no-swiping-selector', null),
100
- normalizeSlideIndex: parseAttr($this, 'normalize-slide-index', true),
101
- observeParents: parseAttr($this, 'observe-parents', false),
102
- observeSlideChildren: parseAttr($this, 'observe-slide-children', false),
103
- //observer: null,
104
- //on: null,
105
- //onAny: null,
106
- oneWayMovement: parseAttr($this, 'data-one-way-movement', false),
107
- //parallax: null,
108
- passiveListeners: parseAttr($this, 'passive-listeners', true),
109
- preventClicks: parseAttr($this, 'prevent-clicks', true),
110
- preventClicksPropagation: parseAttr(
111
- $this,
112
- 'prevent-clicks-propagation',
113
- true,
114
- ),
115
- preventInteractionOnTransition: parseAttr(
116
- $this,
117
- 'prevent-interaction-on-transition',
118
- false,
119
- ),
120
- resistance: parseAttr($this, 'resistance', true),
121
- resistanceRatio: parseAttr($this, 'resistance-ratio', 0.85),
122
- resizeObserver: parseAttr($this, 'resize-observer', true),
123
- rewind: parseAttr($this, 'rewind', false),
124
- roundLengths: parseAttr($this, 'round-lengths', false),
125
- runCallbacksOnInit: parseAttr($this, 'run-callbacks-on-init', true),
126
- // setWrapperSize: getAttr($this, 'set-wrapper-size', false),
127
- shortSwipes: parseAttr($this, 'short-swipes', true),
128
- simulateTouch: parseAttr($this, 'simulate-touch', true),
129
- slideActiveClass: parseAttr(
130
- $this,
131
- 'slide-active-class',
132
- 'swiper-slide-active',
133
- ),
134
- slideBlankClass: parseAttr(
135
- $this,
136
- 'slide-blank-class',
137
- 'swiper-slide-blank',
138
- ),
139
- slideClass: parseAttr($this, 'slide-class', 'swiper-slide'),
140
- slideFullyVisibleClass: parseAttr(
141
- $this,
142
- 'slide-fully-visible-class',
143
- 'swiper-slide-fully-visible',
144
- ),
145
- slideNextClass: parseAttr($this, 'slide-next-class', 'swiper-slide-next'),
146
- slidePrevClass: parseAttr($this, 'slide-prev-class', 'swiper-slide-prev'),
147
- slideToClickedSlide: parseAttr($this, 'slide-to-clicked-slide', false),
148
- slideVisibleClass: parseAttr(
149
- $this,
150
- 'slide-visible-class',
151
- 'swiper-slide-visible',
152
- ),
153
- slidesOffsetAfter: parseAttr($this, 'slides-offset-after', 0),
154
- slidesOffsetBefore: parseAttr($this, 'slides-offset-before', 0),
155
- slidesPerGroup: parseAttr($this, 'slides-per-group', 1),
156
- slidesPerGroupAuto: parseAttr($this, 'slides-per-group-auto', false),
157
- slidesPerGroupSkip: parseAttr($this, 'slides-per-group-skip', 0),
158
- slidesPerView: parseAttr($this, 'slides-per-view', '1'),
159
- spaceBetween: parseAttr($this, 'space-between', 0),
160
- speed: parseAttr($this, 'speed', 300),
161
- // swipeHandler: getAttr($this, "swipe-handler", null),
162
- swiperElementNodeName: parseAttr(
163
- $this,
164
- 'swiper-element-node-name',
165
- 'SWIPER-CONTAINER',
166
- ),
167
- threshold: parseAttr($this, 'threshold', 5),
168
- touchAngle: parseAttr($this, 'touch-angle', 45),
169
- touchEventsTarget: parseAttr($this, 'touch-events-target', 'wrapper'),
170
- touchMoveStopPropagation: parseAttr(
171
- $this,
172
- 'touch-move-stop-propagation',
173
- false,
174
- ),
175
- touchRatio: parseAttr($this, 'touch-ratio', 1),
176
- touchReleaseOnEdges: parseAttr($this, 'touch-release-on-edges', false),
177
- touchStartForcePreventDefault: parseAttr(
178
- $this,
179
- 'touch-start-force-prevent-default',
180
- false,
181
- ),
182
- touchStartPreventDefault: parseAttr(
183
- $this,
184
- 'touch-start-prevent-default',
185
- true,
186
- ),
187
- uniqueNavElements: parseAttr($this, 'unique-nav-elements', true),
188
- updateOnWindowResize: parseAttr($this, 'update-on-window-resize', true),
189
- //url: getAttr($this, "url", "null"),
190
- //userAgent: getAttr($this, "user-agent", "null"),
191
- //virtual: null,
192
- virtualTranslate: parseAttr($this, 'virtual-translate', false),
193
- watchOverflow: parseAttr($this, 'watch-overflow', true),
194
- watchSlidesProgress: parseAttr($this, 'watch-slides-progress', false),
195
- width: parseAttr($this, 'width', null),
196
- wrapperClass: parseAttr($this, 'wrapper-class', 'swiper-wrapper'),
197
- //zoom: null,
198
- };
39
+ const debug = Boolean(parseAttr($this, 'debug-mode', false) || false);
40
+ console.log(
41
+ `Initializing Waterfall: ${name} ${debug ? '[DEBUG MODE]' : ''}`,
42
+ );
199
43
 
200
- // BREAKPOINTS
201
- swiperConfig.breakpoints = breakpointsConfig($this);
44
+ // GENERAL CONFIG
45
+ const swiperConfig: any = generalConfig($this);
202
46
 
203
- // PLAYBACK
204
- const playbackMode = parseAttr($this, 'playback-mode', 'none');
205
- if (playbackMode === 'loop') swiperConfig.loop = true;
206
- if (playbackMode === 'rewind') swiperConfig.rewind = true;
207
- if (playbackMode === 'none') {
208
- swiperConfig.loop = false;
209
- swiperConfig.rewind = false;
210
- }
211
- swiperConfig.autoplay = autoplayConfig($this);
47
+ // BREAKPOINTS
48
+ swiperConfig.breakpoints = breakpointsConfig($this);
212
49
 
213
- // NAVIGATION
214
- swiperConfig.navigation = navigationConfig($this, name);
50
+ // PLAYBACK
51
+ const playbackMode = parseAttr($this, 'playback-mode', 'none');
52
+ if (playbackMode === 'loop') swiperConfig.loop = true;
53
+ if (playbackMode === 'rewind') swiperConfig.rewind = true;
54
+ if (playbackMode === 'none') {
55
+ swiperConfig.loop = false;
56
+ swiperConfig.rewind = false;
57
+ }
58
+ swiperConfig.autoplay = autoplayConfig($this);
215
59
 
216
- // PAGINATION
217
- let pagination = $this.find("[waterfall-el='pagination-bullet']").length;
218
- if (pagination) swiperConfig.pagination = paginationConfig($this);
60
+ // NAVIGATION
61
+ swiperConfig.navigation = navigationConfig($this, name);
219
62
 
220
- // SCROLLBAR
221
- const $scrollbar = $this.find("[waterfall-el='scrollbar']");
222
- if ($scrollbar) swiperConfig.scrollbar = scrollbarConfig($this);
63
+ // PAGINATION
64
+ let pagination = $this.find("[waterfall-el='pagination-bullet']").length;
65
+ if (pagination) swiperConfig.pagination = paginationConfig($this);
223
66
 
224
- // EFFECT
225
- swiperConfig.fadeEffect = fadeConfig($this);
226
- swiperConfig.coverflowEffect = coverflowEffect($this);
227
- swiperConfig.flipEffect = flipEffect($this);
228
- swiperConfig.cardsEffect = cardsEffect($this);
229
- swiperConfig.cubeEffect = cubeEffect($this);
67
+ // SCROLLBAR
68
+ const $scrollbar = $this.find("[waterfall-el='scrollbar']");
69
+ if ($scrollbar) swiperConfig.scrollbar = scrollbarConfig($this);
230
70
 
231
- // FREE MODE
232
- swiperConfig.freeMode = freeModeConfig($this);
71
+ // EFFECT
72
+ swiperConfig.fadeEffect = fadeConfig($this);
73
+ swiperConfig.coverflowEffect = coverflowEffect($this);
74
+ swiperConfig.flipEffect = flipEffect($this);
75
+ swiperConfig.cardsEffect = cardsEffect($this);
76
+ swiperConfig.cubeEffect = cubeEffect($this);
233
77
 
234
- // GRID
235
- swiperConfig.grid = gridConfig($this);
78
+ // FREE MODE
79
+ swiperConfig.freeMode = freeModeConfig($this);
236
80
 
237
- // Clean up the config and debug
238
- const config = removeNullKeys(swiperConfig);
239
- printDebug(debug, 'CONFIG', config);
240
- // Initialize swiper
241
- const swiper = new Swiper($this.find('.swiper')[0], config);
242
- // Add to sliders array
243
- sliders.push({ name, slider: swiper });
244
- });
81
+ // GRID
82
+ swiperConfig.grid = gridConfig($this);
245
83
 
246
- // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
247
- // --- SLIDE COUNT ----------------------------
248
- // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
84
+ // Clean up the config and debug
85
+ const config = removeNullKeys(swiperConfig);
86
+ printDebug(debug, 'CONFIG', config);
249
87
 
250
- document.querySelectorAll('.swiper-wrapper').forEach((swiperWrapper) => {
251
- swiperWrapper.querySelectorAll('.swiper-slide').forEach((slide, index) => {
252
- const countEl = slide.querySelector('[waterfall-el="slide-count"]');
253
- if (countEl) {
254
- countEl.textContent = (index + 1).toString();
255
- }
256
- });
257
- });
88
+ // Initialize swiper
89
+ const swiper = new Swiper($this.find('.swiper')[0], config);
90
+
91
+ // Add to sliders array
92
+ sliders.push({ name, slider: swiper });
93
+ }
94
+ }
95
+
96
+ initSlideCount();