@gem-sdk/swiper 0.0.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/LICENSE +20 -0
- package/README.md +11 -0
- package/modules/a11y-element.css +9 -0
- package/modules/a11y-element.min.css +1 -0
- package/modules/a11y.css +9 -0
- package/modules/a11y.less +9 -0
- package/modules/a11y.min.css +1 -0
- package/modules/a11y.min.mjs +2 -0
- package/modules/a11y.min.mjs.map +1 -0
- package/modules/a11y.mjs +377 -0
- package/modules/a11y.scss +9 -0
- package/modules/autoplay-element.css +0 -0
- package/modules/autoplay-element.min.css +0 -0
- package/modules/autoplay.css +0 -0
- package/modules/autoplay.less +0 -0
- package/modules/autoplay.min.css +0 -0
- package/modules/autoplay.min.mjs +2 -0
- package/modules/autoplay.min.mjs.map +1 -0
- package/modules/autoplay.mjs +304 -0
- package/modules/autoplay.scss +0 -0
- package/modules/controller-element.css +0 -0
- package/modules/controller-element.min.css +0 -0
- package/modules/controller.css +0 -0
- package/modules/controller.less +0 -0
- package/modules/controller.min.css +0 -0
- package/modules/controller.min.mjs +2 -0
- package/modules/controller.min.mjs.map +1 -0
- package/modules/controller.mjs +191 -0
- package/modules/controller.scss +0 -0
- package/modules/effect-cards-element.css +9 -0
- package/modules/effect-cards-element.min.css +1 -0
- package/modules/effect-cards.css +9 -0
- package/modules/effect-cards.less +10 -0
- package/modules/effect-cards.min.css +1 -0
- package/modules/effect-cards.min.mjs +2 -0
- package/modules/effect-cards.min.mjs.map +1 -0
- package/modules/effect-cards.mjs +128 -0
- package/modules/effect-cards.scss +10 -0
- package/modules/effect-coverflow-element.css +0 -0
- package/modules/effect-coverflow-element.min.css +0 -0
- package/modules/effect-coverflow.css +0 -0
- package/modules/effect-coverflow.less +2 -0
- package/modules/effect-coverflow.min.css +0 -0
- package/modules/effect-coverflow.min.mjs +2 -0
- package/modules/effect-coverflow.min.mjs.map +1 -0
- package/modules/effect-coverflow.mjs +104 -0
- package/modules/effect-coverflow.scss +2 -0
- package/modules/effect-creative-element.css +6 -0
- package/modules/effect-creative-element.min.css +1 -0
- package/modules/effect-creative.css +6 -0
- package/modules/effect-creative.less +7 -0
- package/modules/effect-creative.min.css +1 -0
- package/modules/effect-creative.min.mjs +2 -0
- package/modules/effect-creative.min.mjs.map +1 -0
- package/modules/effect-creative.mjs +146 -0
- package/modules/effect-creative.scss +7 -0
- package/modules/effect-cube-element.css +53 -0
- package/modules/effect-cube-element.min.css +1 -0
- package/modules/effect-cube.css +62 -0
- package/modules/effect-cube.less +71 -0
- package/modules/effect-cube.min.css +1 -0
- package/modules/effect-cube.min.mjs +2 -0
- package/modules/effect-cube.min.mjs.map +1 -0
- package/modules/effect-cube.mjs +174 -0
- package/modules/effect-cube.scss +71 -0
- package/modules/effect-fade-element.css +16 -0
- package/modules/effect-fade-element.min.css +1 -0
- package/modules/effect-fade.css +16 -0
- package/modules/effect-fade.less +20 -0
- package/modules/effect-fade.min.css +1 -0
- package/modules/effect-fade.min.mjs +2 -0
- package/modules/effect-fade.min.mjs.map +1 -0
- package/modules/effect-fade.mjs +66 -0
- package/modules/effect-fade.scss +20 -0
- package/modules/effect-flip-element.css +17 -0
- package/modules/effect-flip-element.min.css +1 -0
- package/modules/effect-flip.css +26 -0
- package/modules/effect-flip.less +30 -0
- package/modules/effect-flip.min.css +1 -0
- package/modules/effect-flip.min.mjs +2 -0
- package/modules/effect-flip.min.mjs.map +1 -0
- package/modules/effect-flip.mjs +111 -0
- package/modules/effect-flip.scss +30 -0
- package/modules/free-mode-element.css +4 -0
- package/modules/free-mode-element.min.css +1 -0
- package/modules/free-mode.css +4 -0
- package/modules/free-mode.less +4 -0
- package/modules/free-mode.min.css +1 -0
- package/modules/free-mode.min.mjs +2 -0
- package/modules/free-mode.min.mjs.map +1 -0
- package/modules/free-mode.mjs +237 -0
- package/modules/free-mode.scss +4 -0
- package/modules/grid-element.css +7 -0
- package/modules/grid-element.min.css +1 -0
- package/modules/grid.css +7 -0
- package/modules/grid.less +7 -0
- package/modules/grid.min.css +1 -0
- package/modules/grid.min.mjs +2 -0
- package/modules/grid.min.mjs.map +1 -0
- package/modules/grid.mjs +155 -0
- package/modules/grid.scss +7 -0
- package/modules/hash-navigation-element.css +0 -0
- package/modules/hash-navigation-element.min.css +0 -0
- package/modules/hash-navigation.css +0 -0
- package/modules/hash-navigation.less +2 -0
- package/modules/hash-navigation.min.css +0 -0
- package/modules/hash-navigation.min.mjs +2 -0
- package/modules/hash-navigation.min.mjs.map +1 -0
- package/modules/hash-navigation.mjs +93 -0
- package/modules/hash-navigation.scss +0 -0
- package/modules/history-element.css +0 -0
- package/modules/history-element.min.css +0 -0
- package/modules/history.css +0 -0
- package/modules/history.less +0 -0
- package/modules/history.min.css +0 -0
- package/modules/history.min.mjs +2 -0
- package/modules/history.min.mjs.map +1 -0
- package/modules/history.mjs +142 -0
- package/modules/history.scss +0 -0
- package/modules/index.min.mjs +2 -0
- package/modules/index.min.mjs.map +1 -0
- package/modules/index.mjs +23 -0
- package/modules/keyboard-element.css +0 -0
- package/modules/keyboard-element.min.css +0 -0
- package/modules/keyboard.css +0 -0
- package/modules/keyboard.less +0 -0
- package/modules/keyboard.min.css +0 -0
- package/modules/keyboard.min.mjs +2 -0
- package/modules/keyboard.min.mjs.map +1 -0
- package/modules/keyboard.mjs +117 -0
- package/modules/keyboard.scss +0 -0
- package/modules/manipulation-element.css +0 -0
- package/modules/manipulation-element.min.css +0 -0
- package/modules/manipulation.css +0 -0
- package/modules/manipulation.less +0 -0
- package/modules/manipulation.min.css +0 -0
- package/modules/manipulation.min.mjs +2 -0
- package/modules/manipulation.min.mjs.map +1 -0
- package/modules/manipulation.mjs +193 -0
- package/modules/manipulation.scss +0 -0
- package/modules/mousewheel-element.css +0 -0
- package/modules/mousewheel-element.min.css +0 -0
- package/modules/mousewheel.css +0 -0
- package/modules/mousewheel.less +0 -0
- package/modules/mousewheel.min.css +0 -0
- package/modules/mousewheel.min.mjs +2 -0
- package/modules/mousewheel.min.mjs.map +1 -0
- package/modules/mousewheel.mjs +395 -0
- package/modules/mousewheel.scss +0 -0
- package/modules/navigation-element.css +63 -0
- package/modules/navigation-element.min.css +1 -0
- package/modules/navigation.css +86 -0
- package/modules/navigation.less +86 -0
- package/modules/navigation.min.css +1 -0
- package/modules/navigation.min.mjs +2 -0
- package/modules/navigation.min.mjs.map +1 -0
- package/modules/navigation.mjs +200 -0
- package/modules/navigation.scss +87 -0
- package/modules/pagination-element.css +184 -0
- package/modules/pagination-element.min.css +1 -0
- package/modules/pagination.css +184 -0
- package/modules/pagination.less +187 -0
- package/modules/pagination.min.css +1 -0
- package/modules/pagination.min.mjs +2 -0
- package/modules/pagination.min.mjs.map +1 -0
- package/modules/pagination.mjs +467 -0
- package/modules/pagination.scss +188 -0
- package/modules/parallax-element.css +0 -0
- package/modules/parallax-element.min.css +0 -0
- package/modules/parallax.css +0 -0
- package/modules/parallax.less +0 -0
- package/modules/parallax.min.css +0 -0
- package/modules/parallax.min.mjs +2 -0
- package/modules/parallax.min.mjs.map +1 -0
- package/modules/parallax.mjs +124 -0
- package/modules/parallax.scss +0 -0
- package/modules/scrollbar-element.css +58 -0
- package/modules/scrollbar-element.min.css +1 -0
- package/modules/scrollbar.css +58 -0
- package/modules/scrollbar.less +59 -0
- package/modules/scrollbar.min.css +1 -0
- package/modules/scrollbar.min.mjs +2 -0
- package/modules/scrollbar.min.mjs.map +1 -0
- package/modules/scrollbar.mjs +366 -0
- package/modules/scrollbar.scss +61 -0
- package/modules/thumbs-element.css +0 -0
- package/modules/thumbs-element.min.css +0 -0
- package/modules/thumbs.css +0 -0
- package/modules/thumbs.less +5 -0
- package/modules/thumbs.min.css +0 -0
- package/modules/thumbs.min.mjs +2 -0
- package/modules/thumbs.min.mjs.map +1 -0
- package/modules/thumbs.mjs +197 -0
- package/modules/thumbs.scss +5 -0
- package/modules/virtual-element.css +19 -0
- package/modules/virtual-element.min.css +1 -0
- package/modules/virtual.css +19 -0
- package/modules/virtual.less +26 -0
- package/modules/virtual.min.css +1 -0
- package/modules/virtual.min.mjs +2 -0
- package/modules/virtual.min.mjs.map +1 -0
- package/modules/virtual.mjs +349 -0
- package/modules/virtual.scss +26 -0
- package/modules/zoom-element.css +5 -0
- package/modules/zoom-element.min.css +1 -0
- package/modules/zoom.css +21 -0
- package/modules/zoom.less +23 -0
- package/modules/zoom.min.css +1 -0
- package/modules/zoom.min.mjs +2 -0
- package/modules/zoom.min.mjs.map +1 -0
- package/modules/zoom.mjs +701 -0
- package/modules/zoom.scss +21 -0
- package/package.json +213 -0
- package/shared/classes-to-selector.min.mjs +2 -0
- package/shared/classes-to-selector.min.mjs.map +1 -0
- package/shared/classes-to-selector.mjs +9 -0
- package/shared/create-element-if-not-defined.min.mjs +2 -0
- package/shared/create-element-if-not-defined.min.mjs.map +1 -0
- package/shared/create-element-if-not-defined.mjs +21 -0
- package/shared/create-shadow.min.mjs +2 -0
- package/shared/create-shadow.min.mjs.map +1 -0
- package/shared/create-shadow.mjs +14 -0
- package/shared/effect-init.min.mjs +2 -0
- package/shared/effect-init.min.mjs.map +1 -0
- package/shared/effect-init.mjs +58 -0
- package/shared/effect-target.min.mjs +2 -0
- package/shared/effect-target.min.mjs.map +1 -0
- package/shared/effect-target.mjs +12 -0
- package/shared/effect-virtual-transition-end.min.mjs +2 -0
- package/shared/effect-virtual-transition-end.min.mjs.map +1 -0
- package/shared/effect-virtual-transition-end.mjs +48 -0
- package/shared/get-element-params.min.mjs +2 -0
- package/shared/get-element-params.min.mjs.map +1 -0
- package/shared/get-element-params.mjs +113 -0
- package/shared/ssr-window.esm.min.mjs +2 -0
- package/shared/ssr-window.esm.min.mjs.map +1 -0
- package/shared/ssr-window.esm.mjs +146 -0
- package/shared/swiper-core.min.mjs +2 -0
- package/shared/swiper-core.min.mjs.map +1 -0
- package/shared/swiper-core.mjs +3969 -0
- package/shared/update-on-virtual-data.min.mjs +2 -0
- package/shared/update-on-virtual-data.min.mjs.map +1 -0
- package/shared/update-on-virtual-data.mjs +131 -0
- package/shared/update-swiper.min.mjs +2 -0
- package/shared/update-swiper.min.mjs.map +1 -0
- package/shared/update-swiper.mjs +238 -0
- package/shared/utils.min.mjs +2 -0
- package/shared/utils.min.mjs.map +1 -0
- package/shared/utils.mjs +343 -0
- package/swiper-bundle.css +735 -0
- package/swiper-bundle.js +9870 -0
- package/swiper-bundle.min.css +13 -0
- package/swiper-bundle.min.js +14 -0
- package/swiper-bundle.min.js.map +1 -0
- package/swiper-bundle.min.mjs +14 -0
- package/swiper-bundle.min.mjs.map +1 -0
- package/swiper-bundle.mjs +42 -0
- package/swiper-effect-utils.d.ts +28 -0
- package/swiper-effect-utils.min.mjs +14 -0
- package/swiper-effect-utils.min.mjs.map +1 -0
- package/swiper-effect-utils.mjs +17 -0
- package/swiper-element-bundle.js +10477 -0
- package/swiper-element-bundle.min.js +14 -0
- package/swiper-element-bundle.min.js.map +1 -0
- package/swiper-element-bundle.min.mjs +14 -0
- package/swiper-element-bundle.min.mjs.map +1 -0
- package/swiper-element-bundle.mjs +288 -0
- package/swiper-element.d.ts +444 -0
- package/swiper-element.js +5037 -0
- package/swiper-element.min.js +14 -0
- package/swiper-element.min.js.map +1 -0
- package/swiper-element.min.mjs +14 -0
- package/swiper-element.min.mjs.map +1 -0
- package/swiper-element.mjs +287 -0
- package/swiper-react.d.ts +501 -0
- package/swiper-react.mjs +394 -0
- package/swiper-vars.less +1 -0
- package/swiper-vars.scss +1 -0
- package/swiper-vue.d.ts +866 -0
- package/swiper-vue.mjs +838 -0
- package/swiper.css +228 -0
- package/swiper.d.ts +5 -0
- package/swiper.js +4418 -0
- package/swiper.less +251 -0
- package/swiper.min.css +13 -0
- package/swiper.min.js +14 -0
- package/swiper.min.js.map +1 -0
- package/swiper.min.mjs +14 -0
- package/swiper.min.mjs.map +1 -0
- package/swiper.mjs +13 -0
- package/swiper.scss +252 -0
- package/types/index.d.ts +6 -0
- package/types/modules/a11y.d.ts +110 -0
- package/types/modules/autoplay.d.ts +133 -0
- package/types/modules/controller.d.ts +35 -0
- package/types/modules/effect-cards.d.ts +33 -0
- package/types/modules/effect-coverflow.d.ts +45 -0
- package/types/modules/effect-creative.d.ts +86 -0
- package/types/modules/effect-cube.d.ts +30 -0
- package/types/modules/effect-fade.d.ts +12 -0
- package/types/modules/effect-flip.d.ts +18 -0
- package/types/modules/free-mode.d.ts +64 -0
- package/types/modules/grid.d.ts +21 -0
- package/types/modules/hash-navigation.d.ts +38 -0
- package/types/modules/history.d.ts +43 -0
- package/types/modules/index.d.ts +51 -0
- package/types/modules/keyboard.d.ts +46 -0
- package/types/modules/manipulation.d.ts +70 -0
- package/types/modules/mousewheel.d.ts +86 -0
- package/types/modules/navigation.d.ts +105 -0
- package/types/modules/pagination.d.ts +307 -0
- package/types/modules/parallax.d.ts +12 -0
- package/types/modules/public-api.d.ts +23 -0
- package/types/modules/scrollbar.d.ts +140 -0
- package/types/modules/thumbs.d.ts +54 -0
- package/types/modules/virtual.d.ts +135 -0
- package/types/modules/zoom.d.ts +91 -0
- package/types/shared.d.ts +13 -0
- package/types/swiper-class.d.ts +522 -0
- package/types/swiper-events.d.ts +359 -0
- package/types/swiper-options.d.ts +1217 -0
|
@@ -0,0 +1,467 @@
|
|
|
1
|
+
import { c as classesToSelector } from '../shared/classes-to-selector.mjs';
|
|
2
|
+
import { c as createElementIfNotDefined } from '../shared/create-element-if-not-defined.mjs';
|
|
3
|
+
import { m as makeElementsArray, h as elementOuterSize, i as elementIndex, s as setInnerHTML, b as elementParents } from '../shared/utils.mjs';
|
|
4
|
+
|
|
5
|
+
function Pagination(_ref) {
|
|
6
|
+
let {
|
|
7
|
+
swiper,
|
|
8
|
+
extendParams,
|
|
9
|
+
on,
|
|
10
|
+
emit
|
|
11
|
+
} = _ref;
|
|
12
|
+
const pfx = 'swiper-pagination';
|
|
13
|
+
extendParams({
|
|
14
|
+
pagination: {
|
|
15
|
+
el: null,
|
|
16
|
+
bulletElement: 'span',
|
|
17
|
+
clickable: false,
|
|
18
|
+
hideOnClick: false,
|
|
19
|
+
renderBullet: null,
|
|
20
|
+
renderProgressbar: null,
|
|
21
|
+
renderFraction: null,
|
|
22
|
+
renderCustom: null,
|
|
23
|
+
progressbarOpposite: false,
|
|
24
|
+
type: 'bullets',
|
|
25
|
+
// 'bullets' or 'progressbar' or 'fraction' or 'custom'
|
|
26
|
+
dynamicBullets: false,
|
|
27
|
+
dynamicMainBullets: 1,
|
|
28
|
+
formatFractionCurrent: number => number,
|
|
29
|
+
formatFractionTotal: number => number,
|
|
30
|
+
bulletClass: `${pfx}-bullet`,
|
|
31
|
+
bulletActiveClass: `${pfx}-bullet-active`,
|
|
32
|
+
modifierClass: `${pfx}-`,
|
|
33
|
+
currentClass: `${pfx}-current`,
|
|
34
|
+
totalClass: `${pfx}-total`,
|
|
35
|
+
hiddenClass: `${pfx}-hidden`,
|
|
36
|
+
progressbarFillClass: `${pfx}-progressbar-fill`,
|
|
37
|
+
progressbarOppositeClass: `${pfx}-progressbar-opposite`,
|
|
38
|
+
clickableClass: `${pfx}-clickable`,
|
|
39
|
+
lockClass: `${pfx}-lock`,
|
|
40
|
+
horizontalClass: `${pfx}-horizontal`,
|
|
41
|
+
verticalClass: `${pfx}-vertical`,
|
|
42
|
+
paginationDisabledClass: `${pfx}-disabled`
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
swiper.pagination = {
|
|
46
|
+
el: null,
|
|
47
|
+
bullets: []
|
|
48
|
+
};
|
|
49
|
+
let bulletSize;
|
|
50
|
+
let dynamicBulletIndex = 0;
|
|
51
|
+
function isPaginationDisabled() {
|
|
52
|
+
return !swiper.params.pagination.el || !swiper.pagination.el || Array.isArray(swiper.pagination.el) && swiper.pagination.el.length === 0;
|
|
53
|
+
}
|
|
54
|
+
function setSideBullets(bulletEl, position) {
|
|
55
|
+
const {
|
|
56
|
+
bulletActiveClass
|
|
57
|
+
} = swiper.params.pagination;
|
|
58
|
+
if (!bulletEl) return;
|
|
59
|
+
bulletEl = bulletEl[`${position === 'prev' ? 'previous' : 'next'}ElementSibling`];
|
|
60
|
+
if (bulletEl) {
|
|
61
|
+
bulletEl.classList.add(`${bulletActiveClass}-${position}`);
|
|
62
|
+
bulletEl = bulletEl[`${position === 'prev' ? 'previous' : 'next'}ElementSibling`];
|
|
63
|
+
if (bulletEl) {
|
|
64
|
+
bulletEl.classList.add(`${bulletActiveClass}-${position}-${position}`);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
function getMoveDirection(prevIndex, nextIndex, length) {
|
|
69
|
+
prevIndex = prevIndex % length;
|
|
70
|
+
nextIndex = nextIndex % length;
|
|
71
|
+
if (nextIndex === prevIndex + 1) {
|
|
72
|
+
return 'next';
|
|
73
|
+
} else if (nextIndex === prevIndex - 1) {
|
|
74
|
+
return 'previous';
|
|
75
|
+
}
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
function onBulletClick(e) {
|
|
79
|
+
const bulletEl = e.target.closest(classesToSelector(swiper.params.pagination.bulletClass));
|
|
80
|
+
if (!bulletEl) {
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
e.preventDefault();
|
|
84
|
+
const index = elementIndex(bulletEl) * swiper.params.slidesPerGroup;
|
|
85
|
+
if (swiper.params.loop) {
|
|
86
|
+
// Check if loop is disabled
|
|
87
|
+
const currentSlidesPerView = swiper.params.slidesPerView === 'auto' ? swiper.slidesPerViewDynamic() : Math.ceil(parseFloat(swiper.params.slidesPerView, 10));
|
|
88
|
+
if (swiper.slides.length < currentSlidesPerView) {
|
|
89
|
+
// Loop is disabled, use slideTo directly
|
|
90
|
+
swiper.slideTo(index);
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
if (swiper.realIndex === index) return;
|
|
94
|
+
const moveDirection = getMoveDirection(swiper.realIndex, index, swiper.slides.length);
|
|
95
|
+
if (moveDirection === 'next') {
|
|
96
|
+
swiper.slideNext();
|
|
97
|
+
} else if (moveDirection === 'previous') {
|
|
98
|
+
swiper.slidePrev();
|
|
99
|
+
} else {
|
|
100
|
+
swiper.slideToLoop(index);
|
|
101
|
+
}
|
|
102
|
+
} else {
|
|
103
|
+
swiper.slideTo(index);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
function update() {
|
|
107
|
+
// Render || Update Pagination bullets/items
|
|
108
|
+
const rtl = swiper.rtl;
|
|
109
|
+
const params = swiper.params.pagination;
|
|
110
|
+
if (isPaginationDisabled()) return;
|
|
111
|
+
let el = swiper.pagination.el;
|
|
112
|
+
el = makeElementsArray(el);
|
|
113
|
+
// Current/Total
|
|
114
|
+
let current;
|
|
115
|
+
let previousIndex;
|
|
116
|
+
const slidesLength = swiper.virtual && swiper.params.virtual.enabled ? swiper.virtual.slides.length : swiper.slides.length;
|
|
117
|
+
const total = swiper.params.loop ? Math.ceil(slidesLength / swiper.params.slidesPerGroup) : swiper.snapGrid.length;
|
|
118
|
+
if (swiper.params.loop) {
|
|
119
|
+
previousIndex = swiper.previousRealIndex || 0;
|
|
120
|
+
current = swiper.params.slidesPerGroup > 1 ? Math.floor(swiper.realIndex / swiper.params.slidesPerGroup) : swiper.realIndex;
|
|
121
|
+
} else if (typeof swiper.snapIndex !== 'undefined') {
|
|
122
|
+
current = swiper.snapIndex;
|
|
123
|
+
previousIndex = swiper.previousSnapIndex;
|
|
124
|
+
} else {
|
|
125
|
+
previousIndex = swiper.previousIndex || 0;
|
|
126
|
+
current = swiper.activeIndex || 0;
|
|
127
|
+
}
|
|
128
|
+
// Types
|
|
129
|
+
if (params.type === 'bullets' && swiper.pagination.bullets && swiper.pagination.bullets.length > 0) {
|
|
130
|
+
const bullets = swiper.pagination.bullets;
|
|
131
|
+
let firstIndex;
|
|
132
|
+
let lastIndex;
|
|
133
|
+
let midIndex;
|
|
134
|
+
if (params.dynamicBullets) {
|
|
135
|
+
bulletSize = elementOuterSize(bullets[0], swiper.isHorizontal() ? 'width' : 'height', true);
|
|
136
|
+
el.forEach(subEl => {
|
|
137
|
+
subEl.style[swiper.isHorizontal() ? 'width' : 'height'] = `${bulletSize * (params.dynamicMainBullets + 4)}px`;
|
|
138
|
+
});
|
|
139
|
+
if (params.dynamicMainBullets > 1 && previousIndex !== undefined) {
|
|
140
|
+
dynamicBulletIndex += current - (previousIndex || 0);
|
|
141
|
+
if (dynamicBulletIndex > params.dynamicMainBullets - 1) {
|
|
142
|
+
dynamicBulletIndex = params.dynamicMainBullets - 1;
|
|
143
|
+
} else if (dynamicBulletIndex < 0) {
|
|
144
|
+
dynamicBulletIndex = 0;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
firstIndex = Math.max(current - dynamicBulletIndex, 0);
|
|
148
|
+
lastIndex = firstIndex + (Math.min(bullets.length, params.dynamicMainBullets) - 1);
|
|
149
|
+
midIndex = (lastIndex + firstIndex) / 2;
|
|
150
|
+
}
|
|
151
|
+
bullets.forEach(bulletEl => {
|
|
152
|
+
const classesToRemove = [...['', '-next', '-next-next', '-prev', '-prev-prev', '-main'].map(suffix => `${params.bulletActiveClass}${suffix}`)].map(s => typeof s === 'string' && s.includes(' ') ? s.split(' ') : s).flat();
|
|
153
|
+
bulletEl.classList.remove(...classesToRemove);
|
|
154
|
+
});
|
|
155
|
+
if (el.length > 1) {
|
|
156
|
+
bullets.forEach(bullet => {
|
|
157
|
+
const bulletIndex = elementIndex(bullet);
|
|
158
|
+
if (bulletIndex === current) {
|
|
159
|
+
bullet.classList.add(...params.bulletActiveClass.split(' '));
|
|
160
|
+
} else if (swiper.isElement) {
|
|
161
|
+
bullet.setAttribute('part', 'bullet');
|
|
162
|
+
}
|
|
163
|
+
if (params.dynamicBullets) {
|
|
164
|
+
if (bulletIndex >= firstIndex && bulletIndex <= lastIndex) {
|
|
165
|
+
bullet.classList.add(...`${params.bulletActiveClass}-main`.split(' '));
|
|
166
|
+
}
|
|
167
|
+
if (bulletIndex === firstIndex) {
|
|
168
|
+
setSideBullets(bullet, 'prev');
|
|
169
|
+
}
|
|
170
|
+
if (bulletIndex === lastIndex) {
|
|
171
|
+
setSideBullets(bullet, 'next');
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
});
|
|
175
|
+
} else {
|
|
176
|
+
const bullet = bullets[current];
|
|
177
|
+
if (bullet) {
|
|
178
|
+
bullet.classList.add(...params.bulletActiveClass.split(' '));
|
|
179
|
+
}
|
|
180
|
+
if (swiper.isElement) {
|
|
181
|
+
bullets.forEach((bulletEl, bulletIndex) => {
|
|
182
|
+
bulletEl.setAttribute('part', bulletIndex === current ? 'bullet-active' : 'bullet');
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
if (params.dynamicBullets) {
|
|
186
|
+
const firstDisplayedBullet = bullets[firstIndex];
|
|
187
|
+
const lastDisplayedBullet = bullets[lastIndex];
|
|
188
|
+
for (let i = firstIndex; i <= lastIndex; i += 1) {
|
|
189
|
+
if (bullets[i]) {
|
|
190
|
+
bullets[i].classList.add(...`${params.bulletActiveClass}-main`.split(' '));
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
setSideBullets(firstDisplayedBullet, 'prev');
|
|
194
|
+
setSideBullets(lastDisplayedBullet, 'next');
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
if (params.dynamicBullets) {
|
|
198
|
+
const dynamicBulletsLength = Math.min(bullets.length, params.dynamicMainBullets + 4);
|
|
199
|
+
const bulletsOffset = (bulletSize * dynamicBulletsLength - bulletSize) / 2 - midIndex * bulletSize;
|
|
200
|
+
const offsetProp = rtl ? 'right' : 'left';
|
|
201
|
+
bullets.forEach(bullet => {
|
|
202
|
+
bullet.style[swiper.isHorizontal() ? offsetProp : 'top'] = `${bulletsOffset}px`;
|
|
203
|
+
});
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
el.forEach((subEl, subElIndex) => {
|
|
207
|
+
if (params.type === 'fraction') {
|
|
208
|
+
subEl.querySelectorAll(classesToSelector(params.currentClass)).forEach(fractionEl => {
|
|
209
|
+
fractionEl.textContent = params.formatFractionCurrent(current + 1);
|
|
210
|
+
});
|
|
211
|
+
subEl.querySelectorAll(classesToSelector(params.totalClass)).forEach(totalEl => {
|
|
212
|
+
totalEl.textContent = params.formatFractionTotal(total);
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
if (params.type === 'progressbar') {
|
|
216
|
+
let progressbarDirection;
|
|
217
|
+
if (params.progressbarOpposite) {
|
|
218
|
+
progressbarDirection = swiper.isHorizontal() ? 'vertical' : 'horizontal';
|
|
219
|
+
} else {
|
|
220
|
+
progressbarDirection = swiper.isHorizontal() ? 'horizontal' : 'vertical';
|
|
221
|
+
}
|
|
222
|
+
const scale = (current + 1) / total;
|
|
223
|
+
let scaleX = 1;
|
|
224
|
+
let scaleY = 1;
|
|
225
|
+
if (progressbarDirection === 'horizontal') {
|
|
226
|
+
scaleX = scale;
|
|
227
|
+
} else {
|
|
228
|
+
scaleY = scale;
|
|
229
|
+
}
|
|
230
|
+
subEl.querySelectorAll(classesToSelector(params.progressbarFillClass)).forEach(progressEl => {
|
|
231
|
+
progressEl.style.transform = `translate3d(0,0,0) scaleX(${scaleX}) scaleY(${scaleY})`;
|
|
232
|
+
progressEl.style.transitionDuration = `${swiper.params.speed}ms`;
|
|
233
|
+
});
|
|
234
|
+
}
|
|
235
|
+
if (params.type === 'custom' && params.renderCustom) {
|
|
236
|
+
setInnerHTML(subEl, params.renderCustom(swiper, current + 1, total));
|
|
237
|
+
if (subElIndex === 0) emit('paginationRender', subEl);
|
|
238
|
+
} else {
|
|
239
|
+
if (subElIndex === 0) emit('paginationRender', subEl);
|
|
240
|
+
emit('paginationUpdate', subEl);
|
|
241
|
+
}
|
|
242
|
+
if (swiper.params.watchOverflow && swiper.enabled) {
|
|
243
|
+
subEl.classList[swiper.isLocked ? 'add' : 'remove'](params.lockClass);
|
|
244
|
+
}
|
|
245
|
+
});
|
|
246
|
+
}
|
|
247
|
+
function render() {
|
|
248
|
+
// Render Container
|
|
249
|
+
const params = swiper.params.pagination;
|
|
250
|
+
if (isPaginationDisabled()) return;
|
|
251
|
+
const slidesLength = swiper.virtual && swiper.params.virtual.enabled ? swiper.virtual.slides.length : swiper.grid && swiper.params.grid.rows > 1 ? swiper.slides.length / Math.ceil(swiper.params.grid.rows) : swiper.slides.length;
|
|
252
|
+
let el = swiper.pagination.el;
|
|
253
|
+
el = makeElementsArray(el);
|
|
254
|
+
let paginationHTML = '';
|
|
255
|
+
if (params.type === 'bullets') {
|
|
256
|
+
let numberOfBullets = swiper.params.loop ? Math.ceil(slidesLength / swiper.params.slidesPerGroup) : swiper.snapGrid.length;
|
|
257
|
+
if (swiper.params.freeMode && swiper.params.freeMode.enabled && numberOfBullets > slidesLength) {
|
|
258
|
+
numberOfBullets = slidesLength;
|
|
259
|
+
}
|
|
260
|
+
for (let i = 0; i < numberOfBullets; i += 1) {
|
|
261
|
+
if (params.renderBullet) {
|
|
262
|
+
paginationHTML += params.renderBullet.call(swiper, i, params.bulletClass);
|
|
263
|
+
} else {
|
|
264
|
+
// prettier-ignore
|
|
265
|
+
paginationHTML += `<${params.bulletElement} ${swiper.isElement ? 'part="bullet"' : ''} class="${params.bulletClass}"></${params.bulletElement}>`;
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
if (params.type === 'fraction') {
|
|
270
|
+
if (params.renderFraction) {
|
|
271
|
+
paginationHTML = params.renderFraction.call(swiper, params.currentClass, params.totalClass);
|
|
272
|
+
} else {
|
|
273
|
+
paginationHTML = `<span class="${params.currentClass}"></span>` + ' / ' + `<span class="${params.totalClass}"></span>`;
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
if (params.type === 'progressbar') {
|
|
277
|
+
if (params.renderProgressbar) {
|
|
278
|
+
paginationHTML = params.renderProgressbar.call(swiper, params.progressbarFillClass);
|
|
279
|
+
} else {
|
|
280
|
+
paginationHTML = `<span class="${params.progressbarFillClass}"></span>`;
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
swiper.pagination.bullets = [];
|
|
284
|
+
el.forEach(subEl => {
|
|
285
|
+
if (params.type !== 'custom') {
|
|
286
|
+
setInnerHTML(subEl, paginationHTML || '');
|
|
287
|
+
}
|
|
288
|
+
if (params.type === 'bullets') {
|
|
289
|
+
swiper.pagination.bullets.push(...subEl.querySelectorAll(classesToSelector(params.bulletClass)));
|
|
290
|
+
}
|
|
291
|
+
});
|
|
292
|
+
if (params.type !== 'custom') {
|
|
293
|
+
emit('paginationRender', el[0]);
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
function init() {
|
|
297
|
+
swiper.params.pagination = createElementIfNotDefined(swiper, swiper.originalParams.pagination, swiper.params.pagination, {
|
|
298
|
+
el: 'swiper-pagination'
|
|
299
|
+
});
|
|
300
|
+
const params = swiper.params.pagination;
|
|
301
|
+
if (!params.el) return;
|
|
302
|
+
let el;
|
|
303
|
+
if (typeof params.el === 'string' && swiper.isElement) {
|
|
304
|
+
el = swiper.el.querySelector(params.el);
|
|
305
|
+
}
|
|
306
|
+
if (!el && typeof params.el === 'string') {
|
|
307
|
+
el = [...document.querySelectorAll(params.el)];
|
|
308
|
+
}
|
|
309
|
+
if (!el) {
|
|
310
|
+
el = params.el;
|
|
311
|
+
}
|
|
312
|
+
if (!el || el.length === 0) return;
|
|
313
|
+
if (swiper.params.uniqueNavElements && typeof params.el === 'string' && Array.isArray(el) && el.length > 1) {
|
|
314
|
+
el = [...swiper.el.querySelectorAll(params.el)];
|
|
315
|
+
// check if it belongs to another nested Swiper
|
|
316
|
+
if (el.length > 1) {
|
|
317
|
+
el = el.find(subEl => {
|
|
318
|
+
if (elementParents(subEl, '.swiper')[0] !== swiper.el) return false;
|
|
319
|
+
return true;
|
|
320
|
+
});
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
if (Array.isArray(el) && el.length === 1) el = el[0];
|
|
324
|
+
Object.assign(swiper.pagination, {
|
|
325
|
+
el
|
|
326
|
+
});
|
|
327
|
+
el = makeElementsArray(el);
|
|
328
|
+
el.forEach(subEl => {
|
|
329
|
+
if (params.type === 'bullets' && params.clickable) {
|
|
330
|
+
subEl.classList.add(...(params.clickableClass || '').split(' '));
|
|
331
|
+
}
|
|
332
|
+
subEl.classList.add(params.modifierClass + params.type);
|
|
333
|
+
subEl.classList.add(swiper.isHorizontal() ? params.horizontalClass : params.verticalClass);
|
|
334
|
+
if (params.type === 'bullets' && params.dynamicBullets) {
|
|
335
|
+
subEl.classList.add(`${params.modifierClass}${params.type}-dynamic`);
|
|
336
|
+
dynamicBulletIndex = 0;
|
|
337
|
+
if (params.dynamicMainBullets < 1) {
|
|
338
|
+
params.dynamicMainBullets = 1;
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
if (params.type === 'progressbar' && params.progressbarOpposite) {
|
|
342
|
+
subEl.classList.add(params.progressbarOppositeClass);
|
|
343
|
+
}
|
|
344
|
+
if (params.clickable) {
|
|
345
|
+
subEl.addEventListener('click', onBulletClick);
|
|
346
|
+
}
|
|
347
|
+
if (!swiper.enabled) {
|
|
348
|
+
subEl.classList.add(params.lockClass);
|
|
349
|
+
}
|
|
350
|
+
});
|
|
351
|
+
}
|
|
352
|
+
function destroy() {
|
|
353
|
+
const params = swiper.params.pagination;
|
|
354
|
+
if (isPaginationDisabled()) return;
|
|
355
|
+
let el = swiper.pagination.el;
|
|
356
|
+
if (el) {
|
|
357
|
+
el = makeElementsArray(el);
|
|
358
|
+
el.forEach(subEl => {
|
|
359
|
+
subEl.classList.remove(params.hiddenClass);
|
|
360
|
+
subEl.classList.remove(params.modifierClass + params.type);
|
|
361
|
+
subEl.classList.remove(swiper.isHorizontal() ? params.horizontalClass : params.verticalClass);
|
|
362
|
+
if (params.clickable) {
|
|
363
|
+
subEl.classList.remove(...(params.clickableClass || '').split(' '));
|
|
364
|
+
subEl.removeEventListener('click', onBulletClick);
|
|
365
|
+
}
|
|
366
|
+
});
|
|
367
|
+
}
|
|
368
|
+
if (swiper.pagination.bullets) swiper.pagination.bullets.forEach(subEl => subEl.classList.remove(...params.bulletActiveClass.split(' ')));
|
|
369
|
+
}
|
|
370
|
+
on('changeDirection', () => {
|
|
371
|
+
if (!swiper.pagination || !swiper.pagination.el) return;
|
|
372
|
+
const params = swiper.params.pagination;
|
|
373
|
+
let {
|
|
374
|
+
el
|
|
375
|
+
} = swiper.pagination;
|
|
376
|
+
el = makeElementsArray(el);
|
|
377
|
+
el.forEach(subEl => {
|
|
378
|
+
subEl.classList.remove(params.horizontalClass, params.verticalClass);
|
|
379
|
+
subEl.classList.add(swiper.isHorizontal() ? params.horizontalClass : params.verticalClass);
|
|
380
|
+
});
|
|
381
|
+
});
|
|
382
|
+
on('init', () => {
|
|
383
|
+
if (swiper.params.pagination.enabled === false) {
|
|
384
|
+
// eslint-disable-next-line
|
|
385
|
+
disable();
|
|
386
|
+
} else {
|
|
387
|
+
init();
|
|
388
|
+
render();
|
|
389
|
+
update();
|
|
390
|
+
}
|
|
391
|
+
});
|
|
392
|
+
on('activeIndexChange', () => {
|
|
393
|
+
if (typeof swiper.snapIndex === 'undefined') {
|
|
394
|
+
update();
|
|
395
|
+
}
|
|
396
|
+
});
|
|
397
|
+
on('snapIndexChange', () => {
|
|
398
|
+
update();
|
|
399
|
+
});
|
|
400
|
+
on('snapGridLengthChange', () => {
|
|
401
|
+
render();
|
|
402
|
+
update();
|
|
403
|
+
});
|
|
404
|
+
on('destroy', () => {
|
|
405
|
+
destroy();
|
|
406
|
+
});
|
|
407
|
+
on('enable disable', () => {
|
|
408
|
+
let {
|
|
409
|
+
el
|
|
410
|
+
} = swiper.pagination;
|
|
411
|
+
if (el) {
|
|
412
|
+
el = makeElementsArray(el);
|
|
413
|
+
el.forEach(subEl => subEl.classList[swiper.enabled ? 'remove' : 'add'](swiper.params.pagination.lockClass));
|
|
414
|
+
}
|
|
415
|
+
});
|
|
416
|
+
on('lock unlock', () => {
|
|
417
|
+
update();
|
|
418
|
+
});
|
|
419
|
+
on('click', (_s, e) => {
|
|
420
|
+
const targetEl = e.target;
|
|
421
|
+
const el = makeElementsArray(swiper.pagination.el);
|
|
422
|
+
if (swiper.params.pagination.el && swiper.params.pagination.hideOnClick && el && el.length > 0 && !targetEl.classList.contains(swiper.params.pagination.bulletClass)) {
|
|
423
|
+
if (swiper.navigation && (swiper.navigation.nextEl && targetEl === swiper.navigation.nextEl || swiper.navigation.prevEl && targetEl === swiper.navigation.prevEl)) return;
|
|
424
|
+
const isHidden = el[0].classList.contains(swiper.params.pagination.hiddenClass);
|
|
425
|
+
if (isHidden === true) {
|
|
426
|
+
emit('paginationShow');
|
|
427
|
+
} else {
|
|
428
|
+
emit('paginationHide');
|
|
429
|
+
}
|
|
430
|
+
el.forEach(subEl => subEl.classList.toggle(swiper.params.pagination.hiddenClass));
|
|
431
|
+
}
|
|
432
|
+
});
|
|
433
|
+
const enable = () => {
|
|
434
|
+
swiper.el.classList.remove(swiper.params.pagination.paginationDisabledClass);
|
|
435
|
+
let {
|
|
436
|
+
el
|
|
437
|
+
} = swiper.pagination;
|
|
438
|
+
if (el) {
|
|
439
|
+
el = makeElementsArray(el);
|
|
440
|
+
el.forEach(subEl => subEl.classList.remove(swiper.params.pagination.paginationDisabledClass));
|
|
441
|
+
}
|
|
442
|
+
init();
|
|
443
|
+
render();
|
|
444
|
+
update();
|
|
445
|
+
};
|
|
446
|
+
const disable = () => {
|
|
447
|
+
swiper.el.classList.add(swiper.params.pagination.paginationDisabledClass);
|
|
448
|
+
let {
|
|
449
|
+
el
|
|
450
|
+
} = swiper.pagination;
|
|
451
|
+
if (el) {
|
|
452
|
+
el = makeElementsArray(el);
|
|
453
|
+
el.forEach(subEl => subEl.classList.add(swiper.params.pagination.paginationDisabledClass));
|
|
454
|
+
}
|
|
455
|
+
destroy();
|
|
456
|
+
};
|
|
457
|
+
Object.assign(swiper.pagination, {
|
|
458
|
+
enable,
|
|
459
|
+
disable,
|
|
460
|
+
render,
|
|
461
|
+
update,
|
|
462
|
+
init,
|
|
463
|
+
destroy
|
|
464
|
+
});
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
export { Pagination as default };
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
@use '../swiper-vars.scss' as vars;
|
|
2
|
+
@at-root {
|
|
3
|
+
:root {
|
|
4
|
+
/*
|
|
5
|
+
--swiper-pagination-color: var(--swiper-theme-color);
|
|
6
|
+
--swiper-pagination-left: auto;
|
|
7
|
+
--swiper-pagination-right: 8px;
|
|
8
|
+
--swiper-pagination-bottom: 8px;
|
|
9
|
+
--swiper-pagination-top: auto;
|
|
10
|
+
--swiper-pagination-fraction-color: inherit;
|
|
11
|
+
--swiper-pagination-progressbar-bg-color: rgba(0,0,0,0.25);
|
|
12
|
+
--swiper-pagination-progressbar-size: 4px;
|
|
13
|
+
--swiper-pagination-bullet-size: 8px;
|
|
14
|
+
--swiper-pagination-bullet-width: 8px;
|
|
15
|
+
--swiper-pagination-bullet-height: 8px;
|
|
16
|
+
--swiper-pagination-bullet-border-radius: 50%;
|
|
17
|
+
--swiper-pagination-bullet-inactive-color: #000;
|
|
18
|
+
--swiper-pagination-bullet-inactive-opacity: 0.2;
|
|
19
|
+
--swiper-pagination-bullet-opacity: 1;
|
|
20
|
+
--swiper-pagination-bullet-horizontal-gap: 4px;
|
|
21
|
+
--swiper-pagination-bullet-vertical-gap: 6px;
|
|
22
|
+
*/
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
.swiper-pagination {
|
|
26
|
+
position: absolute;
|
|
27
|
+
text-align: center;
|
|
28
|
+
transition: 300ms opacity;
|
|
29
|
+
transform: translate3d(0, 0, 0);
|
|
30
|
+
z-index: 10;
|
|
31
|
+
&.swiper-pagination-hidden {
|
|
32
|
+
opacity: 0;
|
|
33
|
+
}
|
|
34
|
+
.swiper-pagination-disabled > &,
|
|
35
|
+
&.swiper-pagination-disabled {
|
|
36
|
+
display: none !important;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
/* Common Styles */
|
|
40
|
+
.swiper-pagination-fraction,
|
|
41
|
+
.swiper-pagination-custom,
|
|
42
|
+
.swiper-horizontal > .swiper-pagination-bullets,
|
|
43
|
+
.swiper-pagination-bullets.swiper-pagination-horizontal {
|
|
44
|
+
bottom: var(--swiper-pagination-bottom, 8px);
|
|
45
|
+
top: var(--swiper-pagination-top, auto);
|
|
46
|
+
left: 0;
|
|
47
|
+
width: 100%;
|
|
48
|
+
}
|
|
49
|
+
/* Bullets */
|
|
50
|
+
.swiper-pagination-bullets-dynamic {
|
|
51
|
+
overflow: hidden;
|
|
52
|
+
font-size: 0;
|
|
53
|
+
.swiper-pagination-bullet {
|
|
54
|
+
transform: scale(0.33);
|
|
55
|
+
position: relative;
|
|
56
|
+
}
|
|
57
|
+
.swiper-pagination-bullet-active {
|
|
58
|
+
transform: scale(1);
|
|
59
|
+
}
|
|
60
|
+
.swiper-pagination-bullet-active-main {
|
|
61
|
+
transform: scale(1);
|
|
62
|
+
}
|
|
63
|
+
.swiper-pagination-bullet-active-prev {
|
|
64
|
+
transform: scale(0.66);
|
|
65
|
+
}
|
|
66
|
+
.swiper-pagination-bullet-active-prev-prev {
|
|
67
|
+
transform: scale(0.33);
|
|
68
|
+
}
|
|
69
|
+
.swiper-pagination-bullet-active-next {
|
|
70
|
+
transform: scale(0.66);
|
|
71
|
+
}
|
|
72
|
+
.swiper-pagination-bullet-active-next-next {
|
|
73
|
+
transform: scale(0.33);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
.swiper-pagination-bullet {
|
|
77
|
+
width: var(--swiper-pagination-bullet-width, var(--swiper-pagination-bullet-size, 8px));
|
|
78
|
+
height: var(--swiper-pagination-bullet-height, var(--swiper-pagination-bullet-size, 8px));
|
|
79
|
+
display: inline-block;
|
|
80
|
+
border-radius: var(--swiper-pagination-bullet-border-radius, 50%);
|
|
81
|
+
background: var(--swiper-pagination-bullet-inactive-color, #000);
|
|
82
|
+
opacity: var(--swiper-pagination-bullet-inactive-opacity, 0.2);
|
|
83
|
+
@at-root button#{&} {
|
|
84
|
+
border: none;
|
|
85
|
+
margin: 0;
|
|
86
|
+
padding: 0;
|
|
87
|
+
box-shadow: none;
|
|
88
|
+
appearance: none;
|
|
89
|
+
}
|
|
90
|
+
.swiper-pagination-clickable & {
|
|
91
|
+
cursor: pointer;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
&:only-child {
|
|
95
|
+
display: none !important;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
.swiper-pagination-bullet-active {
|
|
99
|
+
opacity: var(--swiper-pagination-bullet-opacity, 1);
|
|
100
|
+
background: var(--swiper-pagination-color, var(--swiper-theme-color));
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.swiper-vertical > .swiper-pagination-bullets,
|
|
104
|
+
.swiper-pagination-vertical.swiper-pagination-bullets {
|
|
105
|
+
right: var(--swiper-pagination-right, 8px);
|
|
106
|
+
left: var(--swiper-pagination-left, auto);
|
|
107
|
+
top: 50%;
|
|
108
|
+
transform: translate3d(0px, -50%, 0);
|
|
109
|
+
.swiper-pagination-bullet {
|
|
110
|
+
margin: var(--swiper-pagination-bullet-vertical-gap, 6px) 0;
|
|
111
|
+
display: block;
|
|
112
|
+
}
|
|
113
|
+
&.swiper-pagination-bullets-dynamic {
|
|
114
|
+
top: 50%;
|
|
115
|
+
transform: translateY(-50%);
|
|
116
|
+
width: 8px;
|
|
117
|
+
.swiper-pagination-bullet {
|
|
118
|
+
display: inline-block;
|
|
119
|
+
transition:
|
|
120
|
+
200ms transform,
|
|
121
|
+
200ms top;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
.swiper-horizontal > .swiper-pagination-bullets,
|
|
126
|
+
.swiper-pagination-horizontal.swiper-pagination-bullets {
|
|
127
|
+
.swiper-pagination-bullet {
|
|
128
|
+
margin: 0 var(--swiper-pagination-bullet-horizontal-gap, 4px);
|
|
129
|
+
}
|
|
130
|
+
&.swiper-pagination-bullets-dynamic {
|
|
131
|
+
left: 50%;
|
|
132
|
+
transform: translateX(-50%);
|
|
133
|
+
white-space: nowrap;
|
|
134
|
+
.swiper-pagination-bullet {
|
|
135
|
+
transition:
|
|
136
|
+
200ms transform,
|
|
137
|
+
200ms left;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
.swiper-horizontal.swiper-rtl > .swiper-pagination-bullets-dynamic .swiper-pagination-bullet {
|
|
142
|
+
transition:
|
|
143
|
+
200ms transform,
|
|
144
|
+
200ms right;
|
|
145
|
+
}
|
|
146
|
+
/* Fraction */
|
|
147
|
+
.swiper-pagination-fraction {
|
|
148
|
+
color: var(--swiper-pagination-fraction-color, inherit);
|
|
149
|
+
}
|
|
150
|
+
/* Progress */
|
|
151
|
+
.swiper-pagination-progressbar {
|
|
152
|
+
background: var(--swiper-pagination-progressbar-bg-color, rgba(0, 0, 0, 0.25));
|
|
153
|
+
position: absolute;
|
|
154
|
+
.swiper-pagination-progressbar-fill {
|
|
155
|
+
background: var(--swiper-pagination-color, var(--swiper-theme-color));
|
|
156
|
+
position: absolute;
|
|
157
|
+
left: 0;
|
|
158
|
+
top: 0;
|
|
159
|
+
width: 100%;
|
|
160
|
+
height: 100%;
|
|
161
|
+
transform: scale(0);
|
|
162
|
+
transform-origin: left top;
|
|
163
|
+
}
|
|
164
|
+
.swiper-rtl & .swiper-pagination-progressbar-fill {
|
|
165
|
+
transform-origin: right top;
|
|
166
|
+
}
|
|
167
|
+
.swiper-horizontal > &,
|
|
168
|
+
&.swiper-pagination-horizontal,
|
|
169
|
+
.swiper-vertical > &.swiper-pagination-progressbar-opposite,
|
|
170
|
+
&.swiper-pagination-vertical.swiper-pagination-progressbar-opposite {
|
|
171
|
+
width: 100%;
|
|
172
|
+
height: var(--swiper-pagination-progressbar-size, 4px);
|
|
173
|
+
left: 0;
|
|
174
|
+
top: 0;
|
|
175
|
+
}
|
|
176
|
+
.swiper-vertical > &,
|
|
177
|
+
&.swiper-pagination-vertical,
|
|
178
|
+
.swiper-horizontal > &.swiper-pagination-progressbar-opposite,
|
|
179
|
+
&.swiper-pagination-horizontal.swiper-pagination-progressbar-opposite {
|
|
180
|
+
width: var(--swiper-pagination-progressbar-size, 4px);
|
|
181
|
+
height: 100%;
|
|
182
|
+
left: 0;
|
|
183
|
+
top: 0;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
.swiper-pagination-lock {
|
|
187
|
+
display: none;
|
|
188
|
+
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{e as elementChildren}from"../shared/utils.min.mjs";function Parallax(a){let{swiper:e,extendParams:t,on:l}=a;t({parallax:{enabled:!1}});const r="[data-swiper-parallax], [data-swiper-parallax-x], [data-swiper-parallax-y], [data-swiper-parallax-opacity], [data-swiper-parallax-scale]",s=(a,t)=>{const{rtl:l}=e,r=l?-1:1,s=a.getAttribute("data-swiper-parallax")||"0";let i=a.getAttribute("data-swiper-parallax-x"),p=a.getAttribute("data-swiper-parallax-y");const n=a.getAttribute("data-swiper-parallax-scale"),o=a.getAttribute("data-swiper-parallax-opacity"),d=a.getAttribute("data-swiper-parallax-rotate");if(i||p?(i=i||"0",p=p||"0"):e.isHorizontal()?(i=s,p="0"):(p=s,i="0"),i=i.indexOf("%")>=0?parseInt(i,10)*t*r+"%":i*t*r+"px",p=p.indexOf("%")>=0?parseInt(p,10)*t+"%":p*t+"px",null!=o){const e=o-(o-1)*(1-Math.abs(t));a.style.opacity=e}let x=`translate3d(${i}, ${p}, 0px)`;if(null!=n){x+=` scale(${n-(n-1)*(1-Math.abs(t))})`}if(d&&null!=d){x+=` rotate(${d*t*-1}deg)`}a.style.transform=x},i=()=>{const{el:a,slides:t,progress:l,snapGrid:i,isElement:p}=e,n=elementChildren(a,r);e.isElement&&n.push(...elementChildren(e.hostEl,r)),n.forEach((a=>{s(a,l)})),t.forEach(((a,t)=>{let p=a.progress;e.params.slidesPerGroup>1&&"auto"!==e.params.slidesPerView&&(p+=Math.ceil(t/2)-l*(i.length-1)),p=Math.min(Math.max(p,-1),1),a.querySelectorAll(`${r}, [data-swiper-parallax-rotate]`).forEach((a=>{s(a,p)}))}))};l("beforeInit",(()=>{e.params.parallax.enabled&&(e.params.watchSlidesProgress=!0,e.originalParams.watchSlidesProgress=!0)})),l("init",(()=>{e.params.parallax.enabled&&i()})),l("setTranslate",(()=>{e.params.parallax.enabled&&i()})),l("setTransition",((a,t)=>{e.params.parallax.enabled&&function(a){void 0===a&&(a=e.params.speed);const{el:t,hostEl:l}=e,s=[...t.querySelectorAll(r)];e.isElement&&s.push(...l.querySelectorAll(r)),s.forEach((e=>{let t=parseInt(e.getAttribute("data-swiper-parallax-duration"),10)||a;0===a&&(t=0),e.style.transitionDuration=`${t}ms`}))}(t)}))}export{Parallax as default};
|
|
2
|
+
//# sourceMappingURL=parallax.min.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parallax.mjs.mjs","names":["elementChildren","Parallax","_ref","swiper","extendParams","on","parallax","enabled","elementsSelector","setTransform","el","progress","rtl","rtlFactor","p","getAttribute","x","y","scale","opacity","rotate","isHorizontal","indexOf","parseInt","currentOpacity","Math","abs","style","transform","setTranslate","slides","snapGrid","isElement","elements","push","hostEl","forEach","subEl","slideEl","slideIndex","slideProgress","params","slidesPerGroup","slidesPerView","ceil","length","min","max","querySelectorAll","watchSlidesProgress","originalParams","_swiper","duration","speed","parallaxEl","parallaxDuration","transitionDuration","setTransition"],"sources":["0"],"mappings":"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"}
|