well-waterfall 0.1.45 → 0.1.46
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 +11 -1
- package/package.json +1 -1
- package/src/modules/thumbs.ts +32 -0
- package/src/waterfall.ts +4 -0
package/dist/waterfall.js
CHANGED
|
@@ -220,6 +220,16 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
220
220
|
|
|
221
221
|
/***/ }),
|
|
222
222
|
|
|
223
|
+
/***/ "./src/modules/thumbs.ts":
|
|
224
|
+
/*!*******************************!*\
|
|
225
|
+
!*** ./src/modules/thumbs.ts ***!
|
|
226
|
+
\*******************************/
|
|
227
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
228
|
+
|
|
229
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ thumbsConfig: () => (/* binding */ thumbsConfig)\n/* harmony export */ });\n/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../util */ \"./src/util.ts\");\n\nfunction getThumbsSwiper(el, sliders) {\n const sliderName = (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)(el, 'waterfall', null);\n console.log(sliderName);\n if (sliderName === null)\n return null;\n sliders.forEach((slider) => {\n if (slider.name === sliderName) {\n return slider;\n }\n });\n}\nfunction thumbsConfig(el, swipers) {\n const swiper = getThumbsSwiper(el, swipers);\n const swiperName = (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)(el, 'waterfall', null);\n console.log('THUMBS: ', swiperName, swiper);\n if (!swiper) {\n console.log(\"This thumbs slider doesn't have a matching slider \" + swiperName);\n return false;\n }\n return {\n thumbs: {\n swiper: swiper,\n },\n };\n}\n\n\n//# sourceURL=webpack://Waterfall/./src/modules/thumbs.ts?");
|
|
230
|
+
|
|
231
|
+
/***/ }),
|
|
232
|
+
|
|
223
233
|
/***/ "./src/util.ts":
|
|
224
234
|
/*!*********************!*\
|
|
225
235
|
!*** ./src/util.ts ***!
|
|
@@ -236,7 +246,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
236
246
|
\**************************/
|
|
237
247
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
238
248
|
|
|
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.
|
|
249
|
+
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/* harmony import */ var _modules_thumbs__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./modules/thumbs */ \"./src/modules/thumbs.ts\");\n\n\n\n\n\n\n\n\n\n\n\n\n\nconsole.log(`🚿 Hello from Wellflow Waterfall v${\"0.1.46\"}`);\nconst sliders = [];\n$('[waterfall]')\n .not(\"[waterfall-el='thumbs']\")\n .each((index, el) => initConfig(el, index));\n$(\"[waterfall][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 // THUMBS\n swiperConfig.thumbs = (0,_modules_thumbs__WEBPACK_IMPORTED_MODULE_12__.thumbsConfig)($this, sliders);\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?");
|
|
240
250
|
|
|
241
251
|
/***/ }),
|
|
242
252
|
|
package/package.json
CHANGED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { parseAttr } from '../util';
|
|
2
|
+
|
|
3
|
+
function getThumbsSwiper(el: JQuery<HTMLElement>, sliders: any) {
|
|
4
|
+
const sliderName = parseAttr(el, 'waterfall', null);
|
|
5
|
+
console.log(sliderName);
|
|
6
|
+
if (sliderName === null) return null;
|
|
7
|
+
sliders.forEach((slider: any) => {
|
|
8
|
+
if (slider.name === sliderName) {
|
|
9
|
+
return slider;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export function thumbsConfig(el: JQuery<HTMLElement>, swipers: any) {
|
|
15
|
+
const swiper = getThumbsSwiper(el, swipers);
|
|
16
|
+
const swiperName = parseAttr(el, 'waterfall', null);
|
|
17
|
+
|
|
18
|
+
console.log('THUMBS: ', swiperName, swiper);
|
|
19
|
+
|
|
20
|
+
if (!swiper) {
|
|
21
|
+
console.log(
|
|
22
|
+
"This thumbs slider doesn't have a matching slider " + swiperName,
|
|
23
|
+
);
|
|
24
|
+
return false;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
return {
|
|
28
|
+
thumbs: {
|
|
29
|
+
swiper: swiper,
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
}
|
package/src/waterfall.ts
CHANGED
|
@@ -16,6 +16,7 @@ import {
|
|
|
16
16
|
import { gridConfig } from './modules/layout';
|
|
17
17
|
import { generalConfig } from './modules/general';
|
|
18
18
|
import { initSlideCount } from './modules/slideCount';
|
|
19
|
+
import { thumbsConfig } from './modules/thumbs';
|
|
19
20
|
|
|
20
21
|
console.log(`🚿 Hello from Wellflow Waterfall v${APP_VERSION}`);
|
|
21
22
|
|
|
@@ -81,6 +82,9 @@ function initConfig(el: HTMLElement, index: number) {
|
|
|
81
82
|
// GRID
|
|
82
83
|
swiperConfig.grid = gridConfig($this);
|
|
83
84
|
|
|
85
|
+
// THUMBS
|
|
86
|
+
swiperConfig.thumbs = thumbsConfig($this, sliders);
|
|
87
|
+
|
|
84
88
|
// Clean up the config and debug
|
|
85
89
|
const config = removeNullKeys(swiperConfig);
|
|
86
90
|
printDebug(debug, 'CONFIG', config);
|