@xwadex/fesd 0.0.14-re.22 → 0.0.14-re.24
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/assets/fesd-bundle.js +453 -602
- package/dist/assets/fesd-bundle.js.map +1 -1
- package/dist/assets/image-preview-bundle.js +5310 -5154
- package/dist/assets/image-preview-bundle.js.map +1 -1
- package/dist/assets/tools-bundle.js +2 -2
- package/dist/assets/tools-bundle.js.map +1 -1
- package/package.json +1 -2
@@ -1,21 +1,21 @@
|
|
1
|
-
var
|
2
|
-
if (!e.has(
|
1
|
+
var Ft = (i, e, t) => {
|
2
|
+
if (!e.has(i))
|
3
3
|
throw TypeError("Cannot " + t);
|
4
4
|
};
|
5
|
-
var
|
6
|
-
if (e.has(
|
5
|
+
var d = (i, e, t) => {
|
6
|
+
if (e.has(i))
|
7
7
|
throw TypeError("Cannot add the same private member more than once");
|
8
|
-
e instanceof WeakSet ? e.add(
|
8
|
+
e instanceof WeakSet ? e.add(i) : e.set(i, t);
|
9
9
|
};
|
10
|
-
var o = (
|
11
|
-
import {
|
12
|
-
import { A as
|
13
|
-
const
|
14
|
-
const
|
10
|
+
var o = (i, e, t) => (Ft(i, e, "access private method"), t);
|
11
|
+
import { i as $t, a as ut, g as Lt, v as Ut, c as Vt, S as Jt, b as bt, d as Kt, e as Yt, f as A, s as Qt, m as y, h as $ } from "./image-preview-bundle.js";
|
12
|
+
import { A as we, k as ye, C as Ee, j as $e, D as Le, l as Ae, I as Se, M as xe, R as ke, T as Te } from "./image-preview-bundle.js";
|
13
|
+
const I = () => {
|
14
|
+
const i = navigator.userAgent, e = {
|
15
15
|
// Firefox 1.0+
|
16
16
|
isFirefox: typeof InstallTrigger < "u",
|
17
17
|
// Opera 8.0+
|
18
|
-
isOpera: !!window.opr && !!opr.addons || !!window.opera ||
|
18
|
+
isOpera: !!window.opr && !!opr.addons || !!window.opera || i.indexOf(" OPR/") >= 0,
|
19
19
|
// Internet Explorer 6-11
|
20
20
|
isIE: (
|
21
21
|
/*@cc_on!@*/
|
@@ -24,194 +24,95 @@ const D = () => {
|
|
24
24
|
// Edge 20+
|
25
25
|
isEdge: !document.documentMode && !!window.StyleMedia,
|
26
26
|
// Edge (based on chromium) detection
|
27
|
-
isEdgeChromium: /\sedg\//i.test(
|
27
|
+
isEdgeChromium: /\sedg\//i.test(i) || /edg([ea]|ios)/i.test(i),
|
28
28
|
// Safari 3.0+ "[object HTMLElementConstructor]"
|
29
|
-
isSafari: !/chrome|crios|crmo/i.test(
|
29
|
+
isSafari: !/chrome|crios|crmo/i.test(i) && /safari/i.test(i),
|
30
30
|
// Chrome 1 - 79
|
31
|
-
isChrome: !!window.chrome && (!!window.chrome.webstore || !!window.chrome.runtime) || /chrome|crios|crmo/i.test(
|
31
|
+
isChrome: !!window.chrome && (!!window.chrome.webstore || !!window.chrome.runtime) || /chrome|crios|crmo/i.test(i)
|
32
32
|
}, t = {
|
33
33
|
// Android
|
34
|
-
isAndroid:
|
34
|
+
isAndroid: i.indexOf("Android") > -1 || i.indexOf("Adr") > -1,
|
35
35
|
// iOS | ipad
|
36
|
-
isiOS:
|
36
|
+
isiOS: i.indexOf("Mac") > -1 && "ontouchend" in document
|
37
37
|
}, s = {
|
38
38
|
// window
|
39
|
-
isWindows:
|
39
|
+
isWindows: i.indexOf("Win") > -1,
|
40
40
|
// macos
|
41
|
-
isMacOS:
|
41
|
+
isMacOS: i.indexOf("Mac") > -1,
|
42
42
|
// UNIX
|
43
|
-
isUNIX:
|
43
|
+
isUNIX: i.indexOf("X11") > -1,
|
44
44
|
// Linux
|
45
|
-
isLinux:
|
45
|
+
isLinux: i.indexOf("Linux") > -1
|
46
46
|
};
|
47
47
|
return { browser: e, mobile: t, os: s };
|
48
|
-
},
|
49
|
-
const { browser:
|
50
|
-
return Object.keys(
|
51
|
-
if (
|
52
|
-
return
|
48
|
+
}, Zt = () => {
|
49
|
+
const { browser: i } = I();
|
50
|
+
return Object.keys(i).find((e) => {
|
51
|
+
if (i[e])
|
52
|
+
return i[e];
|
53
53
|
});
|
54
|
-
},
|
55
|
-
const { mobile:
|
56
|
-
return Object.keys(
|
57
|
-
if (
|
58
|
-
return
|
54
|
+
}, te = () => {
|
55
|
+
const { mobile: i } = I();
|
56
|
+
return Object.keys(i).some((e) => {
|
57
|
+
if (i[e])
|
58
|
+
return i[e];
|
59
59
|
});
|
60
|
-
},
|
61
|
-
const { os:
|
62
|
-
return Object.keys(
|
63
|
-
if (
|
64
|
-
return
|
60
|
+
}, ee = () => {
|
61
|
+
const { os: i } = I();
|
62
|
+
return Object.keys(i).find((e) => {
|
63
|
+
if (i[e])
|
64
|
+
return i[e];
|
65
65
|
});
|
66
|
-
},
|
67
|
-
function
|
66
|
+
}, se = () => console.dir(I());
|
67
|
+
function ue() {
|
68
68
|
return {
|
69
|
-
init:
|
70
|
-
isBrowser4:
|
71
|
-
isMobile4:
|
72
|
-
isOs4:
|
73
|
-
logs:
|
69
|
+
init: I,
|
70
|
+
isBrowser4: Zt,
|
71
|
+
isMobile4: te,
|
72
|
+
isOs4: ee,
|
73
|
+
logs: se
|
74
74
|
};
|
75
75
|
}
|
76
|
-
const
|
77
|
-
|
78
|
-
class He extends Pt {
|
79
|
-
constructor(t, s = {}) {
|
80
|
-
super();
|
81
|
-
h(this, _);
|
82
|
-
h(this, F);
|
83
|
-
h(this, Y);
|
84
|
-
h(this, C);
|
85
|
-
h(this, J);
|
86
|
-
if (!wt(t) && !Gt(t) && !j(t)) {
|
87
|
-
It("video4", `找不到該物件 -> ${t}`);
|
88
|
-
return;
|
89
|
-
}
|
90
|
-
const { EVENTS: i } = Ee;
|
91
|
-
this.__events__ = Object.assign({}, i), this.__storage__ = { el: t, options: s }, o(this, _, xt).call(this);
|
92
|
-
}
|
93
|
-
update() {
|
94
|
-
o(this, _, xt).call(this);
|
95
|
-
}
|
96
|
-
}
|
97
|
-
_ = new WeakSet(), xt = function() {
|
98
|
-
const { el: t, options: s } = this.__storage__, { SETTINGS: i, EVENTS: r } = X;
|
99
|
-
if (this.elements = Et(t), this.options = Object.assign({}, i, s), this.options.on)
|
100
|
-
for (const [n, l] of Object.entries(this.options.on))
|
101
|
-
this.__events__[n] = [l];
|
102
|
-
o(this, F, zt).call(this);
|
103
|
-
}, F = new WeakSet(), zt = function() {
|
104
|
-
const { elements: t, options: s } = this;
|
105
|
-
t.forEach((i) => {
|
106
|
-
i.video = {}, i.video.instance = this, i.video.defaultOptions = s, i.video.params = o(this, J, Vt).call(this, i), i.video.methods = {}, i.video.methods.update = this.update, Ot(i.video.params) && !Me(i.video.params) && (i.setAttribute("video4-active", "on"), o(this, Y, Ut).call(this, i)), Ot(i.video.params) || It("video4", "無法取得影片 ID");
|
107
|
-
}), this.emit("init");
|
108
|
-
}, Y = new WeakSet(), Ut = function(t) {
|
109
|
-
const { LAYOUT: s } = X, i = t.video.params, { $selector: r, videoLayoutNo: n, videoId: l, videoType: u, videoMode: p, videoButton: d, videoCover: c } = i;
|
110
|
-
if (p === "onBox") {
|
111
|
-
let m = null;
|
112
|
-
if (c === "on") {
|
113
|
-
t.classList.add("video4-cover"), r.querySelector("img") || (r.insertAdjacentHTML(g.prepend, '<picture><source srcset="" type="image/webp"><source srcset="" type="image/jpeg"><img src="" alt></picture>'), x("video4", "若啟用 [videoCover] 且選擇 onBox 模式必須於 video-target 內放置 img 結構,若無結構則自動加入圖片結構"));
|
114
|
-
const f = r.querySelector("img");
|
115
|
-
f.insertAdjacentHTML(g.after, s[n]);
|
116
|
-
const v = (f == null ? void 0 : f.getAttribute("src")) || (f == null ? void 0 : f.getAttribute("data-src"));
|
117
|
-
!v && u == "youtube" ? f.setAttribute("src", `https://img.youtube.com/vi/${l}/0.jpg`) : !v && u == "vimeo" ? f.setAttribute("src", `https://vumbnail.com/${l}_large.jpg`) : x("video4", "僅 youtube & vimeo 提供,無圖片時放置預設封面畫面,其他影片平台請自行上傳封面照片");
|
118
|
-
}
|
119
|
-
d == "off" ? m = r : (m = r.querySelector(d) ?? r, r.querySelector(d) || x("video4", `找不到 videoButton 設定的 element -> '${d}' , 點擊物件轉移至 '${this.__storage__.el}'`)), m.video || (m.video = {}, m.video.params = i), m.video.eventHandler = o(this, C, kt), m.addEventListener("click", m.video.eventHandler);
|
120
|
-
} else if (p === "onPage") {
|
121
|
-
let m = null;
|
122
|
-
if (c == "on") {
|
123
|
-
t.classList.add("video4-cover"), r.querySelector("img") || (r.insertAdjacentHTML(g.prepend, '<picture><source srcset="" type="image/webp"><source srcset="" type="image/jpeg"><img src="" alt></picture>'), x("video", "若啟用 [videoCover] 且選擇 onBox 模式必須於 video-target 內放置 img 結構"));
|
124
|
-
const f = r.querySelector("img");
|
125
|
-
f.insertAdjacentHTML(g.after, s[n]);
|
126
|
-
const v = (f == null ? void 0 : f.getAttribute("src")) || (f == null ? void 0 : f.getAttribute("data-src"));
|
127
|
-
!v && u == "youtube" ? f.setAttribute("src", `https://img.youtube.com/vi/${l}/0.jpg`) : !v && u == "vimeo" ? f.setAttribute("src", `https://vumbnail.com/${l}_large.jpg`) : v || x("video4", "僅 youtube & vimeo 提供,無圖片時放置預設封面畫面,其他影片平台請自行上傳封面照片"), d == "off" ? m = r : (m = r.querySelector(d) ?? r, r.querySelector(d) || x("video4", `找不到 videoButton 設定的 element -> '${d}', 點擊物件轉移至 '${this.__storage__.el}'`));
|
128
|
-
} else {
|
129
|
-
r.innerHTML = Lt(i);
|
130
|
-
return;
|
131
|
-
}
|
132
|
-
m.video || (m.video = {}, m.video.params = i), m.video.eventHandler = o(this, C, kt), m.addEventListener("click", m.video.eventHandler);
|
133
|
-
}
|
134
|
-
}, C = new WeakSet(), kt = function(t) {
|
135
|
-
const { video: s } = this, { $selector: i, videoMode: r, videoTarget: n, videoTargetRoute: l } = s.params, u = new ye({ callback_loaded: (p) => {
|
136
|
-
} });
|
137
|
-
if (r == "onBox") {
|
138
|
-
const p = {
|
139
|
-
target: n,
|
140
|
-
route: l,
|
141
|
-
on: {
|
142
|
-
complete(d) {
|
143
|
-
d.querySelector(".modal-content").insertAdjacentHTML("beforeend", Lt(s.params));
|
144
|
-
},
|
145
|
-
open(d) {
|
146
|
-
const c = d.querySelectorAll("[data-overlayscrollbars-viewport]");
|
147
|
-
u.update(), $e([...c]);
|
148
|
-
},
|
149
|
-
close(d) {
|
150
|
-
const c = d.querySelectorAll("[data-overlayscrollbars-viewport]");
|
151
|
-
Ae([...c]);
|
152
|
-
},
|
153
|
-
destroy(d) {
|
154
|
-
}
|
155
|
-
}
|
156
|
-
};
|
157
|
-
we.open(p);
|
158
|
-
} else
|
159
|
-
r == "onPage" && (s.params.videoAutoplay = "on", i.innerHTML = Lt(s.params));
|
160
|
-
}, J = new WeakSet(), Vt = function(t) {
|
161
|
-
const { SETTINGS: s } = X;
|
162
|
-
return {
|
163
|
-
$selector: t,
|
164
|
-
videoId: t.getAttribute("video-id"),
|
165
|
-
videoType: t.getAttribute("video-type"),
|
166
|
-
videoAutoplay: t.getAttribute("video-autoplay") || s.videoAutoplay,
|
167
|
-
videoMode: t.getAttribute("video-mode") || s.videoMode,
|
168
|
-
videoButton: t.getAttribute("video-button") || s.videoButton,
|
169
|
-
videoCover: t.getAttribute("video-cover") || s.videoCover,
|
170
|
-
videoLayoutNo: t.getAttribute("video-layout-no") || s.videoLayoutNo,
|
171
|
-
videoTarget: t.getAttribute("video-target") || s.videoTarget,
|
172
|
-
videoTargetRoute: t.getAttribute("video-target-route") || s.videoTargetRoute
|
173
|
-
};
|
174
|
-
};
|
175
|
-
const b = (a, e, t) => {
|
176
|
-
a && (j(a) ? a.forEach((s) => s.style[e] = t) : a.style[e] = t);
|
76
|
+
const g = (i, e, t) => {
|
77
|
+
i && (bt(i) ? i.forEach((s) => s.style[e] = t) : i.style[e] = t);
|
177
78
|
};
|
178
|
-
var
|
179
|
-
class
|
79
|
+
var B, At, X, St, W, pt, R, xt, q, mt, G, kt;
|
80
|
+
class pe {
|
180
81
|
constructor(e, t = {}) {
|
181
|
-
|
182
|
-
|
82
|
+
d(this, B);
|
83
|
+
d(this, X);
|
183
84
|
// 取得元件上的設定值
|
184
|
-
|
85
|
+
d(this, W);
|
185
86
|
// 設置設定值的 CSS 樣式
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
87
|
+
d(this, R);
|
88
|
+
d(this, q);
|
89
|
+
d(this, G);
|
90
|
+
!$t(e) || !ut(e) || (this.__storage__ = {
|
190
91
|
el: e,
|
191
92
|
options: t
|
192
|
-
}, o(this,
|
93
|
+
}, o(this, B, At).call(this));
|
193
94
|
}
|
194
95
|
update() {
|
195
96
|
const { elements: e } = this;
|
196
97
|
e.forEach((t) => {
|
197
98
|
t.querySelectorAll("._article").forEach((s) => {
|
198
|
-
s.article = {}, s.article.parent = t, s.article.params = o(this, W,
|
99
|
+
s.article = {}, s.article.parent = t, s.article.params = o(this, W, pt).call(this, s), o(this, q, mt).call(this, s);
|
199
100
|
});
|
200
101
|
});
|
201
102
|
}
|
202
103
|
}
|
203
|
-
|
204
|
-
const { el: e, options: t } = this.__storage__, { SETTINGS: s } =
|
205
|
-
this.elements =
|
206
|
-
},
|
104
|
+
B = new WeakSet(), At = function() {
|
105
|
+
const { el: e, options: t } = this.__storage__, { SETTINGS: s } = Kt;
|
106
|
+
this.elements = Lt(e + ":not[data-article-active]"), this.options = Object.assign({}, s, t), o(this, X, St).call(this);
|
107
|
+
}, X = new WeakSet(), St = function() {
|
207
108
|
const { elements: e } = this;
|
208
109
|
e.forEach((t) => {
|
209
|
-
t.querySelectorAll("._article").forEach((s) => {
|
210
|
-
var
|
211
|
-
s.article = {}, s.article.parent = t, s.article.params = o(this, W,
|
110
|
+
t.setAttribute("data-article-active", ""), t.querySelectorAll("._article").forEach((s) => {
|
111
|
+
var a, n;
|
112
|
+
s.article = {}, s.article.parent = t, s.article.params = o(this, W, pt).call(this, s), s.article.methods = {}, s.article.methods.update = this.update, o(n = o(a = o(this, R, xt).call(this, s), q, mt).call(a, s), G, kt).call(n, s);
|
212
113
|
});
|
213
114
|
});
|
214
|
-
}, W = new WeakSet(),
|
115
|
+
}, W = new WeakSet(), pt = function(e) {
|
215
116
|
return {
|
216
117
|
// 元件本身
|
217
118
|
$selector: e,
|
@@ -243,171 +144,171 @@ K = new WeakSet(), Ft = function() {
|
|
243
144
|
buttonTextColor: e.getAttribute("button-textcolor"),
|
244
145
|
descriptionColor: e.getAttribute("description-color")
|
245
146
|
};
|
246
|
-
},
|
147
|
+
}, R = new WeakSet(), xt = function(e) {
|
247
148
|
const { params: t } = e.article;
|
248
|
-
return
|
249
|
-
},
|
149
|
+
return g(t.$h, "color", t.hColor), g(t.$subH, "color", t.subHColor), g(t.$p, "color", t.pColor), g(t.$description, "color", t.descriptionColor), g(t.$button, "backgroundColor", t.buttonColor), g(t.$button, "color", t.buttonTextColor), t.buttonColorHover && t.$button && (t.$button.appendChild(document.createElement("span")), g(t.$button.querySelector("span"), "backgroundColor", t.buttonColorHover)), g(t.$backgroundWrap, "backgroundColor", t.typeFullColor), g(t.$contentWrap, "backgroundColor", t.typeFullBoxColor), this;
|
150
|
+
}, q = new WeakSet(), mt = function(e) {
|
250
151
|
const { params: t } = e.article;
|
251
|
-
return t.$video.length && new
|
252
|
-
},
|
152
|
+
return t.$video.length && new Ut(t.$video), this;
|
153
|
+
}, G = new WeakSet(), kt = function(e) {
|
253
154
|
const { basic_rwd: t } = this.options, { params: s } = e.article;
|
254
155
|
if (!s.$swiper)
|
255
156
|
return;
|
256
|
-
const
|
257
|
-
let
|
157
|
+
const a = Vt(), n = this;
|
158
|
+
let r = {
|
258
159
|
on: {
|
259
|
-
init(
|
260
|
-
const
|
261
|
-
s.$video.length && ([...
|
262
|
-
var
|
263
|
-
(
|
264
|
-
}),
|
160
|
+
init(c) {
|
161
|
+
const h = c.$el[0];
|
162
|
+
s.$video.length && ([...h.querySelectorAll("[video4-active]")].forEach((f) => {
|
163
|
+
var b, m;
|
164
|
+
(b = f.querySelector(Yt.SETTINGS.videoButton)) == null || b.remove(), (m = f.querySelector(".overlay")) == null || m.remove(), f.removeAttribute("video4-active");
|
165
|
+
}), n.update());
|
265
166
|
},
|
266
|
-
observerUpdate(
|
267
|
-
|
167
|
+
observerUpdate(c) {
|
168
|
+
c.params.autoplay.enabled && (c.autoplay.start(), c.update());
|
268
169
|
}
|
269
170
|
},
|
270
171
|
observer: !0,
|
271
172
|
breakpoints: {}
|
272
173
|
};
|
273
|
-
if (s.$selector.setAttribute("img-swiper", "on"), s.$selector.classList.add(`swiper-${
|
274
|
-
const
|
275
|
-
|
276
|
-
const
|
277
|
-
|
278
|
-
nextEl: `.swiper-button-next.swiper-${
|
279
|
-
prevEl: `.swiper-button-prev.swiper-${
|
174
|
+
if (s.$selector.setAttribute("img-swiper", "on"), s.$selector.classList.add(`swiper-${a}`), s.$selector.getAttribute("swiper-arrow") !== "off" && s.$selector.getAttribute("swiper-arrow")) {
|
175
|
+
const c = document.createElement("div");
|
176
|
+
c.className = `swiper-button-next swiper-${a}`, s.$swiperButtonCover.appendChild(c);
|
177
|
+
const h = document.createElement("div");
|
178
|
+
h.className = `swiper-button-prev swiper-${a}`, s.$swiperButtonCover.appendChild(h), r.navigation = {
|
179
|
+
nextEl: `.swiper-button-next.swiper-${a}`,
|
180
|
+
prevEl: `.swiper-button-prev.swiper-${a}`
|
280
181
|
};
|
281
182
|
}
|
282
183
|
if (s.$selector.getAttribute("swiper-nav") !== "off" || !s.$selector.getAttribute("swiper-nav")) {
|
283
|
-
const
|
284
|
-
|
285
|
-
el: `.swiper-pagination.swiper-${
|
184
|
+
const c = document.createElement("div");
|
185
|
+
c.className = `swiper-pagination swiper-${a}`, s.$swiper.appendChild(c), r.pagination = {
|
186
|
+
el: `.swiper-pagination.swiper-${a}`,
|
286
187
|
clickable: !0
|
287
188
|
};
|
288
189
|
}
|
289
|
-
Number.parseInt(s.$selector.getAttribute("swiper-num")) && (
|
190
|
+
Number.parseInt(s.$selector.getAttribute("swiper-num")) && (r.breakpoints[t] = {
|
290
191
|
slidesPerView: s.$selector.getAttribute("swiper-num") ? Number.parseInt(s.$selector.getAttribute("swiper-num")) > 5 ? 5 : Number.parseInt(s.$selector.getAttribute("swiper-num")) : 1
|
291
|
-
}), (s.$selector.getAttribute("swiper-autoplay") !== "off" || !s.$selector.getAttribute("swiper-autoplay")) && (
|
192
|
+
}), (s.$selector.getAttribute("swiper-autoplay") !== "off" || !s.$selector.getAttribute("swiper-autoplay")) && (r.autoplay = {
|
292
193
|
delay: 3e3,
|
293
194
|
disableOnInteraction: !1
|
294
|
-
}), (s.$selector.getAttribute("swiper-loop") !== "off" || !s.$selector.getAttribute("swiper-loop")) && (
|
195
|
+
}), (s.$selector.getAttribute("swiper-loop") !== "off" || !s.$selector.getAttribute("swiper-loop")) && (r.loop = !0), s.$selector.getAttribute("swiper-speed") && (r.speed = parseInt(s.$selector.getAttribute("swiper-speed"))), s.$selector.getAttribute("swiper-parallax") !== "off" && !s.$selector.getAttribute("swiper-loop") && (r.parallax = !0), s.$selector.getAttribute("swiper-pagination-dynamic") === "on" && (r.pagination.dynamicBullets = !0);
|
295
196
|
let l = () => window.innerWidth > this.basic_rwd && Number(s.$selector.getAttribute("swiper-num")) || 1;
|
296
|
-
s.$swiper.querySelectorAll(".swiper-slide").length <= l() && (
|
297
|
-
const
|
298
|
-
return e.article.swiperList = [], e.article.swiperList.push(
|
197
|
+
s.$swiper.querySelectorAll(".swiper-slide").length <= l() && (r.navigation = !1, r.pagination = !1, r.autoplay = !1, r.loop = !1, s.$selector.querySelector(".swiper-button-cover").style.display = "none", s.$selector.querySelector(".swiper-pagination").style.display = "none", s.$swiper.classList.add("swiper-no-swiping"));
|
198
|
+
const p = new Jt(s.$swiper, r);
|
199
|
+
return e.article.swiperList = [], e.article.swiperList.push(p), this;
|
299
200
|
};
|
300
|
-
let
|
301
|
-
function L(
|
302
|
-
const e = window.getComputedStyle(
|
201
|
+
let gt = "ontouchstart" in document.documentElement ? "touchstart" : "mousedown", vt = "ontouchend" in document.documentElement ? "touchend" : "mouseup", ct = "ontouchmove" in document.documentElement ? "touchmove" : "mousemove";
|
202
|
+
function L(i) {
|
203
|
+
const e = window.getComputedStyle(i), t = e.transform || e.mozTransform;
|
303
204
|
if (t === "none")
|
304
205
|
return {
|
305
206
|
x: 0,
|
306
207
|
y: 0,
|
307
208
|
z: 0
|
308
209
|
};
|
309
|
-
const s = t.includes("3d") ? "3d" : "2d",
|
210
|
+
const s = t.includes("3d") ? "3d" : "2d", a = t.match(/matrix.*\((.+)\)/)[1].split(", ");
|
310
211
|
if (s === "2d")
|
311
212
|
return {
|
312
|
-
x: Number(
|
313
|
-
y: Number(
|
213
|
+
x: Number(a[4]),
|
214
|
+
y: Number(a[5]),
|
314
215
|
z: 0
|
315
216
|
};
|
316
217
|
if (s === "3d")
|
317
218
|
return {
|
318
|
-
x: Number(
|
319
|
-
y: Number(
|
320
|
-
z: Number(
|
219
|
+
x: Number(a[12]),
|
220
|
+
y: Number(a[13]),
|
221
|
+
z: Number(a[14])
|
321
222
|
};
|
322
223
|
}
|
323
|
-
function
|
324
|
-
const t =
|
224
|
+
function H(i) {
|
225
|
+
const t = i.querySelector(".wrapper").querySelectorAll(".item");
|
325
226
|
let s = 0;
|
326
|
-
return t.forEach((
|
327
|
-
const
|
328
|
-
s +=
|
227
|
+
return t.forEach((a) => {
|
228
|
+
const n = getComputedStyle(a), r = parseInt(n.marginLeft), l = parseInt(n.marginRight);
|
229
|
+
s += a.getBoundingClientRect().width + r + l;
|
329
230
|
}), s;
|
330
231
|
}
|
331
|
-
function
|
332
|
-
if (L(
|
232
|
+
function dt(i) {
|
233
|
+
if (L(i.slideWrapEl).x >= i.translateMin)
|
333
234
|
return "is-start";
|
334
|
-
if (L(
|
235
|
+
if (L(i.slideWrapEl).x <= i.translateMax)
|
335
236
|
return "is-end";
|
336
|
-
if (L(
|
237
|
+
if (L(i.slideWrapEl).x < i.translateMin && L(i.slideWrapEl).x > i.translateMax)
|
337
238
|
return "is-middle";
|
338
239
|
}
|
339
|
-
function
|
340
|
-
const e =
|
341
|
-
t.addEventListener(
|
342
|
-
switch (
|
240
|
+
function ie(i) {
|
241
|
+
const e = i.el, t = e.querySelector(".wrapper");
|
242
|
+
t.addEventListener(gt, function(s) {
|
243
|
+
switch (i.isDown = !0, i.slidable && t.classList.add("dragging"), gt) {
|
343
244
|
case "mousedown":
|
344
|
-
|
245
|
+
i.startX = s.pageX;
|
345
246
|
break;
|
346
247
|
case "touchstart":
|
347
|
-
|
248
|
+
i.startX = s.changedTouches[0].pageX;
|
348
249
|
break;
|
349
250
|
}
|
350
|
-
|
351
|
-
}), t.addEventListener(
|
352
|
-
|
353
|
-
let
|
354
|
-
switch (
|
251
|
+
i.nowTranslateX = L(t).x;
|
252
|
+
}), t.addEventListener(vt, function(s) {
|
253
|
+
i.isDown = !1, t.classList.remove("dragging"), t.classList.remove("moving");
|
254
|
+
let a;
|
255
|
+
switch (ct) {
|
355
256
|
case "mousemove":
|
356
|
-
|
257
|
+
a = s.pageX - i.startX;
|
357
258
|
break;
|
358
259
|
case "touchmove":
|
359
|
-
|
260
|
+
a = s.changedTouches[0].pageX - i.startX;
|
360
261
|
break;
|
361
262
|
}
|
362
|
-
if (
|
363
|
-
if (
|
263
|
+
if (a === 0 && s.target.closest(".item")) {
|
264
|
+
if (vt === "mouseup" && s.button !== 0)
|
364
265
|
return;
|
365
|
-
t.querySelectorAll(".item").forEach((
|
366
|
-
|
367
|
-
}), s.target.closest(".item").classList.add("active"),
|
266
|
+
t.querySelectorAll(".item").forEach((r) => {
|
267
|
+
r.classList.remove("active");
|
268
|
+
}), s.target.closest(".item").classList.add("active"), i.moveActive(i.params.speed);
|
368
269
|
} else
|
369
|
-
|
270
|
+
i.slidable && i.resetPos(e);
|
370
271
|
}), t.addEventListener("mouseleave", function() {
|
371
|
-
|
372
|
-
}), t.addEventListener(
|
373
|
-
if (
|
374
|
-
if (!
|
272
|
+
i.isDown && i.slidable && (i.isDown = !1, t.classList.remove("dragging"), t.classList.remove("moving"), i.resetPos(e));
|
273
|
+
}), t.addEventListener(ct, function(s) {
|
274
|
+
if (i.draggable && i.slidable) {
|
275
|
+
if (!i.isDown)
|
375
276
|
return;
|
376
277
|
s.preventDefault();
|
377
|
-
let
|
378
|
-
switch (
|
278
|
+
let a;
|
279
|
+
switch (ct) {
|
379
280
|
case "mousemove":
|
380
|
-
|
281
|
+
a = s.pageX - i.startX;
|
381
282
|
break;
|
382
283
|
case "touchmove":
|
383
|
-
|
284
|
+
a = s.changedTouches[0].pageX - i.startX;
|
384
285
|
break;
|
385
286
|
}
|
386
|
-
if (
|
287
|
+
if (a !== 0) {
|
387
288
|
t.classList.add("moving");
|
388
|
-
const
|
289
|
+
const n = {
|
389
290
|
transition: "all 0ms ease 0s",
|
390
|
-
transform: `translate3d(${
|
291
|
+
transform: `translate3d(${i.nowTranslateX + a}px,0,0)`
|
391
292
|
};
|
392
|
-
Object.assign(t.style,
|
293
|
+
Object.assign(t.style, n);
|
393
294
|
}
|
394
295
|
}
|
395
296
|
});
|
396
297
|
}
|
397
|
-
function
|
398
|
-
const e =
|
298
|
+
function ae(i) {
|
299
|
+
const e = i.querySelectorAll("a");
|
399
300
|
for (var t = 0, s = e.length; t < s; t++)
|
400
301
|
e[t].draggable = !1;
|
401
302
|
}
|
402
|
-
class
|
303
|
+
class me {
|
403
304
|
constructor(e, t) {
|
404
305
|
this.el = typeof e == "string" ? document.querySelector(e) : e, this.slideWrapEl = this.el.querySelector(".wrapper"), this.params = {
|
405
306
|
speed: 300,
|
406
307
|
clickSwitch: !0,
|
407
308
|
breakpoint: !1
|
408
|
-
}, Object.assign(this.params, t), this.draggable = !0, this.isDown = !1, this.startX = 0, this.nowTranslateX = L(this.slideWrapEl).x, this.slideTotalWidth =
|
309
|
+
}, Object.assign(this.params, t), this.draggable = !0, this.isDown = !1, this.startX = 0, this.nowTranslateX = L(this.slideWrapEl).x, this.slideTotalWidth = H(this.el), this.translateMin = 0, this.translateMax = -Math.floor(
|
409
310
|
Math.abs(
|
410
|
-
|
311
|
+
H(this.el) - this.el.querySelector(".wrapper").getBoundingClientRect().width
|
411
312
|
)
|
412
313
|
), this.slidable = this.slideTotalWidth > Math.round(this.el.getBoundingClientRect().width) && (!this.params.breakpoint || window.innerWidth <= this.params.breakpoint), this.init();
|
413
314
|
}
|
@@ -415,35 +316,35 @@ class Ue {
|
|
415
316
|
const e = this;
|
416
317
|
e.slidable && (e.slideWrapEl.style.width = `${e.slideTotalWidth}px`, e.el.classList.add("slidable"), e.slideWrapEl.querySelector(".item.active") && e.moveActive()), window.addEventListener("resize", function() {
|
417
318
|
e.update();
|
418
|
-
}),
|
319
|
+
}), ie(e), ae(e.el);
|
419
320
|
}
|
420
321
|
moveActive(e) {
|
421
|
-
const t = this, s = t.slideWrapEl.querySelector(".item.active"),
|
322
|
+
const t = this, s = t.slideWrapEl.querySelector(".item.active"), n = s.previousElementSibling ? s.offsetLeft - t.el.clientWidth / 2 + s.clientWidth / 2 : 0;
|
422
323
|
if (t.slidable) {
|
423
|
-
if (-
|
424
|
-
const
|
324
|
+
if (-n < 0 && -n > t.translateMax) {
|
325
|
+
const r = {
|
425
326
|
transition: `all ${e || 0}ms ease 0s`,
|
426
|
-
transform: `translate3d(-${
|
327
|
+
transform: `translate3d(-${n}px,0,0)`
|
427
328
|
};
|
428
|
-
Object.assign(t.slideWrapEl.style,
|
429
|
-
} else if (-
|
430
|
-
const
|
329
|
+
Object.assign(t.slideWrapEl.style, r);
|
330
|
+
} else if (-n >= 0) {
|
331
|
+
const r = {
|
431
332
|
transition: `all ${e || 0}ms ease 0s`,
|
432
333
|
transform: "translate3d(0,0,0)"
|
433
334
|
};
|
434
|
-
Object.assign(t.slideWrapEl.style,
|
335
|
+
Object.assign(t.slideWrapEl.style, r);
|
435
336
|
} else {
|
436
|
-
const
|
337
|
+
const r = {
|
437
338
|
transition: `all ${e || 0}ms ease 0s`,
|
438
339
|
transform: `translate3d(${t.translateMax}px,0,0)`
|
439
340
|
};
|
440
|
-
Object.assign(t.slideWrapEl.style,
|
341
|
+
Object.assign(t.slideWrapEl.style, r);
|
441
342
|
}
|
442
343
|
if (e)
|
443
344
|
t.slideWrapEl.addEventListener(
|
444
345
|
"transitionend",
|
445
346
|
function() {
|
446
|
-
switch (t.nowTranslateX = L(t.slideWrapEl).x,
|
347
|
+
switch (t.nowTranslateX = L(t.slideWrapEl).x, dt(t)) {
|
447
348
|
case "is-start":
|
448
349
|
t.el.classList.add("is-start"), t.el.classList.remove("is-end");
|
449
350
|
break;
|
@@ -458,7 +359,7 @@ class Ue {
|
|
458
359
|
!1
|
459
360
|
);
|
460
361
|
else
|
461
|
-
switch (t.nowTranslateX = L(t.slideWrapEl).x,
|
362
|
+
switch (t.nowTranslateX = L(t.slideWrapEl).x, dt(t)) {
|
462
363
|
case "is-start":
|
463
364
|
t.el.classList.add("is-start"), t.el.classList.remove("is-end");
|
464
365
|
break;
|
@@ -473,7 +374,7 @@ class Ue {
|
|
473
374
|
}
|
474
375
|
resetPos() {
|
475
376
|
const e = this;
|
476
|
-
switch (
|
377
|
+
switch (dt(e)) {
|
477
378
|
case "is-start":
|
478
379
|
e.el.classList.add("is-start"), e.el.classList.remove("is-end"), Object.assign(e.slideWrapEl.style, {
|
479
380
|
transition: `all ${e.params.speed}ms ease 0s`,
|
@@ -493,212 +394,212 @@ class Ue {
|
|
493
394
|
}
|
494
395
|
update() {
|
495
396
|
const e = this;
|
496
|
-
e.el.querySelector(".wrapper").removeAttribute("style"), e.slideTotalWidth =
|
397
|
+
e.el.querySelector(".wrapper").removeAttribute("style"), e.slideTotalWidth = H(e.el), e.translateMax = -Math.floor(
|
497
398
|
Math.abs(
|
498
|
-
|
399
|
+
H(e.el) - e.el.querySelector(".wrapper").getBoundingClientRect().width
|
499
400
|
)
|
500
401
|
), e.slidable = e.slideTotalWidth > Math.round(e.el.getBoundingClientRect().width) && (!e.params.breakpoint || window.innerWidth <= e.params.breakpoint), e.slidable ? (e.slideWrapEl.style.width = `${e.slideTotalWidth}px`, e.el.classList.add("slidable"), e.slideWrapEl.querySelector(".item.active") && e.moveActive()) : (e.el.classList.remove("slidable"), e.el.classList.remove("is-start"), e.el.classList.remove("is-end"), e.slideWrapEl.removeAttribute("style"));
|
501
402
|
}
|
502
403
|
}
|
503
|
-
const
|
504
|
-
if (
|
404
|
+
const wt = (i) => {
|
405
|
+
if (i == "facebook")
|
505
406
|
return "https://www.facebook.com/sharer/sharer.php?u=";
|
506
|
-
if (
|
407
|
+
if (i == "line")
|
507
408
|
return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ? "http://line.naver.jp/R/msg/text/?" : "https://lineit.line.me/share/ui?url=";
|
508
|
-
if (
|
409
|
+
if (i == "twitter")
|
509
410
|
return "https://twitter.com/intent/tweet?url=";
|
510
|
-
if (
|
411
|
+
if (i == "linkedin")
|
511
412
|
return `http://www.linkedin.com/shareArticle?mini=true&title=${document.title}&source=${document.title}&url=`;
|
512
|
-
if (
|
413
|
+
if (i == "telegram")
|
513
414
|
return "https://telegram.me/share/url?url=";
|
514
415
|
};
|
515
|
-
var
|
516
|
-
class
|
416
|
+
var P, Tt, z, Wt, F, qt;
|
417
|
+
class he {
|
517
418
|
constructor(e, t = {}) {
|
518
|
-
|
519
|
-
|
520
|
-
|
419
|
+
d(this, P);
|
420
|
+
d(this, z);
|
421
|
+
d(this, F);
|
521
422
|
this.__storage__ = {
|
522
423
|
el: e,
|
523
424
|
options: t
|
524
|
-
}, o(this,
|
425
|
+
}, o(this, P, Tt).call(this);
|
525
426
|
}
|
526
427
|
}
|
527
|
-
|
528
|
-
const { el: e, options: t } = this.__storage__, { SETTINGS: s } =
|
529
|
-
|
530
|
-
},
|
428
|
+
P = new WeakSet(), Tt = function() {
|
429
|
+
const { el: e, options: t } = this.__storage__, { SETTINGS: s } = Qt;
|
430
|
+
!$t(e) || !ut(e) || (this.elements = Lt(e), this.options = Object.assign({}, s, t), o(this, z, Wt).call(this));
|
431
|
+
}, z = new WeakSet(), Wt = function() {
|
531
432
|
const { elements: e, options: t } = this;
|
532
433
|
e.forEach((s) => {
|
533
|
-
s.querySelectorAll("[share-target]").forEach((
|
534
|
-
|
434
|
+
s.querySelectorAll("[share-target]").forEach((a) => {
|
435
|
+
a.share = {}, a.share.instance = this, a.share.params = t, a.share.eventHandler = o(this, F, qt), a.addEventListener("click", a.share.eventHandler);
|
535
436
|
});
|
536
437
|
});
|
537
|
-
},
|
538
|
-
const { eventHandler: e, params: t } = this.share, s = this.getAttribute("share-target"),
|
438
|
+
}, F = new WeakSet(), qt = function() {
|
439
|
+
const { eventHandler: e, params: t } = this.share, s = this.getAttribute("share-target"), a = {
|
539
440
|
source: this.getAttribute("utm-source"),
|
540
441
|
medium: this.getAttribute("utm-medium"),
|
541
442
|
campaign: this.getAttribute("utm-campaign")
|
542
|
-
},
|
443
|
+
}, n = {
|
543
444
|
success: this.getAttribute("copy-success") || t.success,
|
544
445
|
text: this.getAttribute("copy-text") || t.text,
|
545
446
|
className: this.getAttribute("copy-class") || t.className,
|
546
447
|
duration: this.getAttribute("copy-duration") || t.duration
|
547
|
-
},
|
548
|
-
let l =
|
448
|
+
}, r = encodeURIComponent(document.URL);
|
449
|
+
let l = r;
|
549
450
|
if (s == "wechat") {
|
550
|
-
window.open(`https://api.qrserver.com/v1/create-qr-code/?data=${
|
451
|
+
window.open(`https://api.qrserver.com/v1/create-qr-code/?data=${r}&size=250x250`, "share to wechat", "width=300,height=300");
|
551
452
|
return;
|
552
453
|
}
|
553
454
|
if (s == "url") {
|
554
|
-
if (
|
455
|
+
if (ut(".copied-wrapper"))
|
555
456
|
return;
|
556
|
-
document.querySelector("body").insertAdjacentHTML(
|
557
|
-
const
|
558
|
-
|
559
|
-
const
|
560
|
-
if (
|
457
|
+
document.querySelector("body").insertAdjacentHTML(A.append, `<div class='copied-wrapper'><div class='text'>${n.success ? n.success : ""}</div><input id='clipboard' type='text' readonly></div>`);
|
458
|
+
const p = document.querySelector(".copied-wrapper");
|
459
|
+
n.className && p.classList.add(n.className), p.style.top = this.getBoundingClientRect().top + window.scrollY + "px", p.style.left = this.getBoundingClientRect().left + this.getBoundingClientRect().width / 2 + "px", p.style.display = "block";
|
460
|
+
const c = document.querySelector("#clipboard");
|
461
|
+
if (c.value = n.text ?? window.location.href, c.setSelectionRange(0, 9999), c.select(), document.execCommand("copy")) {
|
561
462
|
document.execCommand("copy");
|
562
|
-
const
|
563
|
-
|
564
|
-
const
|
463
|
+
const h = document.querySelector(".copied-wrapper"), u = document.querySelector(".copied-wrapper .text");
|
464
|
+
u.style.display = "block", u.style.opacity = 0;
|
465
|
+
const f = (m, ot) => {
|
565
466
|
let S = 0;
|
566
|
-
const
|
567
|
-
S +=
|
568
|
-
|
569
|
-
|
467
|
+
const x = 50, O = x / ot, lt = setInterval(function() {
|
468
|
+
S += O, m.style.opacity = S, S >= 1 && (clearInterval(lt), setTimeout(function() {
|
469
|
+
b(m, 300, function() {
|
470
|
+
h.remove();
|
570
471
|
});
|
571
|
-
},
|
572
|
-
},
|
573
|
-
},
|
574
|
-
let
|
575
|
-
const
|
576
|
-
|
577
|
-
},
|
472
|
+
}, n.duration));
|
473
|
+
}, x);
|
474
|
+
}, b = (m, ot, S) => {
|
475
|
+
let x = 1;
|
476
|
+
const O = 50, lt = O / ot, zt = setInterval(() => {
|
477
|
+
x -= lt, m.style.opacity = x, x <= 0 && (clearInterval(zt), m.style.display = "none", S && S());
|
478
|
+
}, O);
|
578
479
|
};
|
579
|
-
|
480
|
+
f(u, 300);
|
580
481
|
}
|
581
482
|
return;
|
582
483
|
}
|
583
|
-
l = `${l}${
|
484
|
+
l = `${l}${a.source ? `?utm_source=${a.source}` : ""}${a.medium ? `&utm_medium${a.medium}` : ""}${a.campaign ? `&utm_campaign${a.campaign}` : ""}`, l = l.replace("?", "%3F").replace(new RegExp("&", "g"), "%26"), s == "line" ? window.open(`${wt(s)}${r}`) : window.open(`${wt(s)}${l}"e=${l}`), this.removeEventListener("click", e), setTimeout(() => {
|
584
485
|
this.addEventListener("click", e);
|
585
486
|
}, 100);
|
586
487
|
};
|
587
|
-
function
|
488
|
+
function D(i) {
|
588
489
|
const e = {};
|
589
|
-
return [...
|
490
|
+
return [...i.attributes].forEach((t) => {
|
590
491
|
if (t.name.includes("duration-")) {
|
591
|
-
const s = t.name.replace("duration-", ""),
|
592
|
-
e[s] = Number(
|
492
|
+
const s = t.name.replace("duration-", ""), a = t.nodeValue;
|
493
|
+
e[s] = Number(a);
|
593
494
|
}
|
594
495
|
}), Object.keys(e).length === 0 ? null : e;
|
595
496
|
}
|
596
|
-
function
|
597
|
-
if (
|
497
|
+
function yt(i) {
|
498
|
+
if (D(i)) {
|
598
499
|
let e;
|
599
|
-
const t = Object.keys(
|
500
|
+
const t = Object.keys(D(i)).map((s) => ({
|
600
501
|
value: s,
|
601
502
|
point: s
|
602
503
|
}));
|
603
|
-
t.sort((s,
|
504
|
+
t.sort((s, a) => parseInt(a.value, 10) - parseInt(s.value, 10));
|
604
505
|
for (let s = 0; s < t.length; s += 1) {
|
605
|
-
const { point:
|
606
|
-
window.matchMedia(`(max-width: ${
|
506
|
+
const { point: a, value: n } = t[s];
|
507
|
+
window.matchMedia(`(max-width: ${n}px)`).matches && (e = a);
|
607
508
|
}
|
608
|
-
return e ? Number(
|
509
|
+
return e ? Number(D(i)[e]) : i.s.options.duration;
|
609
510
|
} else
|
610
|
-
return
|
511
|
+
return i.s.options.duration;
|
611
512
|
}
|
612
|
-
function
|
613
|
-
const { behavior: e, continual: t, gap: s } =
|
614
|
-
|
615
|
-
|
513
|
+
function re(i) {
|
514
|
+
const { behavior: e, continual: t, gap: s } = i.s.options, a = i.childNodes, n = document.createElement("div"), r = document.createElement("div");
|
515
|
+
n.className = "animate-container", r.className = "animate-item", [...a].forEach((p) => {
|
516
|
+
r.append(p);
|
616
517
|
});
|
617
518
|
function l() {
|
618
|
-
const
|
619
|
-
return
|
519
|
+
const p = r.cloneNode(!0);
|
520
|
+
return p.classList.add("clone"), i.s.cloneAnimation = null, i.s.cloneAnimateEl = p, p;
|
620
521
|
}
|
621
|
-
|
522
|
+
i.s.animation = null, i.s.animateEl = r, i.textContent = "", n.append(r), i.append(n), r.clientWidth * 2 + s >= i.clientWidth ? e === "normal" && t && n.append(l()) : i.s.options.continual = !1;
|
622
523
|
}
|
623
|
-
function
|
624
|
-
const { behavior: e, direction: t, continual: s } =
|
625
|
-
let
|
524
|
+
function v(i) {
|
525
|
+
const { behavior: e, direction: t, continual: s } = i.s.options;
|
526
|
+
let a = {};
|
626
527
|
switch (e) {
|
627
528
|
case "normal":
|
628
|
-
let
|
529
|
+
let n, r;
|
629
530
|
switch (t) {
|
630
531
|
case "top":
|
631
|
-
|
532
|
+
n = s ? "translate3d(0,100%,0)" : `translate3d(0,${i.clientHeight}px,0)`, r = "translate3d(0,-100%,0)", a.animate1 = [{ transform: n }, { transform: r }], s && (a.animate2 = [{ transform: "translate3d(0,0,0)" }, { transform: "translate3d(0,-200%,0)" }]);
|
632
533
|
break;
|
633
534
|
case "right":
|
634
|
-
|
535
|
+
n = s ? "translate3d(0,0,0)" : "translate3d(-100%,0,0)", r = s ? "translate3d(200%,0,0)" : `translate3d(${i.clientWidth}px,0,0)`, a.animate1 = [{ transform: n }, { transform: r }], s && (a.animate2 = [{ transform: "translate3d(-100%,0,0)" }, { transform: "translate3d(100%,0,0)" }]);
|
635
536
|
break;
|
636
537
|
case "bottom":
|
637
|
-
|
538
|
+
n = "translate3d(0,-100%,0)", r = s ? "translate3d(0,100%,0)" : `translate3d(0,${i.clientHeight}px,0)`, a.animate1 = [{ transform: n }, { transform: r }], s && (a.animate2 = [{ transform: "translate3d(0,-200%,0)" }, { transform: "translate3d(0,0,0)" }]);
|
638
539
|
break;
|
639
540
|
case "left":
|
640
|
-
|
541
|
+
n = s ? "translate3d(100%,0,0)" : `translate3d(${i.clientWidth}px,0,0)`, r = "translate3d(-100%,0,0)", a.animate1 = [{ transform: n }, { transform: r }], s && (a.animate2 = [{ transform: "translate3d(0,0,0)" }, { transform: "translate3d(-200%,0,0)" }]);
|
641
542
|
break;
|
642
543
|
}
|
643
544
|
break;
|
644
545
|
case "alternate":
|
645
546
|
switch (t) {
|
646
547
|
case "top":
|
647
|
-
|
548
|
+
a.animate1 = [{ transform: `translate3d(0,calc(${i.clientHeight}px - 100%),0)` }, { transform: "translate3d(0,0,0)" }, { transform: `translate3d(0,calc(${i.clientHeight}px - 100%),0)` }];
|
648
549
|
break;
|
649
550
|
case "right":
|
650
|
-
|
551
|
+
a.animate1 = [{ transform: "translate3d(0,0,0)" }, { transform: `translate3d(calc(-100% + ${i.clientWidth}px),0,0)` }, { transform: "translate3d(0,0,0)" }];
|
651
552
|
break;
|
652
553
|
case "bottom":
|
653
|
-
|
554
|
+
a.animate1 = [{ transform: "translate3d(0,0,0)" }, { transform: `translate3d(0,calc(${i.clientHeight}px - 100%),0)` }, { transform: "translate3d(0,0,0)" }];
|
654
555
|
break;
|
655
556
|
case "left":
|
656
|
-
|
557
|
+
a.animate1 = [{ transform: `translate3d(calc(-100% + ${i.clientWidth}px),0,0)` }, { transform: "translate3d(0,0,0)" }, { transform: `translate3d(calc(-100% + ${i.clientWidth}px),0,0)` }];
|
657
558
|
break;
|
658
559
|
}
|
659
560
|
break;
|
660
561
|
case "endStop":
|
661
562
|
switch (t) {
|
662
563
|
case "top":
|
663
|
-
|
564
|
+
a.animate1 = [{ transform: `translate3d(0,${i.clientHeight}px,0)` }, { transform: "translate3d(0,0,0)" }];
|
664
565
|
break;
|
665
566
|
case "right":
|
666
|
-
|
567
|
+
a.animate1 = [{ transform: "translate3d(-100%,0,0)" }, { transform: "translate3d(0,0,0)" }];
|
667
568
|
break;
|
668
569
|
case "bottom":
|
669
|
-
|
570
|
+
a.animate1 = [{ transform: "translate3d(0,-100%,0)" }, { transform: `translate3d(0,calc(${i.clientHeight}px - 100%),0)` }];
|
670
571
|
break;
|
671
572
|
case "left":
|
672
|
-
|
573
|
+
a.animate1 = [{ transform: `translate3d(${i.clientWidth}px,0,0)` }, { transform: `translate3d(calc(${i.clientWidth}px - 100%),0,0)` }];
|
673
574
|
break;
|
674
575
|
}
|
675
576
|
break;
|
676
577
|
}
|
677
|
-
return
|
578
|
+
return a;
|
678
579
|
}
|
679
|
-
function
|
580
|
+
function ne(i) {
|
680
581
|
let e;
|
681
582
|
return function(t) {
|
682
|
-
e && clearTimeout(e), e = setTimeout(
|
583
|
+
e && clearTimeout(e), e = setTimeout(i, 200, t);
|
683
584
|
};
|
684
585
|
}
|
685
|
-
var
|
686
|
-
class
|
586
|
+
var U, Ct, V, Mt, J, It, K, Ot;
|
587
|
+
class fe extends HTMLElement {
|
687
588
|
constructor() {
|
688
589
|
super();
|
689
|
-
|
690
|
-
|
691
|
-
|
692
|
-
|
590
|
+
d(this, U);
|
591
|
+
d(this, V);
|
592
|
+
d(this, J);
|
593
|
+
d(this, K);
|
693
594
|
this.initialize = !1;
|
694
595
|
}
|
695
596
|
static get observedAttributes() {
|
696
597
|
return [];
|
697
598
|
}
|
698
|
-
attributeChangedCallback(t, s,
|
599
|
+
attributeChangedCallback(t, s, a) {
|
699
600
|
}
|
700
601
|
connectedCallback() {
|
701
|
-
this.initialize || (this.initialize = !0, o(this,
|
602
|
+
this.initialize || (this.initialize = !0, o(this, U, Ct).call(this));
|
702
603
|
}
|
703
604
|
play() {
|
704
605
|
this.s.animation.play(), this.s.animateEl.classList.add("start"), this.s.options.continual && (this.s.cloneAnimation.play(), this.s.cloneAnimateEl.classList.add("start"));
|
@@ -707,76 +608,76 @@ class Fe extends HTMLElement {
|
|
707
608
|
this.s.animation.pause(), this.s.options.continual && this.s.cloneAnimation.pause();
|
708
609
|
}
|
709
610
|
}
|
710
|
-
|
611
|
+
U = new WeakSet(), Ct = function() {
|
711
612
|
const t = {
|
712
|
-
direction: this.getAttribute("direction") ||
|
613
|
+
direction: this.getAttribute("direction") || y.SETTINGS.direction,
|
713
614
|
// up / down / left / right
|
714
|
-
behavior: this.getAttribute("behavior") ||
|
615
|
+
behavior: this.getAttribute("behavior") || y.SETTINGS.behavior,
|
715
616
|
// normal / alternate / endStop
|
716
|
-
duration: Number(this.getAttribute("duration")) ||
|
617
|
+
duration: Number(this.getAttribute("duration")) || y.SETTINGS.duration,
|
717
618
|
// ms
|
718
|
-
durationBreakpoints:
|
719
|
-
autoplay: this.getAttribute("autoplay") ||
|
619
|
+
durationBreakpoints: D(this) || y.SETTINGS.durationBreakpoints,
|
620
|
+
autoplay: this.getAttribute("autoplay") || y.SETTINGS.autoplay,
|
720
621
|
// normal / alternate / endStop
|
721
|
-
pauseOnMouseenter: this.getAttribute("pauseOnMouseEnter") ? this.getAttribute("pauseOnMouseEnter") === "true" :
|
622
|
+
pauseOnMouseenter: this.getAttribute("pauseOnMouseEnter") ? this.getAttribute("pauseOnMouseEnter") === "true" : y.SETTINGS.pauseOnMouseenter,
|
722
623
|
// true / false
|
723
|
-
continual: this.getAttribute("continual") ? this.getAttribute("continual") === "true" :
|
624
|
+
continual: this.getAttribute("continual") ? this.getAttribute("continual") === "true" : y.SETTINGS.continual,
|
724
625
|
// true / false
|
725
|
-
gap: Number(this.getAttribute("gap")) ||
|
626
|
+
gap: Number(this.getAttribute("gap")) || y.SETTINGS.gap
|
726
627
|
};
|
727
|
-
this.s = {}, this.s.options = t, this.s.nowDuration =
|
728
|
-
},
|
729
|
-
const { direction: t, continual: s, gap:
|
628
|
+
this.s = {}, this.s.options = t, this.s.nowDuration = yt(this), re(this), o(this, V, Mt).call(this);
|
629
|
+
}, V = new WeakSet(), Mt = function() {
|
630
|
+
const { direction: t, continual: s, gap: a } = this.s.options;
|
730
631
|
switch (t) {
|
731
632
|
case "left":
|
732
633
|
case "right":
|
733
|
-
this.style.cssText = `--continual-gap: ${
|
634
|
+
this.style.cssText = `--continual-gap: ${a}px;`;
|
734
635
|
break;
|
735
636
|
case "top":
|
736
637
|
case "bottom":
|
737
|
-
s ? this.style.cssText = `height: ${this.s.animateEl.clientHeight}px;--continual-gap: ${
|
638
|
+
s ? this.style.cssText = `height: ${this.s.animateEl.clientHeight}px;--continual-gap: ${a}px;` : this.style.cssText = `min-height: ${this.s.animateEl.clientHeight}px;--continual-gap: ${a}px;`;
|
738
639
|
break;
|
739
640
|
}
|
740
|
-
o(this,
|
741
|
-
},
|
742
|
-
const t = this, { direction: s, behavior:
|
743
|
-
let
|
744
|
-
function
|
745
|
-
switch (
|
641
|
+
o(this, J, It).call(this), o(this, K, Ot).call(this), s && this.classList.add("continual"), this.classList.add("m4-initialize");
|
642
|
+
}, J = new WeakSet(), It = function() {
|
643
|
+
const t = this, { direction: s, behavior: a, duration: n, autoplay: r, pauseOnMouseenter: l, continual: p } = t.s.options;
|
644
|
+
let c;
|
645
|
+
function h() {
|
646
|
+
switch (a) {
|
746
647
|
case "normal":
|
747
|
-
t.s.animateEl.style.transform = `${
|
648
|
+
t.s.animateEl.style.transform = `${v(t).animate1[0].transform}`, t.s.animation = t.s.animateEl.animate(v(t).animate1, {
|
748
649
|
duration: t.s.nowDuration,
|
749
650
|
iterations: 1 / 0
|
750
|
-
}),
|
651
|
+
}), p && (t.s.cloneAnimateEl.style.transform = `${v(t).animate2[0].transform}`, t.s.cloneAnimation = t.s.cloneAnimateEl.animate(v(t).animate2, {
|
751
652
|
duration: t.s.nowDuration,
|
752
653
|
delay: -t.s.nowDuration / 2,
|
753
654
|
iterations: 1 / 0
|
754
655
|
}));
|
755
656
|
break;
|
756
657
|
case "alternate":
|
757
|
-
let
|
758
|
-
let
|
658
|
+
let b = function() {
|
659
|
+
let m = [];
|
759
660
|
switch (s) {
|
760
661
|
case "top":
|
761
|
-
|
662
|
+
u = Math.abs(t.s.animateEl.scrollHeight - t.clientHeight), f = parseInt(t.s.nowDuration / (u * 2)) * t.s.animateEl.scrollHeight, m = [{ transform: `translate3d(0,${t.clientHeight}px,0)` }, { transform: `translate3d(0,calc(${t.clientHeight}px - 100%),0)` }];
|
762
663
|
break;
|
763
664
|
case "right":
|
764
|
-
|
665
|
+
u = Math.abs(t.s.animateEl.scrollWidth - t.clientWidth), f = parseInt(t.s.nowDuration / (u * 2)) * t.s.animateEl.scrollWidth, m = [{ transform: "translate3d(-100%,0,0)" }, { transform: "translate3d(0,0,0)" }];
|
765
666
|
break;
|
766
667
|
case "bottom":
|
767
|
-
|
668
|
+
u = Math.abs(t.s.animateEl.scrollHeight - t.clientHeight), f = parseInt(n / (u * 2)) * t.s.animateEl.scrollHeight, m = [{ transform: "translate3d(0,-100%,0)" }, { transform: "translate3d(0,0,0)" }];
|
768
669
|
break;
|
769
670
|
case "left":
|
770
|
-
|
671
|
+
u = Math.abs(t.s.animateEl.scrollWidth - t.clientWidth), f = parseInt(n / (u * 2)) * t.s.animateEl.scrollWidth, m = [{ transform: `translate3d(${t.clientWidth}px,0,0)` }, { transform: `translate3d(calc(-100% + ${t.clientWidth}px),0,0)` }];
|
771
672
|
break;
|
772
673
|
}
|
773
|
-
return
|
774
|
-
},
|
775
|
-
(t.clientHeight > t.s.animateEl.scrollHeight || s === "left" || s === "right") && (t.s.animateEl.style.transform = `${
|
776
|
-
duration:
|
674
|
+
return m;
|
675
|
+
}, u, f;
|
676
|
+
(t.clientHeight > t.s.animateEl.scrollHeight || s === "left" || s === "right") && (t.s.animateEl.style.transform = `${b()[0].transform}`, t.s.animateEl.animate(b(), {
|
677
|
+
duration: f,
|
777
678
|
fill: "forwards"
|
778
679
|
}).finished.then(() => {
|
779
|
-
t.s.animation = t.s.animateEl.animate(
|
680
|
+
t.s.animation = t.s.animateEl.animate(v(t).animate1, {
|
780
681
|
duration: t.s.nowDuration,
|
781
682
|
iterations: 1 / 0
|
782
683
|
});
|
@@ -785,102 +686,102 @@ at = new WeakSet(), ee = function() {
|
|
785
686
|
});
|
786
687
|
break;
|
787
688
|
case "endStop":
|
788
|
-
t.s.animateEl.style.transform = `${
|
689
|
+
t.s.animateEl.style.transform = `${v(t).animate1[0].transform}`, t.s.animation = t.s.animateEl.animate(v(t).animate1, {
|
789
690
|
duration: t.s.nowDuration,
|
790
691
|
fill: "forwards"
|
791
692
|
});
|
792
693
|
break;
|
793
694
|
}
|
794
|
-
t.s.animateEl.classList.add("start"),
|
695
|
+
t.s.animateEl.classList.add("start"), r === !1 && (t.s.animateEl.classList.remove("start"), t.s.animation.cancel());
|
795
696
|
}
|
796
|
-
clearTimeout(
|
697
|
+
clearTimeout(c), c = setTimeout(
|
797
698
|
() => {
|
798
|
-
|
699
|
+
h();
|
799
700
|
},
|
800
|
-
|
701
|
+
r || 0
|
801
702
|
), t.addEventListener("mouseenter", function() {
|
802
703
|
t.s.animation && l && t.s.animation.playState === "running" && t.pause();
|
803
704
|
}), t.addEventListener("mouseleave", function() {
|
804
705
|
t.s.animation && l && t.s.animation.playState === "paused" && t.play();
|
805
706
|
});
|
806
|
-
},
|
707
|
+
}, K = new WeakSet(), Ot = function() {
|
807
708
|
const t = this;
|
808
709
|
function s() {
|
809
|
-
const
|
810
|
-
t.s.nowDuration =
|
710
|
+
const a = t.s.animation.startTime, n = t.s.cloneAnimation ? t.s.cloneAnimation.startTime : null;
|
711
|
+
t.s.nowDuration = yt(t), t.s.animation.cancel(), t.s.cloneAnimation && t.s.cloneAnimation.cancel(), t.s.animation = t.s.animateEl.animate(v(t).animate1, {
|
811
712
|
duration: t.s.nowDuration,
|
812
713
|
iterations: 1 / 0
|
813
|
-
}), t.s.animation.startTime =
|
714
|
+
}), t.s.animation.startTime = a, t.s.cloneAnimation && (t.s.cloneAnimation = t.s.cloneAnimateEl.animate(v(t).animate2, {
|
814
715
|
duration: t.s.nowDuration,
|
815
716
|
delay: -t.s.nowDuration / 2,
|
816
717
|
iterations: 1 / 0
|
817
|
-
}), t.s.cloneAnimation.startTime =
|
718
|
+
}), t.s.cloneAnimation.startTime = n);
|
818
719
|
}
|
819
|
-
window.addEventListener("resize",
|
720
|
+
window.addEventListener("resize", ne(s));
|
820
721
|
};
|
821
|
-
const
|
722
|
+
const j = function(i) {
|
822
723
|
let e;
|
823
724
|
return function(t) {
|
824
|
-
e && clearTimeout(e), e = setTimeout(
|
725
|
+
e && clearTimeout(e), e = setTimeout(i, 200, t);
|
825
726
|
};
|
826
|
-
},
|
827
|
-
if (
|
828
|
-
|
727
|
+
}, E = (i, e) => {
|
728
|
+
if (bt(i)) {
|
729
|
+
i.forEach((t) => {
|
829
730
|
t.classList.add(e);
|
830
731
|
});
|
831
732
|
return;
|
832
733
|
}
|
833
|
-
|
834
|
-
}, w = (
|
835
|
-
if (
|
836
|
-
|
734
|
+
i.classList.add(e);
|
735
|
+
}, w = (i, e) => {
|
736
|
+
if (bt(i)) {
|
737
|
+
i.forEach((t) => {
|
837
738
|
t.classList.remove(e);
|
838
739
|
});
|
839
740
|
return;
|
840
741
|
}
|
841
|
-
|
742
|
+
i.classList.remove(e);
|
842
743
|
};
|
843
|
-
var
|
844
|
-
class
|
744
|
+
var Y, Ht, Q, Dt, Z, Nt, C, ht, k, N, tt, _t;
|
745
|
+
class Et {
|
845
746
|
constructor(e) {
|
846
747
|
// 初始化
|
847
|
-
|
748
|
+
d(this, Y);
|
848
749
|
// 左右箭頭事件綁定
|
849
|
-
|
750
|
+
d(this, Q);
|
850
751
|
// 左右拖拉事件綁定
|
851
|
-
|
752
|
+
d(this, Z);
|
852
753
|
// 卷軸位置判斷
|
853
|
-
|
754
|
+
d(this, C);
|
854
755
|
// 隱藏按鈕判斷
|
855
|
-
|
756
|
+
d(this, k);
|
856
757
|
// 選項事件綁定
|
857
|
-
|
858
|
-
this.$element = e, this.option = e.s.option.drag, o(this,
|
758
|
+
d(this, tt);
|
759
|
+
this.$element = e, this.option = e.s.option.drag, o(this, Y, Ht).call(this);
|
859
760
|
}
|
860
761
|
// 更新 active 位置
|
861
762
|
update(e) {
|
862
763
|
const t = e.querySelector(".wrapper"), s = t == null ? void 0 : t.querySelector(".active");
|
863
764
|
if (s) {
|
864
|
-
const
|
765
|
+
const a = s.offsetLeft + s.getBoundingClientRect().width / 2 - t.getBoundingClientRect().width / 2;
|
865
766
|
t.scrollTo({
|
866
|
-
left:
|
767
|
+
left: a,
|
867
768
|
behavior: "smooth"
|
868
769
|
});
|
869
770
|
}
|
870
771
|
}
|
871
772
|
}
|
872
|
-
|
873
|
-
var s,
|
773
|
+
Y = new WeakSet(), Ht = function() {
|
774
|
+
var s, a, n, r, l, p;
|
874
775
|
const e = this;
|
875
776
|
if (!e.$element)
|
876
777
|
return;
|
877
|
-
e.$container = e.$element.querySelector(".drag-container"), e.$wrapper = e.$container.querySelector(".wrapper");
|
778
|
+
e.$container = e.$element.querySelector(".drag-container:not[data-dragControl-active]"), e.$wrapper = e.$container.querySelector(".wrapper"), e.$container.setAttribute("data-dragControl-active", "");
|
878
779
|
const t = () => {
|
879
|
-
var
|
880
|
-
o(
|
780
|
+
var c, h;
|
781
|
+
o(c = e, C, ht).call(c), o(h = e, k, N).call(h);
|
881
782
|
};
|
882
|
-
e.$wrapper.removeEventListener("scroll", t), e.$wrapper.addEventListener("scroll", t), window.removeEventListener("resize",
|
883
|
-
|
783
|
+
e.$wrapper.removeEventListener("scroll", t), e.$wrapper.addEventListener("scroll", t), window.removeEventListener("resize", j(t)), window.addEventListener("resize", j(t)), (e.option.draggable || e.$element.s.type == "collapse") && o(s = e, Z, Nt).call(s), e.option.navigation && e.$element.s.type !== "collapse" && (e.$container.insertAdjacentHTML(
|
784
|
+
A.prepend,
|
884
785
|
`<div class="navigation">
|
885
786
|
<div class="button prev">
|
886
787
|
<div></div>
|
@@ -889,284 +790,234 @@ lt = new WeakSet(), re = function() {
|
|
889
790
|
<div></div>
|
890
791
|
</div>
|
891
792
|
</div>`
|
892
|
-
), e.$button = (
|
893
|
-
},
|
894
|
-
const e = this, { $wrapper: t, $button: s } = e,
|
895
|
-
const
|
793
|
+
), e.$button = (a = e.$container) == null ? void 0 : a.querySelectorAll(".button"), o(n = e, Q, Dt).call(n)), o(r = e, C, ht).call(r), o(l = e, k, N).call(l), o(p = e, tt, _t).call(p);
|
794
|
+
}, Q = new WeakSet(), Dt = function() {
|
795
|
+
const e = this, { $wrapper: t, $button: s } = e, a = function() {
|
796
|
+
const n = this.classList.contains("next"), r = parseInt(t.getBoundingClientRect().width * 0.7);
|
896
797
|
t.scrollTo({
|
897
|
-
left:
|
798
|
+
left: n ? t.scrollLeft + r : t.scrollLeft - r,
|
898
799
|
behavior: "smooth"
|
899
800
|
}), setTimeout(() => {
|
900
801
|
var l;
|
901
|
-
o(l = e, k,
|
802
|
+
o(l = e, k, N).call(l);
|
902
803
|
}, 100);
|
903
804
|
};
|
904
|
-
s.forEach((
|
905
|
-
|
805
|
+
s.forEach((n) => {
|
806
|
+
n.removeEventListener("click", a), n.addEventListener("click", a);
|
906
807
|
});
|
907
|
-
},
|
808
|
+
}, Z = new WeakSet(), Nt = function() {
|
908
809
|
const { $wrapper: e } = this;
|
909
|
-
let t = !1, s = !1,
|
910
|
-
const
|
911
|
-
|
810
|
+
let t = !1, s = !1, a = 0, n = 0;
|
811
|
+
const r = function(u) {
|
812
|
+
u.preventDefault(), s = !1, t = !0, a = u.pageX - e.offsetLeft, n = e.scrollLeft;
|
912
813
|
};
|
913
|
-
e.removeEventListener("mousedown",
|
814
|
+
e.removeEventListener("mousedown", r), e.addEventListener("mousedown", r);
|
914
815
|
const l = function() {
|
915
816
|
s = !1, t = !1;
|
916
817
|
};
|
917
818
|
e.removeEventListener("mouseleave", l), e.addEventListener("mouseleave", l);
|
918
|
-
const
|
919
|
-
|
819
|
+
const p = function(u) {
|
820
|
+
u.preventDefault(), t = !1;
|
920
821
|
};
|
921
|
-
e.removeEventListener("mouseup",
|
922
|
-
const
|
923
|
-
if (
|
822
|
+
e.removeEventListener("mouseup", p), e.addEventListener("mouseup", p);
|
823
|
+
const c = function(u) {
|
824
|
+
if (u.preventDefault(), s = !0, !t)
|
924
825
|
return;
|
925
|
-
const
|
826
|
+
const b = u.pageX - e.offsetLeft - a;
|
926
827
|
e.scrollTo({
|
927
|
-
left:
|
828
|
+
left: n - b
|
928
829
|
});
|
929
830
|
};
|
930
|
-
e.removeEventListener("mousemove",
|
931
|
-
const
|
932
|
-
s && (
|
831
|
+
e.removeEventListener("mousemove", c), e.addEventListener("mousemove", c);
|
832
|
+
const h = function(u) {
|
833
|
+
s && (u.preventDefault(), u.stopPropagation());
|
933
834
|
};
|
934
|
-
e.querySelectorAll("a").forEach((
|
935
|
-
|
835
|
+
e.querySelectorAll("a").forEach((u) => {
|
836
|
+
u.removeEventListener("click", h), u.addEventListener("click", h);
|
936
837
|
});
|
937
|
-
},
|
938
|
-
const { $container: e, $wrapper: t } = this, s = t.scrollWidth - t.clientWidth,
|
939
|
-
s <= 0 || (
|
940
|
-
}, k = new WeakSet(),
|
838
|
+
}, C = new WeakSet(), ht = function() {
|
839
|
+
const { $container: e, $wrapper: t } = this, s = t.scrollWidth - t.clientWidth, a = t.scrollLeft;
|
840
|
+
s <= 0 || (E(e, "scrollable"), a == 0 ? (w(e, "scrollable"), E(t, "start"), w(t, "end")) : a >= s ? (w(e, "scrollable"), w(t, "start"), E(t, "end")) : (E(t, "center"), w(t, "start"), w(t, "end")));
|
841
|
+
}, k = new WeakSet(), N = function() {
|
941
842
|
const { $wrapper: e, $button: t, $element: s } = this;
|
942
843
|
if (!t)
|
943
844
|
return;
|
944
|
-
const
|
945
|
-
if (
|
946
|
-
|
845
|
+
const a = e.scrollWidth - e.clientWidth, n = e.scrollLeft;
|
846
|
+
if (a <= 0) {
|
847
|
+
E(t, "hide"), E(s, "noScrollable");
|
947
848
|
return;
|
948
849
|
}
|
949
|
-
|
950
|
-
if (
|
951
|
-
w(
|
850
|
+
n == 0 ? t.forEach((r) => {
|
851
|
+
if (r.classList.contains("next")) {
|
852
|
+
w(r, "hide");
|
952
853
|
return;
|
953
854
|
}
|
954
|
-
|
955
|
-
}) :
|
956
|
-
if (
|
957
|
-
|
855
|
+
E(r, "hide");
|
856
|
+
}) : n >= a ? t.forEach((r) => {
|
857
|
+
if (r.classList.contains("next")) {
|
858
|
+
E(r, "hide");
|
958
859
|
return;
|
959
860
|
}
|
960
|
-
w(
|
861
|
+
w(r, "hide");
|
961
862
|
}) : w(t, "hide");
|
962
|
-
},
|
963
|
-
const { $element: e } = this, t = (
|
863
|
+
}, tt = new WeakSet(), _t = function() {
|
864
|
+
const { $element: e } = this, t = (a) => {
|
964
865
|
if (this.option.selected) {
|
965
|
-
const
|
966
|
-
e.setAttribute("m4-status",
|
866
|
+
const n = a.getAttribute("data-option").trim();
|
867
|
+
e.setAttribute("m4-status", n);
|
967
868
|
}
|
968
869
|
};
|
969
870
|
function s() {
|
970
871
|
t(this);
|
971
872
|
}
|
972
|
-
this.$container.querySelectorAll(".item").forEach((
|
973
|
-
|
873
|
+
this.$container.querySelectorAll(".item").forEach((a) => {
|
874
|
+
a.removeEventListener("click", s), a.addEventListener("click", s);
|
974
875
|
});
|
975
876
|
};
|
976
|
-
var
|
977
|
-
class
|
877
|
+
var et, jt, st, Bt, it, Xt, at, Rt;
|
878
|
+
class oe {
|
978
879
|
constructor(e) {
|
979
880
|
// 初始化
|
980
|
-
|
881
|
+
d(this, et);
|
981
882
|
// 隱藏按鈕判斷
|
982
|
-
|
883
|
+
d(this, st);
|
983
884
|
// 展開箭頭事件綁定
|
984
|
-
|
885
|
+
d(this, it);
|
985
886
|
// 選項事件綁定
|
986
|
-
|
987
|
-
this.$element = e, this.option = e.s.option.collapse, o(this,
|
887
|
+
d(this, at);
|
888
|
+
this.$element = e, this.option = e.s.option.collapse, o(this, et, jt).call(this);
|
988
889
|
}
|
989
890
|
}
|
990
|
-
|
991
|
-
this.$element && (this.$container = this.$element.querySelector(".collapse-container"), this.$wrapper = this.$container.querySelector(".wrapper"), o(this,
|
992
|
-
},
|
891
|
+
et = new WeakSet(), jt = function() {
|
892
|
+
this.$element && (this.$container = this.$element.querySelector(".collapse-container"), this.$wrapper = this.$container.querySelector(".wrapper"), o(this, st, Bt).call(this) && o(this, it, Xt).call(this), o(this, at, Rt).call(this));
|
893
|
+
}, st = new WeakSet(), Bt = function() {
|
993
894
|
const e = this.$element.querySelector(".drag-container"), t = e.querySelector(".wrapper");
|
994
|
-
return t.scrollWidth - t.clientWidth > 0 ? (e.insertAdjacentHTML(
|
995
|
-
},
|
895
|
+
return t.scrollWidth - t.clientWidth > 0 ? (e.insertAdjacentHTML(A.append, '<div class="open-collapse"></div>'), this.$button = e.querySelector(".open-collapse"), !0) : !1;
|
896
|
+
}, it = new WeakSet(), Xt = function() {
|
996
897
|
const { $element: e, $button: t } = this, s = function() {
|
997
898
|
e.classList.contains("expand") ? e.classList.remove("expand") : e.classList.add("expand");
|
998
899
|
};
|
999
900
|
t.removeEventListener("click", s), t.addEventListener("click", s);
|
1000
|
-
},
|
1001
|
-
const { $element: e } = this, t = (
|
901
|
+
}, at = new WeakSet(), Rt = function() {
|
902
|
+
const { $element: e } = this, t = (a, n) => {
|
1002
903
|
if (e != null && e.classList.contains("expand") ? e == null || e.classList.remove("expand") : e == null || e.classList.add("expand"), this.option.selected) {
|
1003
|
-
const
|
1004
|
-
e.setAttribute("m4-status",
|
904
|
+
const r = a.getAttribute("data-option").trim();
|
905
|
+
e.setAttribute("m4-status", r);
|
1005
906
|
}
|
1006
907
|
};
|
1007
908
|
function s() {
|
1008
909
|
t(this);
|
1009
910
|
}
|
1010
|
-
this.$container.querySelectorAll(".item").forEach((
|
1011
|
-
|
911
|
+
this.$container.querySelectorAll(".item").forEach((a) => {
|
912
|
+
a.removeEventListener("click", s), a.addEventListener("click", s);
|
1012
913
|
});
|
1013
914
|
};
|
1014
|
-
const
|
1015
|
-
const { type: e, option: t, originalDomString: s } =
|
1016
|
-
return e == "drag" && (
|
915
|
+
const le = (i) => {
|
916
|
+
const { type: e, option: t, originalDomString: s } = i.s, a = document.createElement("div");
|
917
|
+
return e == "drag" && (a.innerHTML = $.TEMPLATE[e]().trim(), a.querySelector(".drag-container .wrapper").insertAdjacentHTML(A.append, s)), e == "collapse" && (a.innerHTML = $.TEMPLATE[e](t == null ? void 0 : t.collapse).trim(), a.querySelector(".drag-container .wrapper").insertAdjacentHTML(A.append, s), a.querySelector(".collapse-container .wrapper").insertAdjacentHTML(A.append, s)), e == "dropdown" && (a.innerHTML = $.TEMPLATE[e](t == null ? void 0 : t.dropdown).trim(), a.querySelector("dropdown-el").insertAdjacentHTML(A.append, s)), a.children;
|
1017
918
|
};
|
1018
|
-
var
|
1019
|
-
class
|
919
|
+
var rt, Gt, nt, Pt, M, ft, T, _;
|
920
|
+
class be extends HTMLElement {
|
1020
921
|
constructor() {
|
1021
922
|
super();
|
1022
|
-
|
1023
|
-
|
923
|
+
d(this, rt);
|
924
|
+
d(this, nt);
|
1024
925
|
// 斷點設定
|
1025
|
-
|
926
|
+
d(this, M);
|
1026
927
|
// check type
|
1027
|
-
|
928
|
+
d(this, T);
|
1028
929
|
this.initialize = !1, this.__events__ = {}, this.s = {}, this.s.originalDomString = this.innerHTML.trim().replace(/\n/g, ""), this.previousWidth = window.innerWidth;
|
1029
930
|
}
|
1030
931
|
static get observedAttributes() {
|
1031
932
|
return ["m4-type", "m4-status"];
|
1032
933
|
}
|
1033
|
-
attributeChangedCallback(t, s,
|
1034
|
-
var
|
934
|
+
attributeChangedCallback(t, s, a) {
|
935
|
+
var n, r, l;
|
1035
936
|
switch (t) {
|
1036
937
|
case "m4-type":
|
1037
|
-
if (s === null || s ===
|
938
|
+
if (s === null || s === a)
|
1038
939
|
return;
|
1039
|
-
this.s.type =
|
940
|
+
this.s.type = a, o(this, T, _).call(this);
|
1040
941
|
break;
|
1041
942
|
case "m4-status":
|
1042
|
-
if (s ===
|
943
|
+
if (s === a)
|
1043
944
|
return;
|
1044
|
-
const
|
1045
|
-
if (
|
945
|
+
const p = this.getAttribute("m4-type");
|
946
|
+
if (p !== "drag" && p !== "collapse")
|
1046
947
|
return;
|
1047
|
-
this.querySelectorAll(".drag-container .item").forEach((
|
1048
|
-
|
1049
|
-
}), (
|
1050
|
-
|
1051
|
-
}), (
|
948
|
+
this.querySelectorAll(".drag-container .item").forEach((c) => {
|
949
|
+
c.classList.remove("active");
|
950
|
+
}), (n = this.querySelector(`.drag-container .item[data-option="${a}"]`)) == null || n.classList.add("active"), p === "collapse" && (this.querySelectorAll(".collapse-container .item").forEach((c) => {
|
951
|
+
c.classList.remove("active");
|
952
|
+
}), (r = this.querySelector(`.collapse-container .item[data-option="${a}"]`)) == null || r.classList.add("active")), (l = this.constructor.drag) == null || l.update(this);
|
1052
953
|
break;
|
1053
954
|
}
|
1054
955
|
}
|
1055
956
|
connectedCallback() {
|
1056
|
-
this.initialize || this.classList.contains("m4-init") || (this.initialize = !0, o(this,
|
957
|
+
this.initialize || this.classList.contains("m4-init") || (this.initialize = !0, o(this, rt, Gt).call(this));
|
1057
958
|
}
|
1058
959
|
update() {
|
1059
|
-
o(this,
|
960
|
+
o(this, M, ft).call(this);
|
1060
961
|
}
|
1061
962
|
}
|
1062
|
-
|
963
|
+
rt = new WeakSet(), Gt = function() {
|
1063
964
|
let t = {};
|
1064
|
-
this.hasAttribute("m4-value") || this.setAttribute("m4-value", ""), this.s.type = this.getAttribute("m4-type") ??
|
1065
|
-
const s = (
|
1066
|
-
if (
|
965
|
+
this.hasAttribute("m4-value") || this.setAttribute("m4-value", ""), this.s.type = this.getAttribute("m4-type") ?? $.SETTINGS.type, this.hasAttribute("m4-option") && (t = this.getAttribute("m4-option") ? JSON.parse(this.getAttribute("m4-option")) : {}, this.removeAttribute("m4-option"));
|
966
|
+
const s = (a) => {
|
967
|
+
if (a.type === "resize") {
|
1067
968
|
if (window.innerWidth === this.previousWidth)
|
1068
969
|
return;
|
1069
970
|
this.previousWidth = window.innerWidth;
|
1070
971
|
}
|
1071
972
|
this.update();
|
1072
973
|
};
|
1073
|
-
window.removeEventListener("resize",
|
1074
|
-
},
|
1075
|
-
this.classList.add("m4-init"), o(this,
|
1076
|
-
},
|
974
|
+
window.removeEventListener("resize", j(s)), window.addEventListener("resize", j(s)), this.s.option = {}, this.s.option.drag = Object.assign({}, $.SETTINGS.drag, t == null ? void 0 : t.drag), this.s.option.collapse = Object.assign({}, $.SETTINGS.collapse, t == null ? void 0 : t.collapse), this.s.option.dropdown = Object.assign({}, $.SETTINGS.dropdown, t == null ? void 0 : t.dropdown), this.s.option.breakpoint = Object.assign({}, $.SETTINGS.breakpoint, t == null ? void 0 : t.breakpoint), o(this, nt, Pt).call(this);
|
975
|
+
}, nt = new WeakSet(), Pt = function() {
|
976
|
+
this.classList.add("m4-init"), o(this, M, ft).call(this);
|
977
|
+
}, M = new WeakSet(), ft = function() {
|
1077
978
|
const t = Object.keys(this.s.option.breakpoint);
|
1078
979
|
if (!t.length) {
|
1079
|
-
o(this,
|
980
|
+
o(this, T, _).call(this);
|
1080
981
|
return;
|
1081
982
|
}
|
1082
|
-
t.map((s) => Number(s)).sort((s,
|
1083
|
-
var
|
1084
|
-
return window.innerWidth >= s && (this.s.type = (
|
983
|
+
t.map((s) => Number(s)).sort((s, a) => a - s).some((s) => {
|
984
|
+
var a, n, r, l;
|
985
|
+
return window.innerWidth >= s && (this.s.type = (a = this.s.option.breakpoint[s]) == null ? void 0 : a.type, this.setAttribute("m4-type", this.s.type), this.s.option.drag = Object.assign({}, this.s.option.drag, (n = this.s.option.breakpoint[s]) == null ? void 0 : n.drag), this.s.option.collapse = Object.assign({}, this.s.option.collapse, (r = this.s.option.breakpoint[s]) == null ? void 0 : r.collapse), this.s.option.dropdown = Object.assign({}, this.s.option.dropdown, (l = this.s.option.breakpoint[s]) == null ? void 0 : l.dropdown)), o(this, T, _).call(this), window.innerWidth >= s;
|
1085
986
|
});
|
1086
|
-
},
|
1087
|
-
var
|
987
|
+
}, T = new WeakSet(), _ = function() {
|
988
|
+
var n;
|
1088
989
|
const { type: t } = this.s;
|
1089
|
-
this.innerHTML = "", [...
|
1090
|
-
this.append(
|
990
|
+
this.innerHTML = "", [...le(this)].forEach((r) => {
|
991
|
+
this.append(r);
|
1091
992
|
});
|
1092
|
-
const s = this.querySelector(`.drag-container .item[data-option="${this.getAttribute("m4-status")}"]`),
|
1093
|
-
switch (s == null || s.classList.add("active"),
|
993
|
+
const s = this.querySelector(`.drag-container .item[data-option="${this.getAttribute("m4-status")}"]`), a = this.querySelector(`.collapse-container .item[data-option="${this.getAttribute("m4-status")}"]`);
|
994
|
+
switch (s == null || s.classList.add("active"), a == null || a.classList.add("active"), t) {
|
1094
995
|
case "drag":
|
1095
|
-
this.constructor.drag = new
|
996
|
+
this.constructor.drag = new Et(this);
|
1096
997
|
break;
|
1097
998
|
case "collapse":
|
1098
|
-
this.constructor.drag = new
|
999
|
+
this.constructor.drag = new Et(this), this.constructor.collapse = new oe(this);
|
1099
1000
|
break;
|
1100
1001
|
}
|
1101
|
-
(
|
1102
|
-
};
|
1103
|
-
const Xt = (a) => {
|
1104
|
-
const { defaultOptions: e } = a.collapse, { collapseClass: t, target: s, transition: i } = e, r = a.querySelector(s);
|
1105
|
-
a.classList.add(t), r.style.height = 0, r.style["transition-property"] = i.property, r.style["transition-duration"] = i.duration, r.style["transition-timing-function"] = i.function, r.style["transition-delay"] = i.delay, r.style.overflow = "hidden";
|
1106
|
-
}, Re = (a) => {
|
1107
|
-
const { defaultOptions: e } = a.collapse, { collapseClass: t, target: s, transition: i } = e, r = a.querySelector(s), n = r.children[0].offsetHeight;
|
1108
|
-
a.collapse.height = n, a.classList.remove(t), r.style.display = "block", r.style.height = `${n}px`, r.style["transition-property"] = i.property, r.style["transition-duration"] = i.duration, r.style["transition-timing-function"] = i.function, r.style["transition-delay"] = i.delay, r.style.overflow = "hidden";
|
1109
|
-
};
|
1110
|
-
var O, Mt, bt, fe, yt, ve, N, Ht;
|
1111
|
-
class Je extends Pt {
|
1112
|
-
constructor(t, s = {}) {
|
1113
|
-
super();
|
1114
|
-
h(this, O);
|
1115
|
-
h(this, bt);
|
1116
|
-
h(this, yt);
|
1117
|
-
h(this, N);
|
1118
|
-
!(!wt(t) && !Gt(t) && !j(t) && !U(t)) && (this.__storage__ = {
|
1119
|
-
el: t,
|
1120
|
-
options: s
|
1121
|
-
}, o(this, O, Mt).call(this));
|
1122
|
-
}
|
1123
|
-
update() {
|
1124
|
-
o(this, O, Mt).call(this);
|
1125
|
-
}
|
1126
|
-
}
|
1127
|
-
O = new WeakSet(), Mt = function() {
|
1128
|
-
const { el: t, options: s } = this.__storage__, { SETTINGS: i, EVENTS: r } = ke;
|
1129
|
-
if (this.elements = Et(t), this.options = Object.assign({}, i, s), this.__events__ = Object.assign({}, r), this.options.on)
|
1130
|
-
for (const [n, l] of Object.entries(this.options.on))
|
1131
|
-
this.__events__[n] = [l];
|
1132
|
-
o(this, bt, fe).call(this);
|
1133
|
-
}, bt = new WeakSet(), fe = function() {
|
1134
|
-
const { elements: t, options: s } = this;
|
1135
|
-
t.forEach((i) => {
|
1136
|
-
i.collapse = {}, i.collapse.instance = this, i.collapse.defaultOptions = s, i.collapse.methods = {}, i.collapse.methods.update = this.update, o(this, yt, ve).call(this, i);
|
1137
|
-
}), this.emit("init");
|
1138
|
-
}, yt = new WeakSet(), ve = function(t) {
|
1139
|
-
const { options: s } = this, { collapseClass: i, block: r, target: n, defaultOpen: l, targetStopPropagation: u, defaultActiveMark: p } = s, d = t, c = d.querySelector(n);
|
1140
|
-
if (d.collapse.height = c.children[0].offsetHeight, l ? (c.style.height = `${c.children[0].offsetHeight}px`, d.classList.remove(i)) : !d.classList.contains(p) && !d.hasAttribute(p) ? (d.classList.add(i), c.style.height = "0px", c.style.overflow = "hidden") : (c.style.height = `${c.children[0].offsetHeight}px`, d.classList.remove(i)), d.removeEventListener("click", o(this, N, Ht)), d.addEventListener("click", o(this, N, Ht)), u) {
|
1141
|
-
const m = (f) => {
|
1142
|
-
f.stopPropagation();
|
1143
|
-
};
|
1144
|
-
c.removeEventListener("click", m), c.addEventListener("click", m);
|
1145
|
-
}
|
1146
|
-
}, N = new WeakSet(), Ht = function() {
|
1147
|
-
const { instance: t, defaultOptions: s } = this.collapse, { collapseClass: i, block: r, target: n, single: l } = s, u = this;
|
1148
|
-
u.classList.contains(i) ? (l && u.parentNode.querySelectorAll(`.${u.classList[0]}`).forEach((p) => {
|
1149
|
-
Xt(p);
|
1150
|
-
}), Re(u)) : Xt(u), t.emit("afterCollapse");
|
1002
|
+
(n = this.constructor.drag) == null || n.update(this);
|
1151
1003
|
};
|
1152
1004
|
export {
|
1153
|
-
|
1154
|
-
|
1155
|
-
|
1156
|
-
|
1157
|
-
|
1158
|
-
|
1159
|
-
|
1160
|
-
|
1161
|
-
|
1162
|
-
|
1163
|
-
|
1164
|
-
|
1165
|
-
|
1166
|
-
|
1167
|
-
|
1168
|
-
|
1169
|
-
|
1170
|
-
He as Video4
|
1005
|
+
we as Anchor4,
|
1006
|
+
ye as Aost4,
|
1007
|
+
pe as Article4,
|
1008
|
+
me as CategorySlider,
|
1009
|
+
Ee as Collapse4,
|
1010
|
+
$e as Configs,
|
1011
|
+
ue as Detect4,
|
1012
|
+
Le as Dropdown4,
|
1013
|
+
Ae as ImagePreview,
|
1014
|
+
Se as ImageValidate,
|
1015
|
+
fe as Marquee4,
|
1016
|
+
xe as Modal4,
|
1017
|
+
be as Multipurpose4,
|
1018
|
+
ke as Ripple4,
|
1019
|
+
he as Share4,
|
1020
|
+
Te as Tab4,
|
1021
|
+
Ut as Video4
|
1171
1022
|
};
|
1172
1023
|
//# sourceMappingURL=fesd-bundle.js.map
|