@xwadex/fesd 0.0.21 → 0.0.23
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/image-preview-bundle.js +366 -361
- package/dist/image-preview-bundle.js.map +1 -1
- package/dist/tools-bundle.js +49 -47
- package/dist/tools-bundle.js.map +1 -1
- package/package.json +1 -1
@@ -9,7 +9,7 @@ var h = (n, i, t) => {
|
|
9
9
|
};
|
10
10
|
var d = (n, i, t) => (fs(n, i, "access private method"), t);
|
11
11
|
import { OverlayScrollbars as Me } from "overlayscrollbars";
|
12
|
-
import
|
12
|
+
import f from "jquery";
|
13
13
|
import "./vendor-bundle.js";
|
14
14
|
import "validator";
|
15
15
|
import "flatpickr";
|
@@ -20,6 +20,7 @@ const Y = {
|
|
20
20
|
videoId: null,
|
21
21
|
videoType: null,
|
22
22
|
videoAutoplay: "off",
|
23
|
+
videoKeep: "off",
|
23
24
|
videoMode: "onBox",
|
24
25
|
videoButton: ".playButton",
|
25
26
|
videoCover: "on",
|
@@ -88,7 +89,7 @@ const Y = {
|
|
88
89
|
</div>
|
89
90
|
`;
|
90
91
|
}
|
91
|
-
},
|
92
|
+
}, x = {
|
92
93
|
SETTINGS: {
|
93
94
|
direction: "left",
|
94
95
|
// 方向 - top || right || bottom || left
|
@@ -162,7 +163,7 @@ const Y = {
|
|
162
163
|
enter: null,
|
163
164
|
leave: null
|
164
165
|
}
|
165
|
-
},
|
166
|
+
}, ct = {
|
166
167
|
SETTINGS: {
|
167
168
|
target: null,
|
168
169
|
container: null,
|
@@ -180,7 +181,7 @@ const Y = {
|
|
180
181
|
beforeScroll: null,
|
181
182
|
afterScroll: null
|
182
183
|
}
|
183
|
-
},
|
184
|
+
}, H = {
|
184
185
|
SETTINGS: {
|
185
186
|
type: "drag",
|
186
187
|
drag: {
|
@@ -292,24 +293,24 @@ const Y = {
|
|
292
293
|
}
|
293
294
|
}, mn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
294
295
|
__proto__: null,
|
295
|
-
anchor4:
|
296
|
+
anchor4: ct,
|
296
297
|
aost4: Ye,
|
297
298
|
article4: ws,
|
298
299
|
collapse4: Je,
|
299
300
|
dropdown4: qe,
|
300
|
-
marquee4:
|
301
|
+
marquee4: x,
|
301
302
|
modal4: I,
|
302
|
-
multipurpose4:
|
303
|
+
multipurpose4: H,
|
303
304
|
ripple4: Ze,
|
304
305
|
share4: ys,
|
305
306
|
tab4: Ue,
|
306
307
|
video4: Y
|
307
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
308
|
+
}, Symbol.toStringTag, { value: "Module" })), A = {
|
308
309
|
before: "beforebegin",
|
309
310
|
after: "afterend",
|
310
311
|
append: "beforeend",
|
311
312
|
prepend: "afterbegin"
|
312
|
-
}, at = (n) => typeof n == "string" && n !== "",
|
313
|
+
}, at = (n) => typeof n == "string" && n !== "", we = (n) => n instanceof HTMLElement, rt = (n) => n instanceof NodeList, w = (n) => L(n) !== null, j = (n) => typeof n == "function", L = (n) => we(n) ? n : document.querySelector(n), S = (n) => rt(n) ? n : document.querySelectorAll(n), Ts = () => Math.random().toString(36).substr(2, 9), Es = (n) => {
|
313
314
|
const i = document.createElement("div");
|
314
315
|
return i.innerHTML = n, i.childNodes;
|
315
316
|
}, As = (n) => {
|
@@ -319,7 +320,7 @@ const Y = {
|
|
319
320
|
return n;
|
320
321
|
}
|
321
322
|
return JSON.parse(n);
|
322
|
-
},
|
323
|
+
}, E = (n, i) => {
|
323
324
|
console.warn(`[${n} warn]: ${i}`);
|
324
325
|
}, je = (n, i) => {
|
325
326
|
console.error(`[${n} error]: ${i}`);
|
@@ -364,29 +365,29 @@ const Y = {
|
|
364
365
|
easeOutQuart(n, i, t, e) {
|
365
366
|
return -t * ((n = n / e - 1) * n * n * n - 1) + i;
|
366
367
|
}
|
367
|
-
},
|
368
|
-
const { target: t, container: e, spacer: s, speed: o, gap: a, easing: r, direction: l } = n, c = l === "horizontal", u = c ? "scrollLeft" : "scrollTop", p = c ? "left" : "top",
|
369
|
-
let
|
370
|
-
if (
|
368
|
+
}, Te = (n, i) => {
|
369
|
+
const { target: t, container: e, spacer: s, speed: o, gap: a, easing: r, direction: l } = n, c = l === "horizontal", u = c ? "scrollLeft" : "scrollTop", p = c ? "left" : "top", v = c ? "width" : "height", g = w(e) ? L(e) : document.scrollingElement, m = g[u], y = w(t) ? L(t).getBoundingClientRect()[p] : 0 - m, b = w(s) ? L(s).getBoundingClientRect()[v] : 0, T = y - a - b, G = 15;
|
370
|
+
let D = 0;
|
371
|
+
if (T === 0)
|
371
372
|
return;
|
372
373
|
const R = (X) => {
|
373
|
-
const Pe =
|
374
|
+
const Pe = L(t);
|
374
375
|
i && i.emit(X, Pe), !i && n.on && j(n.on[X]) && n.on[X](Pe);
|
375
376
|
};
|
376
377
|
R("beforeScroll");
|
377
378
|
const Ne = () => {
|
378
|
-
|
379
|
-
const X = Ls[r](
|
380
|
-
|
379
|
+
D += G;
|
380
|
+
const X = Ls[r](D, m, T, o);
|
381
|
+
g[u] = X, D < o && requestAnimationFrame(Ne), D >= o && R("afterScroll");
|
381
382
|
};
|
382
383
|
requestAnimationFrame(Ne);
|
383
384
|
};
|
384
|
-
var J, Ee,
|
385
|
+
var J, Ee, mt, Ve, gt, Ke;
|
385
386
|
class Qe {
|
386
387
|
constructor(i, t = {}) {
|
387
388
|
h(this, J);
|
388
|
-
h(this, pt);
|
389
389
|
h(this, mt);
|
390
|
+
h(this, gt);
|
390
391
|
this.__storage__ = {
|
391
392
|
el: i,
|
392
393
|
options: t
|
@@ -403,18 +404,18 @@ class Qe {
|
|
403
404
|
return d(i = this.destroy(), J, Ee).call(i), this.emit("afterUpdate"), this;
|
404
405
|
}
|
405
406
|
static run(i) {
|
406
|
-
const { SETTINGS: t } =
|
407
|
+
const { SETTINGS: t } = ct, e = Object.assign({}, t, i);
|
407
408
|
setTimeout(() => {
|
408
|
-
|
409
|
+
Te(e);
|
409
410
|
}, e.delay);
|
410
411
|
}
|
411
412
|
static url(i) {
|
412
|
-
const { SETTINGS: t } =
|
413
|
+
const { SETTINGS: t } = ct, { hashName: e } = i, s = window.location.search || window.location.hash, { searchParams: o } = new URL(window.location), a = document.querySelector(`[data-anchor-id="${e ? o.get(e) : s.split("?").pop()}"]`);
|
413
414
|
if (!a)
|
414
415
|
return;
|
415
416
|
const r = Object.assign({}, t, i, { target: a });
|
416
417
|
setTimeout(() => {
|
417
|
-
|
418
|
+
Te(r);
|
418
419
|
}, r.delay);
|
419
420
|
}
|
420
421
|
}
|
@@ -422,17 +423,17 @@ J = new WeakSet(), Ee = function() {
|
|
422
423
|
const { el: i, options: t } = this.__storage__;
|
423
424
|
if (!at(i) || !w(i))
|
424
425
|
return;
|
425
|
-
const { SETTINGS: e, EVENTS: s } =
|
426
|
-
if (this.elements = t.state == "not active" ?
|
426
|
+
const { SETTINGS: e, EVENTS: s } = ct;
|
427
|
+
if (this.elements = t.state == "not active" ? S(i + `:not([${this.active}])`) : S(i), this.elements = S(i), this.options = Object.assign({}, e, t), this.__events__ = Object.assign({}, s), this.options.on)
|
427
428
|
for (const [o, a] of Object.entries(this.options.on))
|
428
429
|
this.__events__[o] = [a];
|
429
|
-
d(this,
|
430
|
-
},
|
430
|
+
d(this, mt, Ve).call(this);
|
431
|
+
}, mt = new WeakSet(), Ve = function() {
|
431
432
|
const { elements: i, options: t } = this;
|
432
433
|
i.forEach((e) => {
|
433
|
-
e.anchor = {}, e.anchor.instance = this, e.anchor.eventHandler = d(this,
|
434
|
+
e.anchor = {}, e.anchor.instance = this, e.anchor.eventHandler = d(this, gt, Ke), e.anchor.defaultOptions = t, e.anchor.methods = {}, e.anchor.methods.destroy = this.destroy, e.anchor.methods.update = this.update, e.addEventListener("click", e.anchor.eventHandler), e.setAttribute(this.active, "");
|
434
435
|
}), this.emit("afterInit");
|
435
|
-
},
|
436
|
+
}, gt = new WeakSet(), Ke = function() {
|
436
437
|
const { defaultOptions: i, eventHandler: t, instance: e } = this.anchor, s = {
|
437
438
|
target: this.getAttribute("data-anchor-target") || i.target,
|
438
439
|
container: this.getAttribute("data-anchor-container") || i.container,
|
@@ -446,7 +447,7 @@ J = new WeakSet(), Ee = function() {
|
|
446
447
|
this.removeEventListener("click", t), setTimeout(() => {
|
447
448
|
this.addEventListener("click", t);
|
448
449
|
}, s.speed), setTimeout(() => {
|
449
|
-
|
450
|
+
Te(s, e);
|
450
451
|
}, s.delay);
|
451
452
|
};
|
452
453
|
Object.assign(Qe.prototype, O);
|
@@ -459,15 +460,15 @@ const { MODALS: M } = window, Ss = (n) => {
|
|
459
460
|
s.append(o);
|
460
461
|
}), e.children[0];
|
461
462
|
};
|
462
|
-
var
|
463
|
+
var ft, ei, vt, ii, bt, si, yt, ni, wt, oi;
|
463
464
|
class ti extends HTMLElement {
|
464
465
|
constructor() {
|
465
466
|
super();
|
466
|
-
h(this, gt);
|
467
467
|
h(this, ft);
|
468
468
|
h(this, vt);
|
469
469
|
h(this, bt);
|
470
470
|
h(this, yt);
|
471
|
+
h(this, wt);
|
471
472
|
this.initialize = !1;
|
472
473
|
}
|
473
474
|
static get observedAttributes() {
|
@@ -476,12 +477,12 @@ class ti extends HTMLElement {
|
|
476
477
|
attributeChangedCallback(t, e, s) {
|
477
478
|
switch (t) {
|
478
479
|
case ":state":
|
479
|
-
d(this,
|
480
|
+
d(this, wt, oi).call(this, s);
|
480
481
|
break;
|
481
482
|
}
|
482
483
|
}
|
483
484
|
connectedCallback() {
|
484
|
-
this.initialize || (this.initialize = !0, d(this,
|
485
|
+
this.initialize || (this.initialize = !0, d(this, ft, ei).call(this));
|
485
486
|
}
|
486
487
|
open() {
|
487
488
|
return this.setAttribute(":state", "open"), this;
|
@@ -493,22 +494,22 @@ class ti extends HTMLElement {
|
|
493
494
|
return this.setAttribute(":state", "destroy"), this;
|
494
495
|
}
|
495
496
|
}
|
496
|
-
|
497
|
+
ft = new WeakSet(), ei = function() {
|
497
498
|
const { ATTRS: t } = I;
|
498
499
|
this.__events__ = {}, this.getAttribute(":state") || this.setAttribute(":state", "close");
|
499
500
|
const e = this.getAttribute(t.id) || Ts();
|
500
|
-
this.getAttribute(t.id) || (
|
501
|
-
},
|
502
|
-
this.childDom = this.childNodes, this.template = Ss(this), this.innerHTML = "", this.append(this.template), d(this,
|
503
|
-
},
|
501
|
+
this.getAttribute(t.id) || (E(`modern-modal needs a ${t.id} attribute with a unique id.`), this.setAttribute(t.id, e)), M[e] && E(`the ${t.id} "${e}" is already be used.`), M[e] = this, d(this, vt, ii).call(this);
|
502
|
+
}, vt = new WeakSet(), ii = function() {
|
503
|
+
this.childDom = this.childNodes, this.template = Ss(this), this.innerHTML = "", this.append(this.template), d(this, bt, si).call(this);
|
504
|
+
}, bt = new WeakSet(), si = function() {
|
504
505
|
const t = this.querySelector(".modal-scroller");
|
505
506
|
this.__scroller__ = Me(t, {
|
506
507
|
overflowBehavior: {
|
507
508
|
x: "hidden"
|
508
509
|
},
|
509
510
|
autoUpdate: !0
|
510
|
-
}), window.modalScroll = this.__scroller__, d(this,
|
511
|
-
},
|
511
|
+
}), window.modalScroll = this.__scroller__, d(this, yt, ni).call(this);
|
512
|
+
}, yt = new WeakSet(), ni = function() {
|
512
513
|
var a, r, l;
|
513
514
|
const t = this, { ATTRS: e } = I, { close: s, destroy: o } = e;
|
514
515
|
(a = t.querySelectorAll(`[${s}]`)) == null || a.forEach((c) => {
|
@@ -524,7 +525,7 @@ gt = new WeakSet(), ei = function() {
|
|
524
525
|
}), (l = t.querySelector("[stop-propagation]")) == null || l.addEventListener("click", function(c) {
|
525
526
|
c.stopPropagation();
|
526
527
|
});
|
527
|
-
},
|
528
|
+
}, wt = new WeakSet(), oi = function(t) {
|
528
529
|
const { __scroller__: e } = this;
|
529
530
|
if (t === "open") {
|
530
531
|
if (this.style.display = "block", e) {
|
@@ -564,10 +565,10 @@ const { MODALS: Ie } = window, ai = (n, i, ...t) => {
|
|
564
565
|
}, ri = (n, ...i) => {
|
565
566
|
n && j(n) && n.apply(U, i);
|
566
567
|
}, ze = (n, i) => {
|
567
|
-
const { target: t } = n, e = Ie[t] ||
|
568
|
+
const { target: t } = n, e = Ie[t] || L(n.target);
|
568
569
|
e && li(n, i), e || Ds(n, i);
|
569
570
|
}, li = (n, i) => {
|
570
|
-
const { target: t, action: e, on: s, e: o } = n, a = Ie[t] ||
|
571
|
+
const { target: t, action: e, on: s, e: o } = n, a = Ie[t] || L(n.target);
|
571
572
|
switch (["open", "close", "destroy"].forEach((l) => {
|
572
573
|
a.once(l, () => {
|
573
574
|
i && (i.emit(l, a, o), ai(i, s[l], a, o)), i || ri(s[l], a);
|
@@ -590,27 +591,27 @@ const { MODALS: Ie } = window, ai = (n, i, ...t) => {
|
|
590
591
|
}, Ds = async (n, i) => {
|
591
592
|
const { target: t, route: e, container: s, on: o, e: a } = n;
|
592
593
|
if (!e)
|
593
|
-
return
|
594
|
+
return E("modal4", "cannot find target or data-modal-route is not defined");
|
594
595
|
const r = (l, ...c) => {
|
595
596
|
i && (i.emit(l, ...c), ai(i, o[l], ...c)), i || ri(o[l], ...c);
|
596
597
|
};
|
597
598
|
fetch(e).then((l) => (r("success", a), l.text())).then((l) => {
|
598
|
-
const c = Es(l), u =
|
599
|
-
[...c].forEach((
|
600
|
-
u.append(
|
599
|
+
const c = Es(l), u = L(s) || L(I.SETTINGS.container);
|
600
|
+
[...c].forEach((v) => {
|
601
|
+
u.append(v);
|
601
602
|
});
|
602
|
-
const p = Ie[t] ||
|
603
|
+
const p = Ie[t] || L(n.target);
|
603
604
|
r("complete", p), li(n, i);
|
604
605
|
}).catch((l) => {
|
605
606
|
r("error", l);
|
606
607
|
});
|
607
608
|
};
|
608
|
-
var Z, Ae,
|
609
|
+
var Z, Ae, Tt, ci, Et, di;
|
609
610
|
const N = class N {
|
610
611
|
constructor(i, t = {}) {
|
611
612
|
h(this, Z);
|
612
|
-
h(this, wt);
|
613
613
|
h(this, Tt);
|
614
|
+
h(this, Et);
|
614
615
|
this.__storage__ = {
|
615
616
|
el: i,
|
616
617
|
options: t
|
@@ -645,18 +646,18 @@ Z = new WeakSet(), Ae = function() {
|
|
645
646
|
if (!at(i) || !w(i))
|
646
647
|
return;
|
647
648
|
const { SETTINGS: e, EVENTS: s } = I;
|
648
|
-
if (this.elements = t.state == "not active" ?
|
649
|
+
if (this.elements = t.state == "not active" ? S(i + `:not([${this.active}])`) : S(i), this.options = Object.assign({}, e, t), this.__events__ = Object.assign({}, s), this.options.on)
|
649
650
|
for (const [o, a] of Object.entries(this.options.on))
|
650
651
|
this.__events__[o] = [a];
|
651
|
-
d(this,
|
652
|
-
},
|
652
|
+
d(this, Tt, ci).call(this);
|
653
|
+
}, Tt = new WeakSet(), ci = function() {
|
653
654
|
const { elements: i, options: t } = this;
|
654
655
|
i.forEach((e) => {
|
655
|
-
e.modal = {}, e.modal.instance = this, e.modal.eventHandler = d(this,
|
656
|
+
e.modal = {}, e.modal.instance = this, e.modal.eventHandler = d(this, Et, di), e.modal.defaultOptions = t, e.modal.methods = {}, e.modal.methods.destroy = this.destroy, e.modal.methods.update = this.update, e.addEventListener("click", e.modal.eventHandler), e.setAttribute(this.active, "");
|
656
657
|
}), this.emit("init");
|
657
|
-
},
|
658
|
+
}, Et = new WeakSet(), di = function(i) {
|
658
659
|
const { defaultOptions: t, eventHandler: e, instance: s } = this.modal, o = As(this.getAttribute("data-modal-on"));
|
659
|
-
o && typeof o != "object" &&
|
660
|
+
o && typeof o != "object" && E("modal4", "data-modal-on must be a json string.");
|
660
661
|
const a = {
|
661
662
|
target: this.getAttribute("data-modal-target") || t.target,
|
662
663
|
action: this.getAttribute("data-modal-action") || t.action,
|
@@ -675,24 +676,24 @@ customElements.define("modern-modal", ti);
|
|
675
676
|
const _s = (n, i) => {
|
676
677
|
const t = n === window ? n.innerHeight : n.getBoundingClientRect().height, e = n === window ? 0 : n.getBoundingClientRect().top;
|
677
678
|
i.forEach((s) => {
|
678
|
-
const { class: o, delay: a, start: r, end: l, repeat: c, instance: u } = s.aost, { top: p, bottom:
|
679
|
-
if (p - e <=
|
679
|
+
const { class: o, delay: a, start: r, end: l, repeat: c, instance: u } = s.aost, { top: p, bottom: v } = s.getBoundingClientRect(), g = t * (r / 100), m = t * (l / 100);
|
680
|
+
if (p - e <= g && v - e >= m && s.offsetParent)
|
680
681
|
setTimeout(() => {
|
681
682
|
s.classList.add(o);
|
682
683
|
}, a);
|
683
684
|
else {
|
684
|
-
const
|
685
|
+
const b = s.classList.contains(o) && c === "down" && p - e >= g || c === "up" && v - e <= m || c === !0;
|
685
686
|
setTimeout(() => {
|
686
|
-
|
687
|
+
b && s.classList.remove(o);
|
687
688
|
}, a);
|
688
689
|
}
|
689
690
|
});
|
690
691
|
}, ks = (n, i) => n === "up" || n === "down" ? n : n !== null ? n === "true" ? !0 : n === "false" ? !1 : i.repeat : i.repeat;
|
691
|
-
var Q, Le,
|
692
|
+
var Q, Le, At, hi;
|
692
693
|
class ui {
|
693
694
|
constructor(i, t = {}) {
|
694
695
|
h(this, Q);
|
695
|
-
h(this,
|
696
|
+
h(this, At);
|
696
697
|
this.__storage__ = {
|
697
698
|
el: i,
|
698
699
|
options: t
|
@@ -702,7 +703,7 @@ class ui {
|
|
702
703
|
const { elements: t, options: e } = this;
|
703
704
|
if (!t)
|
704
705
|
return this;
|
705
|
-
const { scroller: s } = e, o = s === window || !w(s) ? window :
|
706
|
+
const { scroller: s } = e, o = s === window || !w(s) ? window : L(s);
|
706
707
|
return o.aost && (o.removeEventListener("scroll", o.aost.eventHandler), delete o.aost), t.forEach((a) => {
|
707
708
|
if (!a.aost)
|
708
709
|
return;
|
@@ -720,12 +721,12 @@ Q = new WeakSet(), Le = function() {
|
|
720
721
|
if (!at(i) || !w(i))
|
721
722
|
return;
|
722
723
|
const { SETTINGS: e, EVENTS: s } = Ye;
|
723
|
-
if (this.elements = t.state == "not active" ?
|
724
|
+
if (this.elements = t.state == "not active" ? S(i + `:not([${this.active}])`) : S(i), this.options = Object.assign({}, e, t), this.__events__ = Object.assign({}, s), this.options.on)
|
724
725
|
for (const [o, a] of Object.entries(this.options.on))
|
725
726
|
this.__events__[o] = [a];
|
726
|
-
d(this,
|
727
|
-
},
|
728
|
-
const { elements: i, options: t } = this, { scroller: e } = t, s = e === window || !w(e) ? window :
|
727
|
+
d(this, At, hi).call(this);
|
728
|
+
}, At = new WeakSet(), hi = function() {
|
729
|
+
const { elements: i, options: t } = this, { scroller: e } = t, s = e === window || !w(e) ? window : L(e);
|
729
730
|
this.eventHandler = () => {
|
730
731
|
_s(s, i);
|
731
732
|
}, i.forEach((a) => {
|
@@ -743,25 +744,25 @@ const $s = (n) => {
|
|
743
744
|
s.append(o);
|
744
745
|
}), e.children[0];
|
745
746
|
};
|
746
|
-
var
|
747
|
+
var Lt, pi, St, mi, Dt, gi, _t, fi, kt, vi, $t, bi, xt, yi, Ct, wi, Ht, Ti;
|
747
748
|
class xs extends HTMLElement {
|
748
749
|
constructor() {
|
749
750
|
super();
|
750
|
-
h(this, At);
|
751
751
|
h(this, Lt);
|
752
752
|
h(this, St);
|
753
|
-
// youtube iframe
|
754
753
|
h(this, Dt);
|
755
|
-
//
|
754
|
+
// youtube iframe
|
756
755
|
h(this, _t);
|
757
|
-
//
|
756
|
+
// vimeo iframe
|
758
757
|
h(this, kt);
|
758
|
+
// youku iframe
|
759
759
|
h(this, $t);
|
760
|
-
// 2025.02.11 新增 ig
|
761
760
|
h(this, xt);
|
762
|
-
// 2025.02.11 新增
|
761
|
+
// 2025.02.11 新增 ig
|
763
762
|
h(this, Ct);
|
764
|
-
|
763
|
+
// 2025.02.11 新增 tiktok
|
764
|
+
h(this, Ht);
|
765
|
+
d(this, Lt, pi).call(this);
|
765
766
|
}
|
766
767
|
play() {
|
767
768
|
const { videoType: t } = this;
|
@@ -798,58 +799,58 @@ class xs extends HTMLElement {
|
|
798
799
|
}
|
799
800
|
}
|
800
801
|
}
|
801
|
-
|
802
|
+
Lt = new WeakSet(), pi = function() {
|
802
803
|
if (!this.getAttribute("video-id")) {
|
803
|
-
|
804
|
+
E("videoPlayer", "video-render needs a ['video-id'] attribute to creat player.");
|
804
805
|
return;
|
805
806
|
}
|
806
|
-
this.videoId = this.getAttribute("video-id"), this.videoType = this.getAttribute("video-type"), this.autoplay = this.getAttribute("video-autoplay"), this.startTime = this.getAttribute("video-starttime"), d(this,
|
807
|
-
},
|
808
|
-
this.childDom = this.childNodes, this.template = $s(this), this.innerHTML = "", this.append(this.template), d(this,
|
809
|
-
},
|
807
|
+
this.videoId = this.getAttribute("video-id"), this.videoType = this.getAttribute("video-type"), this.autoplay = this.getAttribute("video-autoplay"), this.startTime = this.getAttribute("video-starttime"), d(this, St, mi).call(this);
|
808
|
+
}, St = new WeakSet(), mi = function() {
|
809
|
+
this.childDom = this.childNodes, this.template = $s(this), this.innerHTML = "", this.append(this.template), d(this, Dt, gi).call(this);
|
810
|
+
}, Dt = new WeakSet(), gi = function() {
|
810
811
|
const { videoType: t } = this;
|
811
812
|
let e = "";
|
812
813
|
switch (t) {
|
813
814
|
case "youtubeAPI":
|
814
815
|
break;
|
815
816
|
case "youtube":
|
816
|
-
e = d(this,
|
817
|
+
e = d(this, _t, fi).call(this);
|
817
818
|
break;
|
818
819
|
case "youkuAPI":
|
819
820
|
break;
|
820
821
|
case "youku":
|
821
|
-
e = d(this,
|
822
|
+
e = d(this, $t, bi).call(this);
|
822
823
|
break;
|
823
824
|
case "vimeo":
|
824
|
-
e = d(this,
|
825
|
+
e = d(this, kt, vi).call(this);
|
825
826
|
break;
|
826
827
|
case "bilibili":
|
827
|
-
e = d(this,
|
828
|
+
e = d(this, xt, yi).call(this);
|
828
829
|
break;
|
829
830
|
case "instagram":
|
830
|
-
e = d(this,
|
831
|
+
e = d(this, Ct, wi).call(this);
|
831
832
|
break;
|
832
833
|
case "tiktok":
|
833
|
-
e = d(this,
|
834
|
+
e = d(this, Ht, Ti).call(this);
|
834
835
|
break;
|
835
836
|
}
|
836
|
-
this.querySelector(".player-wrapper").insertAdjacentHTML(
|
837
|
-
},
|
837
|
+
this.querySelector(".player-wrapper").insertAdjacentHTML(A.prepend, e);
|
838
|
+
}, _t = new WeakSet(), fi = function() {
|
838
839
|
const { videoId: t, autoplay: e, startTime: s } = this;
|
839
840
|
return `<iframe src="https://www.youtube.com/embed/${t}?rel=0&${e === "on" ? "autoplay=1" : ""}&start=${s}&mute=1&loop=1&enablejsapi=1" frameborder="0" allowfullscreen="0" volumn="0" allow="${e === "on" ? "autoplay;" : ""} encrypted-media; gyroscope; picture-in-picture;"></iframe>`;
|
840
|
-
},
|
841
|
+
}, kt = new WeakSet(), vi = function() {
|
841
842
|
const { videoId: t, autoplay: e, hash: s } = this;
|
842
843
|
return `<iframe src="https://player.vimeo.com/video/${t}?h=${s}&${e === "on" ? "autoplay=1" : ""}&loop=1&color=ffffff&title=0&byline=0&portrait=0" frameborder="0" allow="${e === "on" ? "autoplay;" : ""} fullscreen; picture-in-picture" allowfullscreen></iframe><script src="https://player.vimeo.com/api/player.js"><\/script>`;
|
843
|
-
},
|
844
|
+
}, $t = new WeakSet(), bi = function() {
|
844
845
|
const { videoId: t, autoplay: e } = this;
|
845
846
|
return `<iframe src="https://player.youku.com/embed/${t}?rel=0&${e === "on" ? "autoplay=1" : ""}" frameborder=0 "allowfullscreen"></iframe>`;
|
846
|
-
},
|
847
|
+
}, xt = new WeakSet(), yi = function() {
|
847
848
|
const { videoId: t, autoplay: e } = this;
|
848
849
|
return `<iframe src="//player.bilibili.com/player.html?bvid=${t}&page=1&as_wide=1&high_quality=1&danmaku=0" scrolling="no" border="0" frameborder="no" framespacing="0" allowfullscreen="true"></iframe>`;
|
849
|
-
},
|
850
|
+
}, Ct = new WeakSet(), wi = function() {
|
850
851
|
const { videoId: t, autoplay: e } = this;
|
851
852
|
return `<iframe class="instagram-media instagram-media-rendered" id="instagram-embed-0" src="https://www.instagram.com/p/${t}/embed/" width="num-w" height=" num-h" scrolling="auto" frameborder="0" data-instgrm-payload-id="instagram-media-payload-0"></iframe>`;
|
852
|
-
},
|
853
|
+
}, Ht = new WeakSet(), Ti = function() {
|
853
854
|
const { videoId: t, autoplay: e } = this;
|
854
855
|
return `<iframe name="__tt_embed__v79271677875424740" sandbox="allow-popups allow-popups-to-escape-sandbox allow-scripts allow-top-navigation allow-same-origin" src="https://www.tiktok.com/player/v1/${t}?&${e === "on" ? "autoplay=1" : ""}"></iframe>`;
|
855
856
|
};
|
@@ -860,18 +861,18 @@ function Ei(n) {
|
|
860
861
|
const i = [];
|
861
862
|
n && n.forEach((t) => {
|
862
863
|
t instanceof HTMLElement ? i.push(t) : typeof t == "string" && i.push(...document.querySelectorAll(`${t}`));
|
863
|
-
}),
|
864
|
+
}), f("html").addClass("scrollLock"), vs(i);
|
864
865
|
}
|
865
866
|
function Ai(n) {
|
866
867
|
const i = [];
|
867
868
|
n && n.forEach((t) => {
|
868
869
|
t instanceof HTMLElement ? i.push(t) : typeof t == "string" && i.push(...document.querySelectorAll(`${t}`));
|
869
|
-
}),
|
870
|
+
}), f("html").removeClass("scrollLock"), bs(i);
|
870
871
|
}
|
871
872
|
async function fn(n = 0) {
|
872
|
-
if (
|
873
|
+
if (f(".loading-wrapper").length)
|
873
874
|
return;
|
874
|
-
|
875
|
+
f("body").append(`
|
875
876
|
<div class="loading-wrapper">
|
876
877
|
<div class="icon-box">
|
877
878
|
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 100 100" preserveAspectRatio="xMidYMid"><path d="M10 50A40 40 0 0 0 90 50A40 42 0 0 1 10 50" fill="#ffffff" stroke="none">
|
@@ -881,13 +882,13 @@ async function fn(n = 0) {
|
|
881
882
|
</svg>
|
882
883
|
</div>
|
883
884
|
</div>
|
884
|
-
`),
|
885
|
+
`), f(".loading-wrapper").delay(n).fadeIn(300).promise().done(function() {
|
885
886
|
Ei();
|
886
887
|
});
|
887
888
|
}
|
888
889
|
function vn() {
|
889
|
-
|
890
|
-
|
890
|
+
f(".loading-wrapper").fadeOut(300).promise().done(function() {
|
891
|
+
f(".loading-wrapper").remove(), Ai();
|
891
892
|
});
|
892
893
|
}
|
893
894
|
function bn(n, i) {
|
@@ -900,7 +901,7 @@ function Cs() {
|
|
900
901
|
}
|
901
902
|
function yn(n, i = () => {
|
902
903
|
}) {
|
903
|
-
|
904
|
+
f(`[data-tab-content=${n}]`).fadeIn(function() {
|
904
905
|
typeof i == "function" && i();
|
905
906
|
}).siblings("[data-tab-content]").hide(), Cs();
|
906
907
|
}
|
@@ -941,13 +942,13 @@ function En() {
|
|
941
942
|
};
|
942
943
|
}
|
943
944
|
function An(n, i) {
|
944
|
-
|
945
|
-
|
945
|
+
f(n).on("click", function() {
|
946
|
+
f(this).toggleClass(i);
|
946
947
|
});
|
947
948
|
}
|
948
949
|
function Ln(n, i) {
|
949
|
-
|
950
|
-
|
950
|
+
f(n).on("click", function() {
|
951
|
+
f(n).not(this).removeClass(i), f(this).addClass(i);
|
951
952
|
});
|
952
953
|
}
|
953
954
|
function Hs(n, i = 250) {
|
@@ -969,12 +970,12 @@ function Sn(n, i = 250) {
|
|
969
970
|
};
|
970
971
|
}
|
971
972
|
function Dn() {
|
972
|
-
window._g.interval = [],
|
973
|
-
const e = Number(
|
973
|
+
window._g.interval = [], f(".countdown").each((i, t) => {
|
974
|
+
const e = Number(f(t).attr("data-seconds")) + 1;
|
974
975
|
let s = Math.floor(e / 60) + ":" + e % 60;
|
975
976
|
window._g.interval[i] = setInterval(function() {
|
976
977
|
var o = s.split(":"), a = parseInt(o[0], 10), r = parseInt(o[1], 10);
|
977
|
-
--r, a = r < 0 ? --a : a, a = a < 10 ? a = "0" + a : a, a == 0 && r == 0 && clearInterval(window._g.interval[i]), r = r < 0 ? 59 : r, r = r < 10 ? "0" + r : r,
|
978
|
+
--r, a = r < 0 ? --a : a, a = a < 10 ? a = "0" + a : a, a == 0 && r == 0 && clearInterval(window._g.interval[i]), r = r < 0 ? 59 : r, r = r < 10 ? "0" + r : r, f(t).html(a + ":" + r), s = a + ":" + r;
|
978
979
|
}, 1e3);
|
979
980
|
});
|
980
981
|
}
|
@@ -993,13 +994,13 @@ function kn() {
|
|
993
994
|
n(), window.addEventListener("resize", Hs(n));
|
994
995
|
}
|
995
996
|
function $n(n, i, t, e, s) {
|
996
|
-
const o = this, r =
|
997
|
+
const o = this, r = f(n).html().split("<br>");
|
997
998
|
let l = "", c = 0;
|
998
999
|
r.forEach((u, p) => {
|
999
|
-
p !== 0 && (l += "<br>"), u.split("").forEach((
|
1000
|
-
i ? (
|
1000
|
+
p !== 0 && (l += "<br>"), u.split("").forEach((g, m) => {
|
1001
|
+
i ? (m === 0 && (l += '<span class="letter-wrap" style="display: inline-block">'), g === " " ? l += '</span> <span class="letter-wrap" style="display: inline-block">' : (l += `<span class="letter"${s || t ? ` style="${s ? `transition: ${o.formatFloat(Math.random(), 2) * s}s;` : ""}${t ? t === "random" ? `transition-delay: ${o.formatFloat(Math.random(), 2)}s;` : `transition-delay: ${t + c * e}s;` : ""}"` : ""}>${g}</span>`, c++), m === u.length - 1 && (l += "</span>")) : g === " " ? l += " " : (l += `<span class="letter"${s || t ? ` style="${s ? `transition: ${o.formatFloat(Math.random(), 2) * s}s;` : ""}${t ? t === "random" ? `transition-delay: ${o.formatFloat(Math.random(), 2)}s;` : `transition-delay: ${t + c * e}s;` : ""}"` : ""}>${g}</span>`, c++);
|
1001
1002
|
});
|
1002
|
-
}),
|
1003
|
+
}), f(n).html(l);
|
1003
1004
|
}
|
1004
1005
|
function xn(n, i) {
|
1005
1006
|
const t = Math.pow(10, i);
|
@@ -1022,7 +1023,7 @@ function Cn(n) {
|
|
1022
1023
|
}
|
1023
1024
|
function Hn(n, i) {
|
1024
1025
|
const t = n.$el, e = n.params.grid.rows, s = i || n.params.slidesPerView * e;
|
1025
|
-
(n.loopedSlides ? n.slides.length - n.loopedSlides * 2 : n.slides.length) <= s ? (t.addClass("swiper-no-swiping"),
|
1026
|
+
(n.loopedSlides ? n.slides.length - n.loopedSlides * 2 : n.slides.length) <= s ? (t.addClass("swiper-no-swiping"), f(n.params.navigation.nextEl).hide(), f(n.params.navigation.prevEl).hide(), f(n.params.pagination.el).hide(), n.params.autoplay.enabled = !1, n.autoplay.stop()) : (t.removeClass("swiper-no-swiping"), f(n.params.navigation.nextEl).show(), f(n.params.navigation.prevEl).show(), f(n.params.pagination.el).show(), n.params.autoplay.enabled && n.autoplay.start());
|
1026
1027
|
}
|
1027
1028
|
function Mn(n) {
|
1028
1029
|
n.el.querySelectorAll("img.detect-shade").forEach((i) => {
|
@@ -1032,36 +1033,36 @@ function Mn(n) {
|
|
1032
1033
|
});
|
1033
1034
|
}
|
1034
1035
|
function qn(n) {
|
1035
|
-
const i = n.el, t =
|
1036
|
-
n.autoplay.stop(),
|
1036
|
+
const i = n.el, t = f(i).find(".swiper-slide-active"), e = f(t).find("video").get(0), s = f(i).find(".swiper-slide video");
|
1037
|
+
n.autoplay.stop(), f(e).off("ended"), e ? (s.each((o, a) => {
|
1037
1038
|
a.currentTime = 0;
|
1038
|
-
}),
|
1039
|
+
}), f(e).on("ended", function() {
|
1039
1040
|
n.slideNext();
|
1040
1041
|
}), e.play()) : n.params.autoplay.enabled && n.autoplay.start();
|
1041
1042
|
}
|
1042
1043
|
function In() {
|
1043
|
-
|
1044
|
-
const t =
|
1044
|
+
f(".number-grow").each(function(n, i) {
|
1045
|
+
const t = f(i), o = t.attr("data-num").replace(/(\d)(?=(?:\d{3})+$)/g, "$1,").split(""), a = () => {
|
1045
1046
|
let r = "";
|
1046
1047
|
for (var l = 0; l <= 9; l++)
|
1047
1048
|
r += String(l) + "<br>";
|
1048
1049
|
return r;
|
1049
1050
|
};
|
1050
|
-
|
1051
|
+
f(o).each(function(r, l) {
|
1051
1052
|
const c = () => l !== "," ? `<div class="num" data-final-num="${l}"><div><br>${a()}<br>${a()}</div></div>` : `<div class="comma">${l}</div>`;
|
1052
1053
|
t.append(c);
|
1053
1054
|
});
|
1054
1055
|
});
|
1055
1056
|
}
|
1056
1057
|
function On() {
|
1057
|
-
|
1058
|
-
const t =
|
1058
|
+
f(".letter-grow").each(function(n, i) {
|
1059
|
+
const t = f(i), s = t.attr("data-letter").split(""), o = () => {
|
1059
1060
|
let a = "";
|
1060
1061
|
for (let r = 65; r <= 90; r++)
|
1061
1062
|
a += String.fromCharCode(r) + "<br>";
|
1062
1063
|
return a;
|
1063
1064
|
};
|
1064
|
-
|
1065
|
+
f(s).each(function(a, r) {
|
1065
1066
|
const l = `<div class="letter" data-final-letter="${r}"><div><br>${o()}<br>${o()}</div></div>`;
|
1066
1067
|
t.append(l);
|
1067
1068
|
});
|
@@ -1081,16 +1082,16 @@ function jn(n) {
|
|
1081
1082
|
const i = document.createElement("div");
|
1082
1083
|
return i.innerHTML = n, i.childNodes[0];
|
1083
1084
|
}
|
1084
|
-
const We = (n) => n.videoId !== "" || typeof n.videoId < "u", Ms = (n) => n.$selector.getAttribute("video4-active") === "on",
|
1085
|
-
var V, Se,
|
1085
|
+
const We = (n) => n.videoId !== "" || typeof n.videoId < "u", Ms = (n) => n.$selector.getAttribute("video4-active") === "on", lt = (n) => `<video-player video-id="${n.videoId}" video-type="${n.videoType}" video-startTime="${n.videoStartTime}" video-autoplay="${n.videoAutoplay}"></video-player>`;
|
1086
|
+
var V, Se, Mt, Li, qt, Si, K, De, It, Di;
|
1086
1087
|
class qs {
|
1087
1088
|
constructor(i, t = {}) {
|
1088
1089
|
h(this, V);
|
1089
|
-
h(this, Ht);
|
1090
1090
|
h(this, Mt);
|
1091
|
-
h(this, K);
|
1092
1091
|
h(this, qt);
|
1093
|
-
|
1092
|
+
h(this, K);
|
1093
|
+
h(this, It);
|
1094
|
+
if (!at(i) && !we(i) && !rt(i)) {
|
1094
1095
|
je("video4", `找不到該物件 -> ${i}`);
|
1095
1096
|
return;
|
1096
1097
|
}
|
@@ -1105,47 +1106,50 @@ class qs {
|
|
1105
1106
|
}
|
1106
1107
|
V = new WeakSet(), Se = function() {
|
1107
1108
|
const { el: i, options: t } = this.__storage__, { SETTINGS: e, EVENTS: s } = Y;
|
1108
|
-
if (this.elements = t.state == "not active" ?
|
1109
|
+
if (this.elements = t.state == "not active" ? S(i + `:not([${this.active}])`) : S(i), this.options = Object.assign({}, e, t), this.__events__ = Object.assign({}, s), this.options.on)
|
1109
1110
|
for (const [o, a] of Object.entries(this.options.on))
|
1110
1111
|
this.__events__[o] = [a];
|
1111
|
-
d(this,
|
1112
|
-
},
|
1112
|
+
d(this, Mt, Li).call(this);
|
1113
|
+
}, Mt = new WeakSet(), Li = function() {
|
1113
1114
|
const { elements: i, options: t } = this;
|
1114
1115
|
i.forEach((e) => {
|
1115
|
-
e.video = {}, e.video.instance = this, e.video.defaultOptions = t, e.video.params = d(this,
|
1116
|
+
e.video = {}, e.video.instance = this, e.video.defaultOptions = t, e.video.params = d(this, It, Di).call(this, e), e.video.methods = {}, e.video.methods.update = this.update, e.setAttribute(this.active, ""), We(e.video.params) && !Ms(e.video.params) && (e.setAttribute("video4-active", "on"), d(this, qt, Si).call(this, e)), We(e.video.params) || je("video4", "無法取得影片 ID");
|
1116
1117
|
}), this.emit("init");
|
1117
|
-
},
|
1118
|
-
const { LAYOUT: t } = Y, e = i.video.params, { $selector: s, videoLayoutNo: o, videoId: a, videoType: r, videoMode: l, videoButton: c,
|
1118
|
+
}, qt = new WeakSet(), Si = function(i) {
|
1119
|
+
const { LAYOUT: t } = Y, e = i.video.params, { $selector: s, videoLayoutNo: o, videoId: a, videoType: r, videoMode: l, videoButton: c, videoKeep: u, videoCover: p, videoHighQualityPic: v } = e;
|
1119
1120
|
if (l === "onBox") {
|
1120
1121
|
let g = null;
|
1121
|
-
if (
|
1122
|
-
i.classList.add("video4-cover"), s.querySelector("img") || (s.insertAdjacentHTML(
|
1122
|
+
if (p === "on") {
|
1123
|
+
i.classList.add("video4-cover"), s.querySelector("img") || (s.insertAdjacentHTML(A.prepend, '<picture><source srcset="" type="image/webp"><source srcset="" type="image/jpeg"><img src="" alt></picture>'), E("video4", "若啟用 [videoCover] 且選擇 onBox 模式必須於 video-target 內放置 img 結構,若無結構則自動加入圖片結構"));
|
1123
1124
|
const m = s.querySelector("img");
|
1124
|
-
m.insertAdjacentHTML(
|
1125
|
-
const
|
1126
|
-
!
|
1127
|
-
const
|
1128
|
-
m.setAttribute("src", `${
|
1125
|
+
m.insertAdjacentHTML(A.after, t[o]);
|
1126
|
+
const y = (m == null ? void 0 : m.getAttribute("src")) || (m == null ? void 0 : m.getAttribute("data-src"));
|
1127
|
+
!y && r == "youtube" ? v == "on" ? m.setAttribute("src", `http://img.youtube.com/vi/${a}/maxresdefault.jpg `) : m.setAttribute("src", `https://img.youtube.com/vi/${a}/0.jpg`) : !y && r == "vimeo" ? m.setAttribute("src", `https://vumbnail.com/${a}_large.jpg`) : !y && r == "tiktok" ? fetch(`https://www.tiktok.com/oembed?url=https://www.tiktok.com/@/video/${a}`, { method: "GET", redirect: "follow" }).then((b) => b.json()).then((b) => {
|
1128
|
+
const T = b.thumbnail_url;
|
1129
|
+
m.setAttribute("src", `${T}`);
|
1129
1130
|
}).catch(function(b) {
|
1130
1131
|
console.log("error");
|
1131
|
-
}) :
|
1132
|
+
}) : E("video4", "僅 youtube & vimeo 提供,無圖片時放置預設封面畫面,其他影片平台請自行上傳封面照片");
|
1132
1133
|
}
|
1133
|
-
c == "off" ? g = s : (g = s.querySelector(c) ?? s, s.querySelector(c) ||
|
1134
|
+
c == "off" ? g = s : (g = s.querySelector(c) ?? s, s.querySelector(c) || E("video4", `找不到 videoButton 設定的 element -> '${c}' , 點擊物件轉移至 '${this.__storage__.el}'`)), g.video || (g.video = {}, g.video.params = e), g.video.eventHandler = d(this, K, De), g.addEventListener("click", g.video.eventHandler);
|
1134
1135
|
} else if (l === "onPage") {
|
1135
1136
|
let g = null;
|
1136
|
-
if (
|
1137
|
-
i.classList.add("video4-cover"), s.querySelector("img") || (s.insertAdjacentHTML(
|
1137
|
+
if (p == "on") {
|
1138
|
+
i.classList.add("video4-cover"), s.querySelector("img") || (s.insertAdjacentHTML(A.prepend, '<picture><source srcset="" type="image/webp"><source srcset="" type="image/jpeg"><img src="" alt></picture>'), E("video", "若啟用 [videoCover] 且選擇 onBox 模式必須於 video-target 內放置 img 結構"));
|
1138
1139
|
const m = s.querySelector("img");
|
1139
|
-
m.insertAdjacentHTML(
|
1140
|
-
const
|
1141
|
-
!
|
1142
|
-
const
|
1143
|
-
m.setAttribute("src", `${
|
1140
|
+
m.insertAdjacentHTML(A.after, t[o]);
|
1141
|
+
const y = (m == null ? void 0 : m.getAttribute("src")) || (m == null ? void 0 : m.getAttribute("data-src"));
|
1142
|
+
!y && r == "youtube" ? v == "on" ? m.setAttribute("src", `http://img.youtube.com/vi/${a}/maxresdefault.jpg `) : m.setAttribute("src", `https://img.youtube.com/vi/${a}/0.jpg`) : !y && r == "vimeo" ? m.setAttribute("src", `https://vumbnail.com/${a}_large.jpg`) : !y && r == "tiktok" ? fetch(`https://www.tiktok.com/oembed?url=https://www.tiktok.com/@/video/${a}`, { method: "GET", redirect: "follow" }).then((b) => b.json()).then((b) => {
|
1143
|
+
const T = b.thumbnail_url;
|
1144
|
+
m.setAttribute("src", `${T}`);
|
1144
1145
|
}).catch(function(b) {
|
1145
1146
|
console.log("error");
|
1146
|
-
}) :
|
1147
|
+
}) : y || E("video4", "僅 youtube & vimeo 提供,無圖片時放置預設封面畫面,其他影片平台請自行上傳封面照片"), c == "off" ? g = s : (g = s.querySelector(c) ?? s, s.querySelector(c) || E("video4", `找不到 videoButton 設定的 element -> '${c}', 點擊物件轉移至 '${this.__storage__.el}'`));
|
1148
|
+
} else if (u == "off") {
|
1149
|
+
s.innerHTML = lt(e);
|
1150
|
+
return;
|
1147
1151
|
} else {
|
1148
|
-
s.
|
1152
|
+
(s.querySelector(u) ?? s).insertAdjacentHTML("beforeend", lt(e));
|
1149
1153
|
return;
|
1150
1154
|
}
|
1151
1155
|
g.video || (g.video = {}, g.video.params = e), g.video.eventHandler = d(this, K, De), g.addEventListener("click", g.video.eventHandler);
|
@@ -1158,38 +1162,38 @@ V = new WeakSet(), Se = function() {
|
|
1158
1162
|
target: a,
|
1159
1163
|
route: r,
|
1160
1164
|
on: {
|
1161
|
-
complete(
|
1165
|
+
complete(v) {
|
1162
1166
|
if (l == "instagram")
|
1163
|
-
if (
|
1167
|
+
if (v.setAttribute("video-typeStyle", `${l}`), window.instgrm)
|
1164
1168
|
window.instgrm.Embeds.process();
|
1165
1169
|
else {
|
1166
|
-
const
|
1167
|
-
|
1170
|
+
const g = document.createElement("script");
|
1171
|
+
g.src = "https://www.instagram.com/embed.js", g.async = !0, document.body.appendChild(g);
|
1168
1172
|
}
|
1169
1173
|
else
|
1170
|
-
|
1174
|
+
v.querySelector(".modal-content").insertAdjacentHTML("beforeend", lt(t.params)), v.setAttribute("video-typeStyle", `${l}`);
|
1171
1175
|
},
|
1172
|
-
open(
|
1173
|
-
const
|
1174
|
-
if (u.update(), Ei([...
|
1175
|
-
const
|
1176
|
-
new ResizeObserver((
|
1177
|
-
|
1178
|
-
}).observe(
|
1176
|
+
open(v) {
|
1177
|
+
const g = v.querySelectorAll("[data-overlayscrollbars-viewport]");
|
1178
|
+
if (u.update(), Ei([...g]), l == "instagram") {
|
1179
|
+
const m = document.querySelector("[video-template] .modal-content");
|
1180
|
+
new ResizeObserver((b) => {
|
1181
|
+
b[0].contentRect.height > 50 && m.classList.add("active");
|
1182
|
+
}).observe(m);
|
1179
1183
|
}
|
1180
1184
|
},
|
1181
|
-
close(
|
1182
|
-
const
|
1183
|
-
Ai([...
|
1185
|
+
close(v) {
|
1186
|
+
const g = v.querySelectorAll("[data-overlayscrollbars-viewport]");
|
1187
|
+
Ai([...g]);
|
1184
1188
|
},
|
1185
|
-
destroy(
|
1189
|
+
destroy(v) {
|
1186
1190
|
}
|
1187
1191
|
}
|
1188
1192
|
};
|
1189
1193
|
U.open(p);
|
1190
1194
|
} else
|
1191
|
-
o == "onPage" && (t.params.videoAutoplay = "on", s.innerHTML =
|
1192
|
-
},
|
1195
|
+
o == "onPage" && (t.params.videoAutoplay = "on", s.innerHTML = lt(t.params));
|
1196
|
+
}, It = new WeakSet(), Di = function(i) {
|
1193
1197
|
const { SETTINGS: t } = Y;
|
1194
1198
|
return {
|
1195
1199
|
$selector: i,
|
@@ -1198,6 +1202,7 @@ V = new WeakSet(), Se = function() {
|
|
1198
1202
|
videoAutoplay: i.getAttribute("video-autoplay") || t.videoAutoplay,
|
1199
1203
|
videoMode: i.getAttribute("video-mode") || t.videoMode,
|
1200
1204
|
videoButton: i.getAttribute("video-button") || t.videoButton,
|
1205
|
+
videoKeep: i.getAttribute("video-keep") || t.videoKeep,
|
1201
1206
|
videoCover: i.getAttribute("video-cover") || t.videoCover,
|
1202
1207
|
videoLayoutNo: i.getAttribute("video-layout-no") || t.videoLayoutNo,
|
1203
1208
|
videoTarget: i.getAttribute("video-target") || t.videoTarget,
|
@@ -2057,9 +2062,9 @@ const Oe = {
|
|
2057
2062
|
const i = (t = n.getAttribute("control-elements")) == null ? void 0 : t.split(",");
|
2058
2063
|
i && i.forEach((e) => {
|
2059
2064
|
const s = document.querySelector(e);
|
2060
|
-
s ||
|
2065
|
+
s || E("dropdown", `Can't not find control element(${e})`), s && s.classList.contains("disabled") && (s.classList.remove("disabled"), s.tagName === "DROPDOWN-EL" && s.s.activeLi && C(s, [...s.s.allLi].indexOf(s.s.activeLi)));
|
2061
2066
|
});
|
2062
|
-
},
|
2067
|
+
}, C = (n, i) => {
|
2063
2068
|
const t = n.getAttribute("d4-placeholder"), e = n.querySelectorAll(".dropdown-list li");
|
2064
2069
|
if (i < 0 || i.length === 0) {
|
2065
2070
|
switch (e.forEach((s) => {
|
@@ -2100,7 +2105,7 @@ const Oe = {
|
|
2100
2105
|
const o = n.querySelectorAll(".dropdown-list li.active");
|
2101
2106
|
o.length <= 0 ? n.s.selectDisplayEl.textContent = t.trim() : (n.s.selectDisplayEl.textContent = "", o.forEach((r) => {
|
2102
2107
|
const l = r.getAttribute("data-option"), c = r.textContent.trim(), u = `<div class="option-btn" data-option="${l}"><div class="text">${c}</div><div class="remove-icon"></div></div>`;
|
2103
|
-
n.s.selectDisplayEl.insertAdjacentHTML(
|
2108
|
+
n.s.selectDisplayEl.insertAdjacentHTML(A.append, u);
|
2104
2109
|
})), n.s.activeLi = o, n.s.value = [...o].map((r) => ({
|
2105
2110
|
index: [...e].indexOf(r),
|
2106
2111
|
id: r.getAttribute("data-option"),
|
@@ -2124,7 +2129,7 @@ const Oe = {
|
|
2124
2129
|
o.textContent = e[0], o.setAttribute("data-option", e[0]), n.querySelector(".dropdown-list").append(o);
|
2125
2130
|
});
|
2126
2131
|
}, _i = () => {
|
2127
|
-
|
2132
|
+
S('dropdown-el[d4-status="open"]').forEach((i) => {
|
2128
2133
|
i.close();
|
2129
2134
|
});
|
2130
2135
|
}, js = () => {
|
@@ -2139,14 +2144,14 @@ js();
|
|
2139
2144
|
document.addEventListener("click", function() {
|
2140
2145
|
_i();
|
2141
2146
|
});
|
2142
|
-
var
|
2147
|
+
var Ot, $i, Nt, xi, Pt, Ci, jt, Hi;
|
2143
2148
|
class ki extends HTMLElement {
|
2144
2149
|
constructor() {
|
2145
2150
|
super();
|
2146
|
-
h(this, It);
|
2147
2151
|
h(this, Ot);
|
2148
2152
|
h(this, Nt);
|
2149
2153
|
h(this, Pt);
|
2154
|
+
h(this, jt);
|
2150
2155
|
this.initialize = !1;
|
2151
2156
|
}
|
2152
2157
|
static get observedAttributes() {
|
@@ -2167,7 +2172,7 @@ class ki extends HTMLElement {
|
|
2167
2172
|
switch (o.hasAttribute("multiple") ? "multiple" : "single") {
|
2168
2173
|
case "single":
|
2169
2174
|
const r = o.querySelector(`.dropdown-list li[data-option="${s}"]`);
|
2170
|
-
w(r) ?
|
2175
|
+
w(r) ? C(o, [...o.s.allLi].indexOf(r)) : C(o, -1);
|
2171
2176
|
break;
|
2172
2177
|
case "multiple":
|
2173
2178
|
const l = [];
|
@@ -2176,23 +2181,23 @@ class ki extends HTMLElement {
|
|
2176
2181
|
w(p) && (p.classList.add("active"), l.push(p));
|
2177
2182
|
});
|
2178
2183
|
const c = l.map((u) => [...o.s.allLi].indexOf(u));
|
2179
|
-
|
2184
|
+
C(o, c);
|
2180
2185
|
break;
|
2181
2186
|
}
|
2182
2187
|
else
|
2183
|
-
|
2188
|
+
C(o, -1);
|
2184
2189
|
o.emit("change");
|
2185
2190
|
break;
|
2186
2191
|
case "d4-placeholder":
|
2187
2192
|
if (e === null)
|
2188
2193
|
return;
|
2189
|
-
e !== s && o.s.value.index < 0 &&
|
2194
|
+
e !== s && o.s.value.index < 0 && C(o, o.s.value.index);
|
2190
2195
|
break;
|
2191
2196
|
}
|
2192
2197
|
}
|
2193
2198
|
connectedCallback() {
|
2194
2199
|
const t = this;
|
2195
|
-
t.initialize || t.classList.contains("d4-initialize") || (t.initialize = !0, d(this,
|
2200
|
+
t.initialize || t.classList.contains("d4-initialize") || (t.initialize = !0, d(this, Ot, $i).call(this));
|
2196
2201
|
}
|
2197
2202
|
open() {
|
2198
2203
|
const t = this, e = t.querySelector(".dropdown-scroller").clientHeight, s = t.classList.contains("filter"), o = () => s ? t.querySelector(".dropdown-scroller .filter-bar") ? e : t.querySelector(".filter-bar").clientHeight + e : e;
|
@@ -2218,11 +2223,11 @@ class ki extends HTMLElement {
|
|
2218
2223
|
this.__events__.selectOption();
|
2219
2224
|
}
|
2220
2225
|
}
|
2221
|
-
|
2222
|
-
this.s = {}, this.__events__ = {}, this.hasAttribute("d4-status") || this.setAttribute("d4-status", "close"), this.hasAttribute("d4-value") || this.setAttribute("d4-value", ""), d(this,
|
2223
|
-
},
|
2224
|
-
this.s.childDom = this.childNodes, this.s.template = Is(this), this.innerHTML = "", this.append(this.s.template), d(this,
|
2225
|
-
},
|
2226
|
+
Ot = new WeakSet(), $i = function() {
|
2227
|
+
this.s = {}, this.__events__ = {}, this.hasAttribute("d4-status") || this.setAttribute("d4-status", "close"), this.hasAttribute("d4-value") || this.setAttribute("d4-value", ""), d(this, Nt, xi).call(this);
|
2228
|
+
}, Nt = new WeakSet(), xi = function() {
|
2229
|
+
this.s.childDom = this.childNodes, this.s.template = Is(this), this.innerHTML = "", this.append(this.s.template), d(this, Pt, Ci).call(this);
|
2230
|
+
}, Pt = new WeakSet(), Ci = function() {
|
2226
2231
|
var s;
|
2227
2232
|
const t = this;
|
2228
2233
|
t.s.allLi = t.querySelectorAll(".dropdown-list li"), t.s.selectDisplayEl = t.querySelector(".select-display"), t.s.dropdownEl = t.querySelector(".dropdown"), t.s.selectType = t.hasAttribute("multiple") ? "multiple" : "single", t.s.cityLang = t.hasAttribute("city-lang") ? t.getAttribute("city-lang") : "zh-tw", Ns(t), t.s.subDropdownTotalH = 0;
|
@@ -2267,8 +2272,8 @@ It = new WeakSet(), $i = function() {
|
|
2267
2272
|
};
|
2268
2273
|
break;
|
2269
2274
|
}
|
2270
|
-
|
2271
|
-
},
|
2275
|
+
C(t, t.s.value.index), d(s = t, jt, Hi).call(s), t.classList.add("d4-initialize");
|
2276
|
+
}, jt = new WeakSet(), Hi = function() {
|
2272
2277
|
const t = this;
|
2273
2278
|
t.__events__.dropdownToggle = () => {
|
2274
2279
|
t.addEventListener("click", function(e) {
|
@@ -2291,9 +2296,9 @@ It = new WeakSet(), $i = function() {
|
|
2291
2296
|
if (t.__scroller__) {
|
2292
2297
|
const { viewport: c } = t.__scroller__.elements();
|
2293
2298
|
if (w(t.s.activeLi)) {
|
2294
|
-
const u = t.s.activeLi.clientHeight / 2, p = t.s.activeLi.offsetTop,
|
2299
|
+
const u = t.s.activeLi.clientHeight / 2, p = t.s.activeLi.offsetTop, v = p - r.clientHeight / 2 + u > 0 ? p - r.clientHeight / 2 + u : 0;
|
2295
2300
|
c.scrollTo({
|
2296
|
-
top:
|
2301
|
+
top: v,
|
2297
2302
|
behavior: "smooth"
|
2298
2303
|
});
|
2299
2304
|
} else
|
@@ -2324,34 +2329,34 @@ It = new WeakSet(), $i = function() {
|
|
2324
2329
|
const a = e.querySelector(".dropdown-scroller"), r = e.classList.contains("city");
|
2325
2330
|
e.s.allLi = e.querySelectorAll(".dropdown-list li"), e.s.allLi.forEach((l) => {
|
2326
2331
|
l.addEventListener("click", function(c) {
|
2327
|
-
var
|
2328
|
-
const u = this, p = [...e.s.allLi].indexOf(u),
|
2332
|
+
var g;
|
2333
|
+
const u = this, p = [...e.s.allLi].indexOf(u), v = parseInt(e.getAttribute("d4-default-height"));
|
2329
2334
|
if (u.classList.contains("has-sublayer")) {
|
2330
2335
|
c.stopPropagation();
|
2331
|
-
const
|
2332
|
-
|
2333
|
-
const
|
2334
|
-
s =
|
2336
|
+
const m = u.querySelector(".sub-dropdown"), y = m.querySelector(".sub-dropdown-list"), b = parseInt(getComputedStyle(y).marginTop) + parseInt(getComputedStyle(y).marginBottom);
|
2337
|
+
m.style.cssText = `--height: ${y.offsetHeight + b}px`;
|
2338
|
+
const T = parseInt(m.style.cssText.replace("--height:", "").trim()), G = parseInt(getComputedStyle(a).maxHeight), D = () => {
|
2339
|
+
s = v + e.s.subDropdownTotalH, o = s > G ? G : s, e.style.cssText = `--maxHeight: ${o}px;`, e.s.dropdownEl.style.height = `${o}px`;
|
2335
2340
|
};
|
2336
|
-
u.classList.contains("open") ? (u.classList.remove("open"), e.s.subDropdownTotalH -=
|
2341
|
+
u.classList.contains("open") ? (u.classList.remove("open"), e.s.subDropdownTotalH -= T, D()) : (u.classList.add("open"), e.s.subDropdownTotalH += T, D());
|
2337
2342
|
const R = () => {
|
2338
|
-
e.__scroller__.update(!0),
|
2343
|
+
e.__scroller__.update(!0), m.removeEventListener("transitionend", R);
|
2339
2344
|
};
|
2340
|
-
|
2345
|
+
m.addEventListener("transitionend", R);
|
2341
2346
|
} else
|
2342
2347
|
switch (Os(e), e.s.selectType) {
|
2343
2348
|
case "single":
|
2344
2349
|
if (e.setAttribute("d4-value", u.getAttribute("data-option")), r) {
|
2345
|
-
const
|
2346
|
-
|
2347
|
-
const
|
2348
|
-
|
2349
|
-
}), e.__events__.selectOption(
|
2350
|
+
const m = e.s.cityLang, y = l.textContent.trim(), b = document.getElementById(e.getAttribute("dist-select"));
|
2351
|
+
b && (b.querySelector(".dropdown-list").textContent = "", C(b, -1), Oe[m][y].forEach((T, G) => {
|
2352
|
+
const D = document.createElement("li");
|
2353
|
+
D.textContent = T[0], D.setAttribute("data-option", T[0]), b.querySelector(".dropdown-list").append(D);
|
2354
|
+
}), e.__events__.selectOption(b));
|
2350
2355
|
}
|
2351
|
-
(
|
2356
|
+
(g = u.parentNode.closest("li")) != null && g.classList.contains("has-sublayer") && (c.stopPropagation(), e.close());
|
2352
2357
|
break;
|
2353
2358
|
case "multiple":
|
2354
|
-
c.stopPropagation(), u.classList.toggle("active"),
|
2359
|
+
c.stopPropagation(), u.classList.toggle("active"), C(e, p);
|
2355
2360
|
break;
|
2356
2361
|
}
|
2357
2362
|
});
|
@@ -2386,7 +2391,7 @@ It = new WeakSet(), $i = function() {
|
|
2386
2391
|
};
|
2387
2392
|
Object.assign(ki.prototype, O);
|
2388
2393
|
customElements.define("dropdown-el", ki);
|
2389
|
-
function
|
2394
|
+
function dt(n) {
|
2390
2395
|
const i = {};
|
2391
2396
|
return [...n.attributes].forEach((t) => {
|
2392
2397
|
if (t.name.includes("duration-")) {
|
@@ -2396,9 +2401,9 @@ function ct(n) {
|
|
2396
2401
|
}), Object.keys(i).length === 0 ? null : i;
|
2397
2402
|
}
|
2398
2403
|
function Be(n) {
|
2399
|
-
if (
|
2404
|
+
if (dt(n)) {
|
2400
2405
|
let i;
|
2401
|
-
const t = Object.keys(
|
2406
|
+
const t = Object.keys(dt(n)).map((e) => ({
|
2402
2407
|
value: e,
|
2403
2408
|
point: e
|
2404
2409
|
}));
|
@@ -2407,7 +2412,7 @@ function Be(n) {
|
|
2407
2412
|
const { point: s, value: o } = t[e];
|
2408
2413
|
window.matchMedia(`(max-width: ${o}px)`).matches && (i = s);
|
2409
2414
|
}
|
2410
|
-
return i ? Number(
|
2415
|
+
return i ? Number(dt(n)[i]) : n.s.options.duration;
|
2411
2416
|
} else
|
2412
2417
|
return n.s.options.duration;
|
2413
2418
|
}
|
@@ -2422,7 +2427,7 @@ function zs(n) {
|
|
2422
2427
|
}
|
2423
2428
|
n.s.animation = null, n.s.animateEl = a, n.textContent = "", o.append(a), n.append(o), a.clientWidth * 2 + e >= n.clientWidth ? i === "normal" && t && o.append(r()) : n.s.options.continual = !1;
|
2424
2429
|
}
|
2425
|
-
function
|
2430
|
+
function k(n) {
|
2426
2431
|
const { behavior: i, direction: t, continual: e } = n.s.options;
|
2427
2432
|
let s = {};
|
2428
2433
|
switch (i) {
|
@@ -2484,14 +2489,14 @@ function Ws(n) {
|
|
2484
2489
|
i && clearTimeout(i), i = setTimeout(n, 200, t);
|
2485
2490
|
};
|
2486
2491
|
}
|
2487
|
-
var
|
2492
|
+
var zt, Mi, Wt, qi, Bt, Ii, Gt, Oi;
|
2488
2493
|
class Bs extends HTMLElement {
|
2489
2494
|
constructor() {
|
2490
2495
|
super();
|
2491
|
-
h(this, jt);
|
2492
2496
|
h(this, zt);
|
2493
2497
|
h(this, Wt);
|
2494
2498
|
h(this, Bt);
|
2499
|
+
h(this, Gt);
|
2495
2500
|
this.initialize = !1;
|
2496
2501
|
}
|
2497
2502
|
static get observedAttributes() {
|
@@ -2500,7 +2505,7 @@ class Bs extends HTMLElement {
|
|
2500
2505
|
attributeChangedCallback(t, e, s) {
|
2501
2506
|
}
|
2502
2507
|
connectedCallback() {
|
2503
|
-
this.initialize || (this.initialize = !0, d(this,
|
2508
|
+
this.initialize || (this.initialize = !0, d(this, zt, Mi).call(this));
|
2504
2509
|
}
|
2505
2510
|
play() {
|
2506
2511
|
this.s.animation.play(), this.s.animateEl.classList.add("start"), this.s.options.continual && (this.s.cloneAnimation.play(), this.s.cloneAnimateEl.classList.add("start"));
|
@@ -2509,25 +2514,25 @@ class Bs extends HTMLElement {
|
|
2509
2514
|
this.s.animation.pause(), this.s.options.continual && this.s.cloneAnimation.pause();
|
2510
2515
|
}
|
2511
2516
|
}
|
2512
|
-
|
2517
|
+
zt = new WeakSet(), Mi = function() {
|
2513
2518
|
const t = {
|
2514
|
-
direction: this.getAttribute("direction") ||
|
2519
|
+
direction: this.getAttribute("direction") || x.SETTINGS.direction,
|
2515
2520
|
// up / down / left / right
|
2516
|
-
behavior: this.getAttribute("behavior") ||
|
2521
|
+
behavior: this.getAttribute("behavior") || x.SETTINGS.behavior,
|
2517
2522
|
// normal / alternate / endStop
|
2518
|
-
duration: Number(this.getAttribute("duration")) ||
|
2523
|
+
duration: Number(this.getAttribute("duration")) || x.SETTINGS.duration,
|
2519
2524
|
// ms
|
2520
|
-
durationBreakpoints:
|
2521
|
-
autoplay: this.getAttribute("autoplay") ||
|
2525
|
+
durationBreakpoints: dt(this) || x.SETTINGS.durationBreakpoints,
|
2526
|
+
autoplay: this.getAttribute("autoplay") || x.SETTINGS.autoplay,
|
2522
2527
|
// normal / alternate / endStop
|
2523
|
-
pauseOnMouseenter: this.getAttribute("pauseOnMouseEnter") ? this.getAttribute("pauseOnMouseEnter") === "true" :
|
2528
|
+
pauseOnMouseenter: this.getAttribute("pauseOnMouseEnter") ? this.getAttribute("pauseOnMouseEnter") === "true" : x.SETTINGS.pauseOnMouseenter,
|
2524
2529
|
// true / false
|
2525
|
-
continual: this.getAttribute("continual") ? this.getAttribute("continual") === "true" :
|
2530
|
+
continual: this.getAttribute("continual") ? this.getAttribute("continual") === "true" : x.SETTINGS.continual,
|
2526
2531
|
// true / false
|
2527
|
-
gap: Number(this.getAttribute("gap")) ||
|
2532
|
+
gap: Number(this.getAttribute("gap")) || x.SETTINGS.gap
|
2528
2533
|
};
|
2529
|
-
this.s = {}, this.s.options = t, this.s.nowDuration = Be(this), zs(this), d(this,
|
2530
|
-
},
|
2534
|
+
this.s = {}, this.s.options = t, this.s.nowDuration = Be(this), zs(this), d(this, Wt, qi).call(this);
|
2535
|
+
}, Wt = new WeakSet(), qi = function() {
|
2531
2536
|
const { direction: t, continual: e, gap: s } = this.s.options;
|
2532
2537
|
switch (t) {
|
2533
2538
|
case "left":
|
@@ -2539,46 +2544,46 @@ jt = new WeakSet(), Mi = function() {
|
|
2539
2544
|
e ? this.style.cssText = `height: ${this.s.animateEl.clientHeight}px;--continual-gap: ${s}px;` : this.style.cssText = `min-height: ${this.s.animateEl.clientHeight}px;--continual-gap: ${s}px;`;
|
2540
2545
|
break;
|
2541
2546
|
}
|
2542
|
-
d(this,
|
2543
|
-
},
|
2547
|
+
d(this, Bt, Ii).call(this), d(this, Gt, Oi).call(this), e && this.classList.add("continual"), this.classList.add("m4-initialize");
|
2548
|
+
}, Bt = new WeakSet(), Ii = function() {
|
2544
2549
|
const t = this, { direction: e, behavior: s, duration: o, autoplay: a, pauseOnMouseenter: r, continual: l } = t.s.options;
|
2545
2550
|
let c;
|
2546
2551
|
function u() {
|
2547
2552
|
switch (s) {
|
2548
2553
|
case "normal":
|
2549
|
-
t.s.animateEl.style.transform = `${
|
2554
|
+
t.s.animateEl.style.transform = `${k(t).animate1[0].transform}`, t.s.animation = t.s.animateEl.animate(k(t).animate1, {
|
2550
2555
|
duration: t.s.nowDuration,
|
2551
2556
|
iterations: 1 / 0
|
2552
|
-
}), l && (t.s.cloneAnimateEl.style.transform = `${
|
2557
|
+
}), l && (t.s.cloneAnimateEl.style.transform = `${k(t).animate2[0].transform}`, t.s.cloneAnimation = t.s.cloneAnimateEl.animate(k(t).animate2, {
|
2553
2558
|
duration: t.s.nowDuration,
|
2554
2559
|
delay: -t.s.nowDuration / 2,
|
2555
2560
|
iterations: 1 / 0
|
2556
2561
|
}));
|
2557
2562
|
break;
|
2558
2563
|
case "alternate":
|
2559
|
-
let
|
2560
|
-
let
|
2564
|
+
let g = function() {
|
2565
|
+
let m = [];
|
2561
2566
|
switch (e) {
|
2562
2567
|
case "top":
|
2563
|
-
p = Math.abs(t.s.animateEl.scrollHeight - t.clientHeight),
|
2568
|
+
p = Math.abs(t.s.animateEl.scrollHeight - t.clientHeight), v = parseInt(t.s.nowDuration / (p * 2)) * t.s.animateEl.scrollHeight, m = [{ transform: `translate3d(0,${t.clientHeight}px,0)` }, { transform: `translate3d(0,calc(${t.clientHeight}px - 100%),0)` }];
|
2564
2569
|
break;
|
2565
2570
|
case "right":
|
2566
|
-
p = Math.abs(t.s.animateEl.scrollWidth - t.clientWidth),
|
2571
|
+
p = Math.abs(t.s.animateEl.scrollWidth - t.clientWidth), v = parseInt(t.s.nowDuration / (p * 2)) * t.s.animateEl.scrollWidth, m = [{ transform: "translate3d(-100%,0,0)" }, { transform: "translate3d(0,0,0)" }];
|
2567
2572
|
break;
|
2568
2573
|
case "bottom":
|
2569
|
-
p = Math.abs(t.s.animateEl.scrollHeight - t.clientHeight),
|
2574
|
+
p = Math.abs(t.s.animateEl.scrollHeight - t.clientHeight), v = parseInt(o / (p * 2)) * t.s.animateEl.scrollHeight, m = [{ transform: "translate3d(0,-100%,0)" }, { transform: "translate3d(0,0,0)" }];
|
2570
2575
|
break;
|
2571
2576
|
case "left":
|
2572
|
-
p = Math.abs(t.s.animateEl.scrollWidth - t.clientWidth),
|
2577
|
+
p = Math.abs(t.s.animateEl.scrollWidth - t.clientWidth), v = parseInt(o / (p * 2)) * t.s.animateEl.scrollWidth, m = [{ transform: `translate3d(${t.clientWidth}px,0,0)` }, { transform: `translate3d(calc(-100% + ${t.clientWidth}px),0,0)` }];
|
2573
2578
|
break;
|
2574
2579
|
}
|
2575
|
-
return
|
2576
|
-
}, p,
|
2577
|
-
(t.clientHeight > t.s.animateEl.scrollHeight || e === "left" || e === "right") && (t.s.animateEl.style.transform = `${
|
2578
|
-
duration:
|
2580
|
+
return m;
|
2581
|
+
}, p, v;
|
2582
|
+
(t.clientHeight > t.s.animateEl.scrollHeight || e === "left" || e === "right") && (t.s.animateEl.style.transform = `${g()[0].transform}`, t.s.animateEl.animate(g(), {
|
2583
|
+
duration: v,
|
2579
2584
|
fill: "forwards"
|
2580
2585
|
}).finished.then(() => {
|
2581
|
-
t.s.animation = t.s.animateEl.animate(
|
2586
|
+
t.s.animation = t.s.animateEl.animate(k(t).animate1, {
|
2582
2587
|
duration: t.s.nowDuration,
|
2583
2588
|
iterations: 1 / 0
|
2584
2589
|
});
|
@@ -2587,7 +2592,7 @@ jt = new WeakSet(), Mi = function() {
|
|
2587
2592
|
});
|
2588
2593
|
break;
|
2589
2594
|
case "endStop":
|
2590
|
-
t.s.animateEl.style.transform = `${
|
2595
|
+
t.s.animateEl.style.transform = `${k(t).animate1[0].transform}`, t.s.animation = t.s.animateEl.animate(k(t).animate1, {
|
2591
2596
|
duration: t.s.nowDuration,
|
2592
2597
|
fill: "forwards"
|
2593
2598
|
});
|
@@ -2605,14 +2610,14 @@ jt = new WeakSet(), Mi = function() {
|
|
2605
2610
|
}), t.addEventListener("mouseleave", function() {
|
2606
2611
|
t.s.animation && r && t.s.animation.playState === "paused" && t.play();
|
2607
2612
|
});
|
2608
|
-
},
|
2613
|
+
}, Gt = new WeakSet(), Oi = function() {
|
2609
2614
|
const t = this;
|
2610
2615
|
function e() {
|
2611
2616
|
const s = t.s.animation.startTime, o = t.s.cloneAnimation ? t.s.cloneAnimation.startTime : null;
|
2612
|
-
t.s.nowDuration = Be(t), t.s.animation.cancel(), t.s.cloneAnimation && t.s.cloneAnimation.cancel(), t.s.animation = t.s.animateEl.animate(
|
2617
|
+
t.s.nowDuration = Be(t), t.s.animation.cancel(), t.s.cloneAnimation && t.s.cloneAnimation.cancel(), t.s.animation = t.s.animateEl.animate(k(t).animate1, {
|
2613
2618
|
duration: t.s.nowDuration,
|
2614
2619
|
iterations: 1 / 0
|
2615
|
-
}), t.s.animation.startTime = s, t.s.cloneAnimation && (t.s.cloneAnimation = t.s.cloneAnimateEl.animate(
|
2620
|
+
}), t.s.animation.startTime = s, t.s.cloneAnimation && (t.s.cloneAnimation = t.s.cloneAnimateEl.animate(k(t).animate2, {
|
2616
2621
|
duration: t.s.nowDuration,
|
2617
2622
|
delay: -t.s.nowDuration / 2,
|
2618
2623
|
iterations: 1 / 0
|
@@ -2621,12 +2626,12 @@ jt = new WeakSet(), Mi = function() {
|
|
2621
2626
|
window.addEventListener("resize", Ws(e));
|
2622
2627
|
};
|
2623
2628
|
customElements.define("marquee-el", Bs);
|
2624
|
-
const
|
2629
|
+
const pt = function(n, i) {
|
2625
2630
|
let t;
|
2626
2631
|
return function(e) {
|
2627
2632
|
t && clearTimeout(t), t = setTimeout(n, 200, e);
|
2628
2633
|
};
|
2629
|
-
},
|
2634
|
+
}, $ = (n, i) => {
|
2630
2635
|
if (rt(n)) {
|
2631
2636
|
n.forEach((t) => {
|
2632
2637
|
t.classList.add(i);
|
@@ -2634,7 +2639,7 @@ const ht = function(n, i) {
|
|
2634
2639
|
return;
|
2635
2640
|
}
|
2636
2641
|
n.classList.add(i);
|
2637
|
-
},
|
2642
|
+
}, _ = (n, i) => {
|
2638
2643
|
if (rt(n)) {
|
2639
2644
|
n.forEach((t) => {
|
2640
2645
|
t.classList.remove(i);
|
@@ -2643,22 +2648,22 @@ const ht = function(n, i) {
|
|
2643
2648
|
}
|
2644
2649
|
n.classList.remove(i);
|
2645
2650
|
};
|
2646
|
-
var
|
2651
|
+
var Rt, Ni, Xt, Pi, Ft, ji, tt, _e, W, ut, Yt, zi;
|
2647
2652
|
class Ge {
|
2648
2653
|
constructor(i) {
|
2649
2654
|
// 初始化
|
2650
|
-
h(this, Gt);
|
2651
|
-
// 左右箭頭事件綁定
|
2652
2655
|
h(this, Rt);
|
2653
|
-
//
|
2656
|
+
// 左右箭頭事件綁定
|
2654
2657
|
h(this, Xt);
|
2658
|
+
// 左右拖拉事件綁定
|
2659
|
+
h(this, Ft);
|
2655
2660
|
// 卷軸位置判斷
|
2656
2661
|
h(this, tt);
|
2657
2662
|
// 隱藏按鈕判斷
|
2658
2663
|
h(this, W);
|
2659
2664
|
// 選項事件綁定
|
2660
|
-
h(this,
|
2661
|
-
this.$element = i, this.option = i.s.option.drag, d(this,
|
2665
|
+
h(this, Yt);
|
2666
|
+
this.$element = i, this.option = i.s.option.drag, d(this, Rt, Ni).call(this);
|
2662
2667
|
}
|
2663
2668
|
// 更新 active 位置
|
2664
2669
|
update(i) {
|
@@ -2672,7 +2677,7 @@ class Ge {
|
|
2672
2677
|
}
|
2673
2678
|
}
|
2674
2679
|
}
|
2675
|
-
|
2680
|
+
Rt = new WeakSet(), Ni = function() {
|
2676
2681
|
var e, s, o, a, r, l;
|
2677
2682
|
const i = this;
|
2678
2683
|
if (!i.$element)
|
@@ -2680,10 +2685,10 @@ Gt = new WeakSet(), Ni = function() {
|
|
2680
2685
|
i.$container = i.$element.querySelector(".drag-container"), i.$wrapper = i.$container.querySelector(".wrapper");
|
2681
2686
|
const t = () => {
|
2682
2687
|
var c, u;
|
2683
|
-
d(c = i, tt, _e).call(c), d(u = i, W,
|
2688
|
+
d(c = i, tt, _e).call(c), d(u = i, W, ut).call(u);
|
2684
2689
|
};
|
2685
|
-
i.$wrapper.removeEventListener("scroll", t), i.$wrapper.addEventListener("scroll", t), window.removeEventListener("resize",
|
2686
|
-
|
2690
|
+
i.$wrapper.removeEventListener("scroll", t), i.$wrapper.addEventListener("scroll", t), window.removeEventListener("resize", pt(t)), window.addEventListener("resize", pt(t)), (i.option.draggable || i.$element.s.type == "collapse") && d(e = i, Ft, ji).call(e), i.option.navigation && i.$element.s.type !== "collapse" && (i.$container.insertAdjacentHTML(
|
2691
|
+
A.prepend,
|
2687
2692
|
`<div class="navigation">
|
2688
2693
|
<div class="button prev">
|
2689
2694
|
<div></div>
|
@@ -2692,8 +2697,8 @@ Gt = new WeakSet(), Ni = function() {
|
|
2692
2697
|
<div></div>
|
2693
2698
|
</div>
|
2694
2699
|
</div>`
|
2695
|
-
), i.$button = (s = i.$container) == null ? void 0 : s.querySelectorAll(".button"), d(o = i,
|
2696
|
-
},
|
2700
|
+
), i.$button = (s = i.$container) == null ? void 0 : s.querySelectorAll(".button"), d(o = i, Xt, Pi).call(o)), d(a = i, tt, _e).call(a), d(r = i, W, ut).call(r), d(l = i, Yt, zi).call(l), i.update();
|
2701
|
+
}, Xt = new WeakSet(), Pi = function() {
|
2697
2702
|
const i = this, { $wrapper: t, $button: e } = i, s = function() {
|
2698
2703
|
const o = this.classList.contains("next"), a = parseInt(t.getBoundingClientRect().width * 0.7);
|
2699
2704
|
t.scrollTo({
|
@@ -2701,13 +2706,13 @@ Gt = new WeakSet(), Ni = function() {
|
|
2701
2706
|
behavior: "smooth"
|
2702
2707
|
}), setTimeout(() => {
|
2703
2708
|
var r;
|
2704
|
-
d(r = i, W,
|
2709
|
+
d(r = i, W, ut).call(r);
|
2705
2710
|
}, 100);
|
2706
2711
|
};
|
2707
2712
|
e.forEach((o) => {
|
2708
2713
|
o.removeEventListener("click", s), o.addEventListener("click", s);
|
2709
2714
|
});
|
2710
|
-
},
|
2715
|
+
}, Ft = new WeakSet(), ji = function() {
|
2711
2716
|
const { $wrapper: i } = this;
|
2712
2717
|
let t = !1, e = !1, s = 0, o = 0;
|
2713
2718
|
const a = function(p) {
|
@@ -2725,9 +2730,9 @@ Gt = new WeakSet(), Ni = function() {
|
|
2725
2730
|
const c = function(p) {
|
2726
2731
|
if (p.preventDefault(), e = !0, !t)
|
2727
2732
|
return;
|
2728
|
-
const
|
2733
|
+
const g = p.pageX - i.offsetLeft - s;
|
2729
2734
|
i.scrollTo({
|
2730
|
-
left: o -
|
2735
|
+
left: o - g
|
2731
2736
|
});
|
2732
2737
|
};
|
2733
2738
|
i.removeEventListener("mousemove", c), i.addEventListener("mousemove", c);
|
@@ -2739,30 +2744,30 @@ Gt = new WeakSet(), Ni = function() {
|
|
2739
2744
|
});
|
2740
2745
|
}, tt = new WeakSet(), _e = function() {
|
2741
2746
|
const { $container: i, $wrapper: t } = this, e = t.scrollWidth - t.clientWidth, s = Math.round(t.scrollLeft);
|
2742
|
-
e <= 0 || (
|
2743
|
-
}, W = new WeakSet(),
|
2747
|
+
e <= 0 || ($(i, "scrollable"), s == 0 ? (_(i, "scrollable"), $(t, "start"), _(t, "end")) : s + 1 >= e ? (_(i, "scrollable"), _(t, "start"), $(t, "end")) : ($(t, "center"), _(t, "start"), _(t, "end")));
|
2748
|
+
}, W = new WeakSet(), ut = function() {
|
2744
2749
|
const { $wrapper: i, $button: t, $element: e } = this;
|
2745
2750
|
if (!t)
|
2746
2751
|
return;
|
2747
2752
|
const s = i.scrollWidth - i.clientWidth, o = i.scrollLeft;
|
2748
2753
|
if (s <= 0) {
|
2749
|
-
|
2754
|
+
$(t, "hide"), _(t, "active"), $(e, "noScrollable");
|
2750
2755
|
return;
|
2751
2756
|
}
|
2752
|
-
s > 0 && (
|
2757
|
+
s > 0 && ($(t, "active"), _(e, "noScrollable")), o == 0 ? t.forEach((a) => {
|
2753
2758
|
if (a.classList.contains("next")) {
|
2754
|
-
|
2759
|
+
_(a, "hide");
|
2755
2760
|
return;
|
2756
2761
|
}
|
2757
|
-
|
2762
|
+
$(a, "hide");
|
2758
2763
|
}) : o + 1 >= s ? t.forEach((a) => {
|
2759
2764
|
if (a.classList.contains("next")) {
|
2760
|
-
|
2765
|
+
$(a, "hide");
|
2761
2766
|
return;
|
2762
2767
|
}
|
2763
|
-
|
2764
|
-
}) :
|
2765
|
-
},
|
2768
|
+
_(a, "hide");
|
2769
|
+
}) : _(t, "hide");
|
2770
|
+
}, Yt = new WeakSet(), zi = function() {
|
2766
2771
|
const { $element: i } = this, t = (s) => {
|
2767
2772
|
if (this.option.selected) {
|
2768
2773
|
const o = s.getAttribute("data-option").trim();
|
@@ -2776,31 +2781,31 @@ Gt = new WeakSet(), Ni = function() {
|
|
2776
2781
|
s.removeEventListener("click", e), s.addEventListener("click", e);
|
2777
2782
|
});
|
2778
2783
|
};
|
2779
|
-
var
|
2784
|
+
var Ut, Wi, Jt, Bi, Zt, Gi, Qt, Ri;
|
2780
2785
|
class Gs {
|
2781
2786
|
constructor(i) {
|
2782
2787
|
// 初始化
|
2783
|
-
h(this, Yt);
|
2784
|
-
// 隱藏按鈕判斷
|
2785
2788
|
h(this, Ut);
|
2786
|
-
//
|
2789
|
+
// 隱藏按鈕判斷
|
2787
2790
|
h(this, Jt);
|
2788
|
-
//
|
2791
|
+
// 展開箭頭事件綁定
|
2789
2792
|
h(this, Zt);
|
2790
|
-
|
2793
|
+
// 選項事件綁定
|
2794
|
+
h(this, Qt);
|
2795
|
+
this.$element = i, this.option = i.s.option.collapse, d(this, Ut, Wi).call(this);
|
2791
2796
|
}
|
2792
2797
|
}
|
2793
|
-
|
2794
|
-
this.$element && (this.$container = this.$element.querySelector(".collapse-container"), this.$wrapper = this.$container.querySelector(".wrapper"), d(this,
|
2795
|
-
},
|
2798
|
+
Ut = new WeakSet(), Wi = function() {
|
2799
|
+
this.$element && (this.$container = this.$element.querySelector(".collapse-container"), this.$wrapper = this.$container.querySelector(".wrapper"), d(this, Jt, Bi).call(this) && d(this, Zt, Gi).call(this), d(this, Qt, Ri).call(this));
|
2800
|
+
}, Jt = new WeakSet(), Bi = function() {
|
2796
2801
|
const i = this.$element.querySelector(".drag-container"), t = i.querySelector(".wrapper");
|
2797
|
-
return t.scrollWidth - t.clientWidth > 0 ? (i.insertAdjacentHTML(
|
2798
|
-
},
|
2802
|
+
return t.scrollWidth - t.clientWidth > 0 ? (i.insertAdjacentHTML(A.append, '<div class="open-collapse"></div>'), this.$button = i.querySelector(".open-collapse"), !0) : !1;
|
2803
|
+
}, Zt = new WeakSet(), Gi = function() {
|
2799
2804
|
const { $element: i, $button: t } = this, e = function() {
|
2800
2805
|
i.classList.contains("expand") ? i.classList.remove("expand") : i.classList.add("expand");
|
2801
2806
|
};
|
2802
2807
|
t.removeEventListener("click", e), t.addEventListener("click", e);
|
2803
|
-
},
|
2808
|
+
}, Qt = new WeakSet(), Ri = function() {
|
2804
2809
|
const { $element: i } = this, t = (s, o) => {
|
2805
2810
|
if (i != null && i.classList.contains("expand") ? i == null || i.classList.remove("expand") : i == null || i.classList.add("expand"), this.option.selected) {
|
2806
2811
|
const a = s.getAttribute("data-option").trim();
|
@@ -2816,14 +2821,14 @@ Yt = new WeakSet(), Wi = function() {
|
|
2816
2821
|
};
|
2817
2822
|
const Rs = (n) => {
|
2818
2823
|
const { type: i, option: t, originalDomString: e } = n.s, s = document.createElement("div");
|
2819
|
-
return i == "drag" && (s.innerHTML =
|
2824
|
+
return i == "drag" && (s.innerHTML = H.TEMPLATE[i]().trim(), s.querySelector(".drag-container .wrapper").insertAdjacentHTML(A.append, e)), i == "collapse" && (s.innerHTML = H.TEMPLATE[i](t == null ? void 0 : t.collapse).trim(), s.querySelector(".drag-container .wrapper").insertAdjacentHTML(A.append, e), s.querySelector(".collapse-container .wrapper").insertAdjacentHTML(A.append, e)), i == "dropdown" && (s.innerHTML = H.TEMPLATE[i](t == null ? void 0 : t.dropdown).trim(), s.querySelector("dropdown-el").insertAdjacentHTML(A.append, e)), s.children;
|
2820
2825
|
};
|
2821
|
-
var
|
2826
|
+
var Vt, Xi, Kt, Fi, et, ke, B, ht;
|
2822
2827
|
class Xs extends HTMLElement {
|
2823
2828
|
constructor() {
|
2824
2829
|
super();
|
2825
|
-
h(this, Qt);
|
2826
2830
|
h(this, Vt);
|
2831
|
+
h(this, Kt);
|
2827
2832
|
// 斷點設定
|
2828
2833
|
h(this, et);
|
2829
2834
|
// check type
|
@@ -2839,7 +2844,7 @@ class Xs extends HTMLElement {
|
|
2839
2844
|
case "m4-type":
|
2840
2845
|
if (e === null || e === s)
|
2841
2846
|
return;
|
2842
|
-
this.s.type = s, d(this, B,
|
2847
|
+
this.s.type = s, d(this, B, ht).call(this);
|
2843
2848
|
break;
|
2844
2849
|
case "m4-status":
|
2845
2850
|
if (e === s)
|
@@ -2856,15 +2861,15 @@ class Xs extends HTMLElement {
|
|
2856
2861
|
}
|
2857
2862
|
}
|
2858
2863
|
connectedCallback() {
|
2859
|
-
this.initialize || this.classList.contains("m4-init") || (this.initialize = !0, d(this,
|
2864
|
+
this.initialize || this.classList.contains("m4-init") || (this.initialize = !0, d(this, Vt, Xi).call(this));
|
2860
2865
|
}
|
2861
2866
|
update() {
|
2862
2867
|
d(this, et, ke).call(this);
|
2863
2868
|
}
|
2864
2869
|
}
|
2865
|
-
|
2870
|
+
Vt = new WeakSet(), Xi = function() {
|
2866
2871
|
let t = {};
|
2867
|
-
this.hasAttribute("m4-value") || this.setAttribute("m4-value", ""), this.s.type = this.getAttribute("m4-type") ??
|
2872
|
+
this.hasAttribute("m4-value") || this.setAttribute("m4-value", ""), this.s.type = this.getAttribute("m4-type") ?? H.SETTINGS.type, this.hasAttribute("m4-option") && (t = this.getAttribute("m4-option") ? JSON.parse(this.getAttribute("m4-option")) : {}, this.removeAttribute("m4-option"));
|
2868
2873
|
const e = (s) => {
|
2869
2874
|
if (s.type === "resize") {
|
2870
2875
|
if (window.innerWidth === this.previousWidth)
|
@@ -2873,20 +2878,20 @@ Qt = new WeakSet(), Xi = function() {
|
|
2873
2878
|
}
|
2874
2879
|
this.update();
|
2875
2880
|
};
|
2876
|
-
window.removeEventListener("resize",
|
2877
|
-
},
|
2881
|
+
window.removeEventListener("resize", pt(e)), window.addEventListener("resize", pt(e)), this.s.option = {}, this.s.option.drag = Object.assign({}, H.SETTINGS.drag, t == null ? void 0 : t.drag), this.s.option.collapse = Object.assign({}, H.SETTINGS.collapse, t == null ? void 0 : t.collapse), this.s.option.dropdown = Object.assign({}, H.SETTINGS.dropdown, t == null ? void 0 : t.dropdown), this.s.option.breakpoint = Object.assign({}, H.SETTINGS.breakpoint, t == null ? void 0 : t.breakpoint), d(this, Kt, Fi).call(this);
|
2882
|
+
}, Kt = new WeakSet(), Fi = function() {
|
2878
2883
|
this.classList.add("m4-init"), d(this, et, ke).call(this);
|
2879
2884
|
}, et = new WeakSet(), ke = function() {
|
2880
2885
|
const t = Object.keys(this.s.option.breakpoint);
|
2881
2886
|
if (!t.length) {
|
2882
|
-
d(this, B,
|
2887
|
+
d(this, B, ht).call(this);
|
2883
2888
|
return;
|
2884
2889
|
}
|
2885
2890
|
t.map((e) => Number(e)).sort((e, s) => s - e).some((e) => {
|
2886
2891
|
var s, o, a, r;
|
2887
|
-
return window.innerWidth >= e && (this.s.type = (s = this.s.option.breakpoint[e]) == null ? void 0 : s.type, this.setAttribute("m4-type", this.s.type), this.s.option.drag = Object.assign({}, this.s.option.drag, (o = this.s.option.breakpoint[e]) == null ? void 0 : o.drag), this.s.option.collapse = Object.assign({}, this.s.option.collapse, (a = this.s.option.breakpoint[e]) == null ? void 0 : a.collapse), this.s.option.dropdown = Object.assign({}, this.s.option.dropdown, (r = this.s.option.breakpoint[e]) == null ? void 0 : r.dropdown)), d(this, B,
|
2892
|
+
return window.innerWidth >= e && (this.s.type = (s = this.s.option.breakpoint[e]) == null ? void 0 : s.type, this.setAttribute("m4-type", this.s.type), this.s.option.drag = Object.assign({}, this.s.option.drag, (o = this.s.option.breakpoint[e]) == null ? void 0 : o.drag), this.s.option.collapse = Object.assign({}, this.s.option.collapse, (a = this.s.option.breakpoint[e]) == null ? void 0 : a.collapse), this.s.option.dropdown = Object.assign({}, this.s.option.dropdown, (r = this.s.option.breakpoint[e]) == null ? void 0 : r.dropdown)), d(this, B, ht).call(this), window.innerWidth >= e;
|
2888
2893
|
});
|
2889
|
-
}, B = new WeakSet(),
|
2894
|
+
}, B = new WeakSet(), ht = function() {
|
2890
2895
|
var o;
|
2891
2896
|
const { type: t } = this.s;
|
2892
2897
|
this.innerHTML = "", [...Rs(this)].forEach((a) => {
|
@@ -2908,53 +2913,53 @@ Qt = new WeakSet(), Xi = function() {
|
|
2908
2913
|
(o = this.constructor.drag) == null || o.update(this);
|
2909
2914
|
};
|
2910
2915
|
customElements.define("multipurpose-nav", Xs);
|
2911
|
-
var
|
2916
|
+
var te, Ui, ee, Ji, it, $e, P, F, ie, Zi, se, Qi, ne, Vi, oe, Ki, ae, ts, re, es, le, is, ce, ss, de, ns, q, z, ue, os, he, as, pe, rs, me, ls;
|
2912
2917
|
class Yi extends HTMLElement {
|
2913
2918
|
// 定義組件的初始狀態
|
2914
2919
|
constructor(t, e) {
|
2915
2920
|
super();
|
2916
|
-
h(this, Kt);
|
2917
2921
|
h(this, te);
|
2922
|
+
h(this, ee);
|
2918
2923
|
// 第一關 判斷數量以及id設定
|
2919
2924
|
h(this, it);
|
2920
2925
|
// 第二關 id命名提醒
|
2921
2926
|
h(this, P);
|
2922
|
-
h(this, ee);
|
2923
2927
|
h(this, ie);
|
2924
2928
|
h(this, se);
|
2929
|
+
h(this, ne);
|
2925
2930
|
// 執行函式
|
2926
2931
|
// 移動至指定位置
|
2927
|
-
h(this, ne);
|
2928
|
-
// 移動
|
2929
2932
|
h(this, oe);
|
2930
|
-
//
|
2933
|
+
// 移動
|
2931
2934
|
h(this, ae);
|
2932
|
-
//
|
2935
|
+
// 步驟狀態
|
2933
2936
|
h(this, re);
|
2934
|
-
//
|
2937
|
+
// next 按鈕狀態
|
2935
2938
|
h(this, le);
|
2936
|
-
//
|
2939
|
+
// prev 按鈕狀態
|
2937
2940
|
h(this, ce);
|
2941
|
+
// 頁籤狀態
|
2942
|
+
h(this, de);
|
2938
2943
|
// 第三關各種元件判斷 及 執行
|
2939
2944
|
h(this, q);
|
2940
2945
|
// 消失動畫
|
2941
|
-
h(this, de);
|
2942
|
-
// 出現動畫
|
2943
2946
|
h(this, ue);
|
2944
|
-
//
|
2947
|
+
// 出現動畫
|
2945
2948
|
h(this, he);
|
2946
|
-
//
|
2949
|
+
// 狀態
|
2947
2950
|
h(this, pe);
|
2951
|
+
// resize
|
2952
|
+
h(this, me);
|
2948
2953
|
}
|
2949
2954
|
// 當組件的屬性被更改時會被呼叫
|
2950
2955
|
static get observedAttributes() {
|
2951
2956
|
return ["t4-active"];
|
2952
2957
|
}
|
2953
2958
|
attributeChangedCallback(t, e, s) {
|
2954
|
-
t === "t4-active" && e !== s && d(this,
|
2959
|
+
t === "t4-active" && e !== s && d(this, pe, rs).call(this, s);
|
2955
2960
|
}
|
2956
2961
|
connectedCallback() {
|
2957
|
-
this.classList.contains("t4-initialize") || d(this,
|
2962
|
+
this.classList.contains("t4-initialize") || d(this, te, Ui).call(this);
|
2958
2963
|
}
|
2959
2964
|
// ------------- 我是分隔線呦 -------------
|
2960
2965
|
// 頁籤切換
|
@@ -2970,7 +2975,7 @@ class Yi extends HTMLElement {
|
|
2970
2975
|
e.activeTab = s, this.setAttribute("t4-active", s);
|
2971
2976
|
const o = d(this, P, F).call(this, s);
|
2972
2977
|
e.tabPanels.forEach((a, r) => {
|
2973
|
-
r === o ? d(this,
|
2978
|
+
r === o ? d(this, he, as).call(this, r) : d(this, ue, os).call(this, r);
|
2974
2979
|
});
|
2975
2980
|
}
|
2976
2981
|
// 外部呼叫方法 $0.goNext()
|
@@ -2988,7 +2993,7 @@ class Yi extends HTMLElement {
|
|
2988
2993
|
this.t.tabs = d(this, it, $e).call(this), cs(), console.log("tab update!!!!");
|
2989
2994
|
}
|
2990
2995
|
}
|
2991
|
-
|
2996
|
+
te = new WeakSet(), Ui = function() {
|
2992
2997
|
const t = this.getAttribute("t4-name"), { SETTINGS: e } = Ue;
|
2993
2998
|
document.querySelectorAll(`tab-el[t4-name=${t}]`).length > 1 && console.warn(t, "名字有重複喔!!!"), this.t = {
|
2994
2999
|
tabs: [],
|
@@ -3008,13 +3013,13 @@ Kt = new WeakSet(), Ui = function() {
|
|
3008
3013
|
delay: this.getAttribute("t4-delay") || e.transition.delay
|
3009
3014
|
},
|
3010
3015
|
tabGroup: this.getAttribute("t4-group") || e.tabGroup
|
3011
|
-
}, this.__events__ = {}, this.t.tabs = d(this, it, $e).call(this), this.t.step = document.querySelector(`[t4-control="${this.t.name}"]${this.t.stepOutput}`), d(this,
|
3012
|
-
},
|
3013
|
-
if (this.t.activeTab = this.t.defaultPage, this.t.display === "swiper" && d(this,
|
3016
|
+
}, this.__events__ = {}, this.t.tabs = d(this, it, $e).call(this), this.t.step = document.querySelector(`[t4-control="${this.t.name}"]${this.t.stepOutput}`), d(this, ee, Ji).call(this);
|
3017
|
+
}, ee = new WeakSet(), Ji = function() {
|
3018
|
+
if (this.t.activeTab = this.t.defaultPage, this.t.display === "swiper" && d(this, ie, Zi).call(this), this.t.recordUrl) {
|
3014
3019
|
const e = new URLSearchParams(document.location.search).get(this.t.name), s = document.querySelectorAll(`[t4-name="${this.t.name}"] .tab-panel[t4-id="${e}"]`);
|
3015
3020
|
e && s.length === 1 ? this.t.activeTab = e : console.warn(`沒有${e}這頁喔!!`);
|
3016
3021
|
}
|
3017
|
-
this.setActiveTab(this.t.activeTab), this.classList.add("t4-initialize"), d(this,
|
3022
|
+
this.setActiveTab(this.t.activeTab), this.classList.add("t4-initialize"), d(this, me, ls).call(this);
|
3018
3023
|
}, it = new WeakSet(), $e = function() {
|
3019
3024
|
const { t } = this, e = Array.from(document.querySelectorAll(`[t4-control="${t.name}"][t4-role="tab"]`));
|
3020
3025
|
return t.type === "normal" && t.tabGroup === "true" && t.tabPanels.length !== e.length && console.warn("按鈕與內容數量不同喔", t.tabPanels.length, e.length), t.tabGroup === "true" ? t.tabPanels.forEach((s, o) => s.setAttribute("t4-id", o)) : t.tabPanels.forEach((s) => {
|
@@ -3025,19 +3030,19 @@ Kt = new WeakSet(), Ui = function() {
|
|
3025
3030
|
s.length > 1 && console.warn("有兩個相同id設定", s);
|
3026
3031
|
const o = s[0];
|
3027
3032
|
return o ? e.tabPanels.indexOf(o) : (console.warn(`找不到t4-id為${t}的頁籤`), 0);
|
3028
|
-
},
|
3033
|
+
}, ie = new WeakSet(), Zi = function() {
|
3029
3034
|
const t = document.createElement("div");
|
3030
3035
|
t.classList.add("swiper-container");
|
3031
3036
|
const e = document.createElement("div");
|
3032
3037
|
e.classList.add("swiper-wrapper"), this.t.tabPanels.forEach((s) => {
|
3033
3038
|
e.appendChild(s.cloneNode(!0));
|
3034
|
-
}), this.t.tabPanels = [...e.children], t.appendChild(e), this.innerHTML = "", this.appendChild(t), d(this,
|
3035
|
-
},
|
3039
|
+
}), this.t.tabPanels = [...e.children], t.appendChild(e), this.innerHTML = "", this.appendChild(t), d(this, se, Qi).call(this);
|
3040
|
+
}, se = new WeakSet(), Qi = function() {
|
3036
3041
|
const t = this.querySelector(".swiper-container"), e = this.querySelector(".swiper-wrapper"), s = this.t.tabPanels;
|
3037
3042
|
t.style.overflow = "hidden", e.style.display = "flex";
|
3038
3043
|
const o = s.length * 100 + "%";
|
3039
3044
|
e.style.width = o;
|
3040
|
-
},
|
3045
|
+
}, ne = new WeakSet(), Vi = function(t) {
|
3041
3046
|
const { t: e } = this;
|
3042
3047
|
if (e.recordUrl === "true") {
|
3043
3048
|
const s = new URLSearchParams(document.location.search);
|
@@ -3045,28 +3050,28 @@ Kt = new WeakSet(), Ui = function() {
|
|
3045
3050
|
const o = `${window.location.pathname}?${s.toString()}`;
|
3046
3051
|
history.replaceState({ t4Id: t }, "", o);
|
3047
3052
|
}
|
3048
|
-
},
|
3053
|
+
}, oe = new WeakSet(), Ki = function() {
|
3049
3054
|
const t = parseInt(this.t.gap, 10), e = window.pageYOffset, o = this.getBoundingClientRect().top + e - t;
|
3050
|
-
d(this,
|
3051
|
-
},
|
3055
|
+
d(this, ae, ts).call(this, o);
|
3056
|
+
}, ae = new WeakSet(), ts = function(t) {
|
3052
3057
|
window.scrollTo({
|
3053
3058
|
top: t,
|
3054
3059
|
behavior: "smooth"
|
3055
3060
|
});
|
3056
|
-
},
|
3061
|
+
}, re = new WeakSet(), es = function(t) {
|
3057
3062
|
let e = parseInt(t, 10) + 1;
|
3058
3063
|
this.t.step.textContent = `${e}`, this.t.step.setAttribute("now-page", e);
|
3059
|
-
},
|
3064
|
+
}, le = new WeakSet(), is = function(t) {
|
3060
3065
|
const e = document.querySelectorAll(`[t4-role="next"][t4-control="${this.t.name}"]`), s = this.t.tabPanels.length === 1, o = t === this.t.tabPanels.length - 1;
|
3061
3066
|
e.forEach((a) => {
|
3062
3067
|
s || o ? a.setAttribute("disabled", "") : a.removeAttribute("disabled");
|
3063
3068
|
});
|
3064
|
-
},
|
3069
|
+
}, ce = new WeakSet(), ss = function(t) {
|
3065
3070
|
const e = document.querySelectorAll(`[t4-role="prev"][t4-control="${this.t.name}"]`), s = this.t.tabPanels.length === 1, o = t === 0;
|
3066
3071
|
e.forEach((a) => {
|
3067
3072
|
s || o ? a.setAttribute("disabled", "") : a.removeAttribute("disabled");
|
3068
3073
|
});
|
3069
|
-
},
|
3074
|
+
}, de = new WeakSet(), ns = function(t, e) {
|
3070
3075
|
this.t.tabGroup === "true" ? this.t.tabs.forEach((s, o) => {
|
3071
3076
|
o == t ? s.setAttribute("aria-selected", !0) : s.setAttribute("aria-selected", !1);
|
3072
3077
|
}) : this.t.tabs.forEach((s, o) => {
|
@@ -3075,25 +3080,25 @@ Kt = new WeakSet(), Ui = function() {
|
|
3075
3080
|
}, q = new WeakSet(), z = function(t, e, s) {
|
3076
3081
|
switch (t) {
|
3077
3082
|
case "step":
|
3078
|
-
|
3083
|
+
we(this.t.step) && d(this, re, es).call(this, e);
|
3079
3084
|
break;
|
3080
3085
|
case "eventAnchor":
|
3081
|
-
this.t.anchor && d(this,
|
3086
|
+
this.t.anchor && d(this, oe, Ki).call(this);
|
3082
3087
|
break;
|
3083
3088
|
case "tabState":
|
3084
|
-
this.t.type == "normal" && d(this,
|
3089
|
+
this.t.type == "normal" && d(this, de, ns).call(this, e, s);
|
3085
3090
|
break;
|
3086
3091
|
case "btnState":
|
3087
|
-
d(this,
|
3092
|
+
d(this, le, is).call(this, e), d(this, ce, ss).call(this, e);
|
3088
3093
|
break;
|
3089
3094
|
case "tabUrl":
|
3090
|
-
this.t.recordUrl === "true" && d(this,
|
3095
|
+
this.t.recordUrl === "true" && d(this, ne, Vi).call(this, e);
|
3091
3096
|
break;
|
3092
3097
|
default:
|
3093
3098
|
console.warn("請增加判斷,謝謝");
|
3094
3099
|
break;
|
3095
3100
|
}
|
3096
|
-
},
|
3101
|
+
}, ue = new WeakSet(), os = function(t) {
|
3097
3102
|
const { t: e } = this;
|
3098
3103
|
this.t.transition;
|
3099
3104
|
const s = e.tabPanels[t];
|
@@ -3110,7 +3115,7 @@ Kt = new WeakSet(), Ui = function() {
|
|
3110
3115
|
s.style.display = "none";
|
3111
3116
|
break;
|
3112
3117
|
}
|
3113
|
-
},
|
3118
|
+
}, he = new WeakSet(), as = function(t) {
|
3114
3119
|
const { duration: e, timing: s, delay: o } = this.t.transition, a = this.t.tabPanels[t];
|
3115
3120
|
let r;
|
3116
3121
|
switch (a.classList.add("show"), a.classList.remove("hide"), a.style.transition = `opacity ${e}ms ${s} ${o}ms`, a.style.display = "block", this.t.display) {
|
@@ -3135,10 +3140,10 @@ Kt = new WeakSet(), Ui = function() {
|
|
3135
3140
|
console.warn(this.t.display, "沒有這個效果請自己想辦法!!!!");
|
3136
3141
|
break;
|
3137
3142
|
}
|
3138
|
-
},
|
3143
|
+
}, pe = new WeakSet(), rs = function(t) {
|
3139
3144
|
const e = d(this, P, F).call(this, t);
|
3140
3145
|
d(this, q, z).call(this, "step", e), d(this, q, z).call(this, "btnState", e), d(this, q, z).call(this, "tabState", e, t), d(this, q, z).call(this, "tabUrl", t), this.emit("change");
|
3141
|
-
},
|
3146
|
+
}, me = new WeakSet(), ls = function() {
|
3142
3147
|
const t = this;
|
3143
3148
|
window.addEventListener(
|
3144
3149
|
"resize",
|
@@ -3193,14 +3198,14 @@ const Re = (n) => {
|
|
3193
3198
|
const { defaultOptions: i } = n.collapse, { collapseClass: t, target: e, transition: s } = i, o = n.querySelector(e), a = o.children[0].offsetHeight;
|
3194
3199
|
n.collapse.height = a, n.classList.remove(t), o.style.display = "block", o.style.height = `${a}px`, o.style["transition-property"] = s.property, o.style["transition-duration"] = s.duration, o.style["transition-timing-function"] = s.function, o.style["transition-delay"] = s.delay, o.style.overflow = "hidden";
|
3195
3200
|
};
|
3196
|
-
var st, xe,
|
3201
|
+
var st, xe, ge, ds, fe, us, nt, Ce;
|
3197
3202
|
class Us {
|
3198
3203
|
constructor(i, t = {}) {
|
3199
3204
|
h(this, st);
|
3200
|
-
h(this, me);
|
3201
3205
|
h(this, ge);
|
3206
|
+
h(this, fe);
|
3202
3207
|
h(this, nt);
|
3203
|
-
!at(i) && !
|
3208
|
+
!at(i) && !we(i) && !rt(i) && !w(i) || (this.__storage__ = {
|
3204
3209
|
el: i,
|
3205
3210
|
options: t
|
3206
3211
|
}, this.active = "data-collapse-active", d(this, st, xe).call(this));
|
@@ -3211,20 +3216,20 @@ class Us {
|
|
3211
3216
|
}
|
3212
3217
|
st = new WeakSet(), xe = function() {
|
3213
3218
|
const { el: i, options: t } = this.__storage__, { SETTINGS: e, EVENTS: s } = Je;
|
3214
|
-
if (this.elements = t.state == "not active" ?
|
3219
|
+
if (this.elements = t.state == "not active" ? S(i + `:not([${this.active}])`) : S(i), this.options = Object.assign({}, e, t), this.__events__ = Object.assign({}, s), this.options.on)
|
3215
3220
|
for (const [o, a] of Object.entries(this.options.on))
|
3216
3221
|
this.__events__[o] = [a];
|
3217
|
-
d(this,
|
3218
|
-
},
|
3222
|
+
d(this, ge, ds).call(this);
|
3223
|
+
}, ge = new WeakSet(), ds = function() {
|
3219
3224
|
const { elements: i, options: t } = this;
|
3220
3225
|
i.forEach((e) => {
|
3221
|
-
e.collapse = {}, e.collapse.instance = this, e.collapse.defaultOptions = t, e.collapse.methods = {}, e.collapse.methods.update = this.update, e.setAttribute(this.active, ""), d(this,
|
3226
|
+
e.collapse = {}, e.collapse.instance = this, e.collapse.defaultOptions = t, e.collapse.methods = {}, e.collapse.methods.update = this.update, e.setAttribute(this.active, ""), d(this, fe, us).call(this, e);
|
3222
3227
|
}), this.emit("init");
|
3223
|
-
},
|
3228
|
+
}, fe = new WeakSet(), us = function(i) {
|
3224
3229
|
const { options: t } = this, { collapseClass: e, block: s, target: o, defaultOpen: a, targetStopPropagation: r, defaultActiveMark: l } = t, c = i, u = c.querySelector(o);
|
3225
3230
|
if (c.collapse.height = u.children[0].offsetHeight, a ? (u.style.height = `${u.children[0].offsetHeight}px`, c.classList.remove(e)) : !c.classList.contains(l) && !c.hasAttribute(l) ? (c.classList.add(e), u.style.height = "0px", u.style.overflow = "hidden") : (u.style.height = `${u.children[0].offsetHeight}px`, c.classList.remove(e)), c.removeEventListener("click", d(this, nt, Ce)), c.addEventListener("click", d(this, nt, Ce)), r) {
|
3226
|
-
const p = (
|
3227
|
-
|
3231
|
+
const p = (v) => {
|
3232
|
+
v.stopPropagation();
|
3228
3233
|
};
|
3229
3234
|
u.removeEventListener("click", p), u.addEventListener("click", p);
|
3230
3235
|
}
|
@@ -3248,14 +3253,14 @@ function hs() {
|
|
3248
3253
|
});
|
3249
3254
|
}
|
3250
3255
|
document.addEventListener("click", hs);
|
3251
|
-
var ot, He,
|
3256
|
+
var ot, He, ve, ps, be, ms, ye, gs;
|
3252
3257
|
class Zs extends HTMLElement {
|
3253
3258
|
constructor() {
|
3254
3259
|
super();
|
3255
3260
|
h(this, ot);
|
3256
|
-
h(this, fe);
|
3257
3261
|
h(this, ve);
|
3258
3262
|
h(this, be);
|
3263
|
+
h(this, ye);
|
3259
3264
|
this.initialize = !1;
|
3260
3265
|
}
|
3261
3266
|
connectedCallback() {
|
@@ -3281,13 +3286,13 @@ ot = new WeakSet(), He = function() {
|
|
3281
3286
|
hover: this.getAttribute("r4-hover") ? e(this.getAttribute("r4-hover")) : t.hover,
|
3282
3287
|
click: this.getAttribute("r4-hover-click") ? e(this.getAttribute("r4-hover-click")) : t.click
|
3283
3288
|
};
|
3284
|
-
this.s.options = s, this.s.options.hover && this.classList.add("hover-btn"), d(this,
|
3285
|
-
},
|
3286
|
-
d(this,
|
3287
|
-
},
|
3289
|
+
this.s.options = s, this.s.options.hover && this.classList.add("hover-btn"), d(this, ve, ps).call(this);
|
3290
|
+
}, ve = new WeakSet(), ps = function() {
|
3291
|
+
d(this, be, ms).call(this), d(this, ye, gs).call(this), this.classList.add("r4-initialize");
|
3292
|
+
}, be = new WeakSet(), ms = function() {
|
3288
3293
|
const t = this, e = document.createElement("i");
|
3289
3294
|
e.classList.add("hover-ball"), e.style.transitionDuration = `${t.s.options.speed}ms`, t.appendChild(e);
|
3290
|
-
},
|
3295
|
+
}, ye = new WeakSet(), gs = function() {
|
3291
3296
|
const t = this.querySelector("i.hover-ball"), e = this;
|
3292
3297
|
e.addEventListener("click", function(a) {
|
3293
3298
|
a.stopPropagation(), e.s.options.click && Js(a, e);
|
@@ -3397,8 +3402,8 @@ function Ks(n, i, t, e) {
|
|
3397
3402
|
l < c ? (u = e / l * 100, p = s.height) : l > c ? (u = s.width, p = t * l / 100) : l === c && (u = s.width, p = s.height);
|
3398
3403
|
break;
|
3399
3404
|
}
|
3400
|
-
const
|
3401
|
-
return o.drawImage(i,
|
3405
|
+
const v = (s.width - u) * 0.5, g = (s.height - p) * 0.5;
|
3406
|
+
return o.drawImage(i, v, g, u, p), s;
|
3402
3407
|
}
|
3403
3408
|
function tn(n, i) {
|
3404
3409
|
return new Promise((t, e) => {
|
@@ -3513,8 +3518,8 @@ export {
|
|
3513
3518
|
Ts as c,
|
3514
3519
|
ws as d,
|
3515
3520
|
Y as e,
|
3516
|
-
|
3517
|
-
|
3521
|
+
A as f,
|
3522
|
+
S as g,
|
3518
3523
|
mn as h,
|
3519
3524
|
at as i,
|
3520
3525
|
ui as j,
|