@xwadex/fesd 0.0.18 → 0.0.20
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/fesd-bundle.css +1 -1
- package/dist/fesd-bundle.js +297 -244
- package/dist/fesd-bundle.js.map +1 -1
- package/dist/image-preview-bundle.js +39 -39
- package/dist/image-preview-bundle.js.map +1 -1
- package/package.json +1 -1
package/dist/fesd-bundle.js
CHANGED
@@ -1,18 +1,18 @@
|
|
1
|
-
var
|
2
|
-
if (!
|
3
|
-
throw TypeError("Cannot " +
|
1
|
+
var ot = (r, t, e) => {
|
2
|
+
if (!t.has(r))
|
3
|
+
throw TypeError("Cannot " + e);
|
4
4
|
};
|
5
|
-
var
|
6
|
-
if (
|
5
|
+
var g = (r, t, e) => {
|
6
|
+
if (t.has(r))
|
7
7
|
throw TypeError("Cannot add the same private member more than once");
|
8
|
-
|
8
|
+
t instanceof WeakSet ? t.add(r) : t.set(r, e);
|
9
9
|
};
|
10
|
-
var
|
11
|
-
import { i as
|
12
|
-
import { A as
|
13
|
-
import { S as
|
14
|
-
const
|
15
|
-
const r = navigator.userAgent,
|
10
|
+
var p = (r, t, e) => (ot(r, t, "access private method"), e);
|
11
|
+
import { i as Y, a as z, g as q, v as at, c as nt, b as lt, d as ct, e as dt, f as ut, s as pt } from "./image-preview-bundle.js";
|
12
|
+
import { A as Wt, j as kt, C as Tt, h as _t, D as Ot, m as Mt, I as It, k as Xt, M as Rt, l as Bt, R as Nt, T as Dt } from "./image-preview-bundle.js";
|
13
|
+
import { S as mt } from "./vendor-bundle.js";
|
14
|
+
const E = () => {
|
15
|
+
const r = navigator.userAgent, t = {
|
16
16
|
// Firefox 1.0+
|
17
17
|
isFirefox: typeof InstallTrigger < "u",
|
18
18
|
// Opera 8.0+
|
@@ -30,7 +30,7 @@ const $ = () => {
|
|
30
30
|
isSafari: !/chrome|crios|crmo/i.test(r) && /safari/i.test(r),
|
31
31
|
// Chrome 1 - 79
|
32
32
|
isChrome: !!window.chrome && (!!window.chrome.webstore || !!window.chrome.runtime) || /chrome|crios|crmo/i.test(r)
|
33
|
-
},
|
33
|
+
}, e = {
|
34
34
|
// Android
|
35
35
|
isAndroid: r.indexOf("Android") > -1 || r.indexOf("Adr") > -1,
|
36
36
|
// iOS | ipad
|
@@ -45,124 +45,169 @@ const $ = () => {
|
|
45
45
|
// Linux
|
46
46
|
isLinux: r.indexOf("Linux") > -1
|
47
47
|
};
|
48
|
-
return { browser:
|
49
|
-
},
|
50
|
-
const { browser: r } =
|
51
|
-
return Object.keys(r).find((
|
52
|
-
if (r[
|
53
|
-
return r[
|
48
|
+
return { browser: t, mobile: e, os: s };
|
49
|
+
}, ht = () => {
|
50
|
+
const { browser: r } = E();
|
51
|
+
return Object.keys(r).find((t) => {
|
52
|
+
if (r[t])
|
53
|
+
return r[t];
|
54
54
|
});
|
55
|
-
},
|
56
|
-
const { mobile: r } =
|
57
|
-
return Object.keys(r).some((
|
58
|
-
if (r[
|
59
|
-
return r[
|
55
|
+
}, gt = () => {
|
56
|
+
const { mobile: r } = E();
|
57
|
+
return Object.keys(r).some((t) => {
|
58
|
+
if (r[t])
|
59
|
+
return r[t];
|
60
60
|
});
|
61
|
-
},
|
62
|
-
const { os: r } =
|
63
|
-
return Object.keys(r).find((
|
64
|
-
if (r[
|
65
|
-
return r[
|
61
|
+
}, bt = () => {
|
62
|
+
const { os: r } = E();
|
63
|
+
return Object.keys(r).find((t) => {
|
64
|
+
if (r[t])
|
65
|
+
return r[t];
|
66
66
|
});
|
67
|
-
},
|
68
|
-
function
|
67
|
+
}, ft = () => console.dir(E());
|
68
|
+
function At() {
|
69
69
|
return {
|
70
|
-
init:
|
71
|
-
isBrowser4:
|
72
|
-
isMobile4:
|
73
|
-
isOs4:
|
74
|
-
logs:
|
70
|
+
init: E,
|
71
|
+
isBrowser4: ht,
|
72
|
+
isMobile4: gt,
|
73
|
+
isOs4: bt,
|
74
|
+
logs: ft
|
75
75
|
};
|
76
76
|
}
|
77
|
-
const
|
78
|
-
r && (
|
77
|
+
const f = (r, t, e) => {
|
78
|
+
r && (lt(r) ? r.forEach((s) => s.style[t] = e) : r.style[t] = e);
|
79
79
|
};
|
80
|
-
var
|
81
|
-
class
|
82
|
-
constructor(
|
83
|
-
|
84
|
-
|
80
|
+
var W, G, k, J, S, j, T, K, _, Q, O, Z, A, H, M, tt, x, P;
|
81
|
+
class xt {
|
82
|
+
constructor(t, e = {}) {
|
83
|
+
g(this, W);
|
84
|
+
g(this, k);
|
85
85
|
// 取得元件上的設定值
|
86
|
-
|
86
|
+
g(this, S);
|
87
87
|
// 設置設定值的 CSS 樣式
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
88
|
+
g(this, T);
|
89
|
+
// 表格拖曳功能
|
90
|
+
g(this, _);
|
91
|
+
// 設置表格凍結
|
92
|
+
g(this, O);
|
93
|
+
g(this, A);
|
94
|
+
g(this, M);
|
95
|
+
g(this, x);
|
96
|
+
!Y(t) || !z(t) || (this.__storage__ = {
|
97
|
+
el: t,
|
98
|
+
options: e
|
99
|
+
}, this.active = "data-article-active", p(this, W, G).call(this));
|
95
100
|
}
|
96
101
|
update() {
|
97
|
-
const { elements:
|
98
|
-
|
99
|
-
|
100
|
-
s.article = {}, s.article.parent =
|
102
|
+
const { elements: t } = this;
|
103
|
+
t.forEach((e) => {
|
104
|
+
e.querySelectorAll("._article").forEach((s) => {
|
105
|
+
s.article = {}, s.article.parent = e, s.article.params = p(this, S, j).call(this, s), p(this, A, H).call(this, s), p(this, x, P).call(this, s);
|
101
106
|
});
|
102
107
|
});
|
103
108
|
}
|
104
109
|
}
|
105
|
-
|
106
|
-
const { el:
|
107
|
-
this.elements =
|
108
|
-
},
|
109
|
-
const { elements:
|
110
|
-
|
111
|
-
|
110
|
+
W = new WeakSet(), G = function() {
|
111
|
+
const { el: t, options: e } = this.__storage__, { SETTINGS: s } = ct;
|
112
|
+
this.elements = e.state == "not active" ? q(t + `:not([${this.active}])`) : q(t), this.elements = q(t), this.options = Object.assign({}, s, e), p(this, k, J).call(this);
|
113
|
+
}, k = new WeakSet(), J = function() {
|
114
|
+
const { elements: t } = this;
|
115
|
+
t.forEach((e) => {
|
116
|
+
e.setAttribute(this.active, ""), e.querySelectorAll("._article").forEach((s) => {
|
112
117
|
var i, a;
|
113
|
-
s.article = {}, s.article.parent =
|
118
|
+
s.article = {}, s.article.parent = e, s.article.params = p(this, S, j).call(this, s), s.article.methods = {}, s.article.methods.update = this.update, p(a = p(i = p(this, T, K).call(this, s), A, H).call(i, s), M, tt).call(a, s), p(this, x, P).call(this, s);
|
114
119
|
});
|
115
120
|
});
|
116
|
-
},
|
121
|
+
}, S = new WeakSet(), j = function(t) {
|
117
122
|
return {
|
118
123
|
// 元件本身
|
119
|
-
$selector:
|
124
|
+
$selector: t,
|
120
125
|
// 父層元件
|
121
|
-
$backgroundWrap:
|
122
|
-
$contentWrap:
|
123
|
-
$wordCover:
|
124
|
-
$buttonCover:
|
125
|
-
$imgCover:
|
126
|
-
$cover:
|
127
|
-
$swiper:
|
128
|
-
$
|
126
|
+
$backgroundWrap: t.querySelector("._backgroundWrap"),
|
127
|
+
$contentWrap: t.querySelector("._contentWrap"),
|
128
|
+
$wordCover: t.querySelector("._wordCover"),
|
129
|
+
$buttonCover: t.querySelector("._buttonCover"),
|
130
|
+
$imgCover: t.querySelector("._imgCover"),
|
131
|
+
$cover: t.querySelectorAll("._cover"),
|
132
|
+
$swiper: t.querySelector(".swiper"),
|
133
|
+
$table: t.querySelector("._table"),
|
134
|
+
$swiperButtonCover: t.querySelector(".swiper-button-cover"),
|
129
135
|
// 子層元件
|
130
|
-
$h:
|
131
|
-
$subH:
|
132
|
-
$p:
|
133
|
-
$button:
|
134
|
-
$description:
|
135
|
-
$video:
|
136
|
+
$h: t.querySelector("._H"),
|
137
|
+
$subH: t.querySelector("._subH"),
|
138
|
+
$p: t.querySelector("._P"),
|
139
|
+
$button: t.querySelector("._button"),
|
140
|
+
$description: t.querySelectorAll("._description"),
|
141
|
+
$video: t.querySelectorAll("[video-id]"),
|
136
142
|
// 父層設定
|
137
|
-
typeFullColor:
|
138
|
-
typeFullBoxColor:
|
143
|
+
typeFullColor: t.getAttribute("typeFull-color"),
|
144
|
+
typeFullBoxColor: t.getAttribute("typeFull-boxcolor"),
|
139
145
|
// 子層設定
|
140
|
-
hColor:
|
141
|
-
subHColor:
|
142
|
-
pColor:
|
143
|
-
buttonColor:
|
144
|
-
buttonColorHover:
|
145
|
-
buttonTextColor:
|
146
|
-
descriptionColor:
|
146
|
+
hColor: t.getAttribute("h-color"),
|
147
|
+
subHColor: t.getAttribute("subh-color"),
|
148
|
+
pColor: t.getAttribute("p-color"),
|
149
|
+
buttonColor: t.getAttribute("button-color"),
|
150
|
+
buttonColorHover: t.getAttribute("button-color-hover"),
|
151
|
+
buttonTextColor: t.getAttribute("button-textcolor"),
|
152
|
+
descriptionColor: t.getAttribute("description-color")
|
147
153
|
};
|
148
|
-
},
|
149
|
-
const { params:
|
150
|
-
return
|
151
|
-
},
|
152
|
-
const { params:
|
153
|
-
|
154
|
-
|
155
|
-
|
154
|
+
}, T = new WeakSet(), K = function(t) {
|
155
|
+
const { params: e } = t.article;
|
156
|
+
return f(e.$h, "color", e.hColor), f(e.$subH, "color", e.subHColor), f(e.$p, "color", e.pColor), f(e.$description, "color", e.descriptionColor), f(e.$button, "backgroundColor", e.buttonColor), f(e.$button, "color", e.buttonTextColor), e.buttonColorHover && e.$button && (e.$button.appendChild(document.createElement("span")), f(e.$button.querySelector("span"), "backgroundColor", e.buttonColorHover)), f(e.$backgroundWrap, "backgroundColor", e.typeFullColor), f(e.$contentWrap, "backgroundColor", e.typeFullBoxColor), this;
|
157
|
+
}, _ = new WeakSet(), Q = function(t) {
|
158
|
+
const { params: e } = t.article, s = e.$table;
|
159
|
+
let i = !1, a, o, d, m;
|
160
|
+
s.addEventListener("mousedown", function(n) {
|
161
|
+
n.preventDefault(), i = !0;
|
162
|
+
const c = s.getBoundingClientRect();
|
163
|
+
a = n.pageX - c.left, o = n.pageY - c.top, d = s.scrollLeft, m = s.scrollTop;
|
164
|
+
}), s.addEventListener("mouseleave", function() {
|
165
|
+
i = !1;
|
166
|
+
}), s.addEventListener("mouseup", function() {
|
167
|
+
i = !1;
|
168
|
+
}), s.addEventListener("mousemove", function(n) {
|
169
|
+
if (!i)
|
170
|
+
return;
|
171
|
+
n.preventDefault();
|
172
|
+
const c = s.getBoundingClientRect(), u = n.pageX - c.left, h = n.pageY - c.top, v = u - a, l = h - o;
|
173
|
+
s.scrollLeft = d - v, s.scrollTop = m - l;
|
174
|
+
});
|
175
|
+
}, O = new WeakSet(), Z = function(t, e, s) {
|
176
|
+
const { basic_rwd: i } = this.options, a = [...t.querySelectorAll("tr")];
|
177
|
+
if (a.length === 0)
|
178
|
+
return;
|
179
|
+
const d = window.innerWidth < i ? 0 : s, m = [], n = a[0].querySelectorAll("th, td");
|
180
|
+
for (let c = 0; c < d; c++) {
|
181
|
+
let u = 0;
|
182
|
+
for (let h = 0; h < c; h++)
|
183
|
+
u += n[h].offsetWidth;
|
184
|
+
m[c] = u;
|
185
|
+
}
|
186
|
+
a.forEach((c, u) => {
|
187
|
+
let h = 0;
|
188
|
+
for (let l = 0; l < u; l++)
|
189
|
+
h += a[l].offsetHeight;
|
190
|
+
c.querySelectorAll("th, td").forEach((l, y) => {
|
191
|
+
l.style.zIndex = 0;
|
192
|
+
const b = getComputedStyle(l).backgroundColor;
|
193
|
+
u < e && (l.style.position = "sticky", l.style.top = `${h}px`, l.style.zIndex = 2, l.style.backgroundColor = b), y < d && (l.style.position = "sticky", l.style.left = `${m[y]}px`, l.style.zIndex = u < e ? 3 : 1, l.style.backgroundColor = b);
|
194
|
+
});
|
195
|
+
});
|
196
|
+
}, A = new WeakSet(), H = function(t) {
|
197
|
+
const { params: e } = t.article;
|
198
|
+
return e.$video.length && new at(e.$video), this;
|
199
|
+
}, M = new WeakSet(), tt = function(t) {
|
200
|
+
const { basic_rwd: e } = this.options, { params: s } = t.article;
|
156
201
|
if (!s.$swiper)
|
157
202
|
return;
|
158
|
-
const i =
|
203
|
+
const i = nt(), a = this;
|
159
204
|
let o = {
|
160
205
|
on: {
|
161
206
|
init(n) {
|
162
|
-
const
|
163
|
-
s.$video.length && ([...
|
164
|
-
var
|
165
|
-
(
|
207
|
+
const c = n.$el[0];
|
208
|
+
s.$video.length && ([...c.querySelectorAll("[video4-active]")].forEach((h) => {
|
209
|
+
var v, l;
|
210
|
+
(v = h.querySelector(dt.SETTINGS.videoButton)) == null || v.remove(), (l = h.querySelector(".overlay")) == null || l.remove(), h.removeAttribute("video4-active");
|
166
211
|
}), a.update());
|
167
212
|
},
|
168
213
|
observerUpdate(n) {
|
@@ -175,8 +220,8 @@ L = new WeakSet(), U = function() {
|
|
175
220
|
if (s.$selector.setAttribute("img-swiper", "on"), s.$selector.classList.add(`swiper-${i}`), s.$selector.getAttribute("swiper-arrow") !== "off" && s.$selector.getAttribute("swiper-arrow")) {
|
176
221
|
const n = document.createElement("div");
|
177
222
|
n.className = `swiper-button-next swiper-${i}`, s.$swiperButtonCover.appendChild(n);
|
178
|
-
const
|
179
|
-
|
223
|
+
const c = document.createElement("div");
|
224
|
+
c.className = `swiper-button-prev swiper-${i}`, s.$swiperButtonCover.appendChild(c), o.navigation = {
|
180
225
|
nextEl: `.swiper-button-next.swiper-${i}`,
|
181
226
|
prevEl: `.swiper-button-prev.swiper-${i}`
|
182
227
|
};
|
@@ -188,27 +233,35 @@ L = new WeakSet(), U = function() {
|
|
188
233
|
clickable: !0
|
189
234
|
};
|
190
235
|
}
|
191
|
-
Number.parseInt(s.$selector.getAttribute("swiper-num")) && (o.breakpoints[
|
236
|
+
Number.parseInt(s.$selector.getAttribute("swiper-num")) && (o.breakpoints[e] = {
|
192
237
|
slidesPerView: s.$selector.getAttribute("swiper-num") ? Number.parseInt(s.$selector.getAttribute("swiper-num")) > 5 ? 5 : Number.parseInt(s.$selector.getAttribute("swiper-num")) : 1
|
193
238
|
}), (s.$selector.getAttribute("swiper-autoplay") !== "off" || !s.$selector.getAttribute("swiper-autoplay")) && (o.autoplay = {
|
194
239
|
delay: 3e3,
|
195
240
|
disableOnInteraction: !1
|
196
241
|
}), (s.$selector.getAttribute("swiper-loop") !== "off" || !s.$selector.getAttribute("swiper-loop")) && (o.loop = !0), s.$selector.getAttribute("swiper-speed") && (o.speed = parseInt(s.$selector.getAttribute("swiper-speed"))), s.$selector.getAttribute("swiper-parallax") !== "off" && !s.$selector.getAttribute("swiper-loop") && (o.parallax = !0), s.$selector.getAttribute("swiper-pagination-dynamic") === "on" && (o.pagination.dynamicBullets = !0, o.pagination ? o.pagination.dynamicBullets = !0 : console.warn("pagination undefined"));
|
197
|
-
let
|
198
|
-
s.$swiper.querySelectorAll(".swiper-slide").length <=
|
199
|
-
const
|
200
|
-
return
|
242
|
+
let d = () => window.innerWidth > e && Number(s.$selector.getAttribute("swiper-num")) || 1;
|
243
|
+
s.$swiper.querySelectorAll(".swiper-slide").length <= d() && (o.navigation = !1, o.pagination = !1, o.autoplay = !1, o.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"));
|
244
|
+
const m = new mt(s.$swiper, o);
|
245
|
+
return t.article.swiperList = [], t.article.swiperList.push(m), this;
|
246
|
+
}, x = new WeakSet(), P = function(t) {
|
247
|
+
const { params: e } = t.article;
|
248
|
+
if (!e.$table)
|
249
|
+
return;
|
250
|
+
const s = t.getAttribute("freeze-table") === "on", i = parseInt(t.getAttribute("freeze-table-row") ?? "1", 10), a = parseInt(t.getAttribute("freeze-table-col") ?? "1", 10), o = t.querySelector("table"), d = t.querySelector("._tipText"), m = t.offsetWidth, n = o.offsetWidth, c = m < n, u = () => {
|
251
|
+
s && p(this, O, Z).call(this, o, i, a), (s || c) && p(this, _, Q).call(this, t), c ? (t.classList.add("overflow"), d.style.display = "flex") : (t.classList.remove("overflow"), d.style.display = "none");
|
252
|
+
};
|
253
|
+
return u(), window.addEventListener("resize", u), this;
|
201
254
|
};
|
202
|
-
let
|
203
|
-
function
|
204
|
-
const
|
205
|
-
if (
|
255
|
+
let F = "ontouchstart" in document.documentElement ? "touchstart" : "mousedown", U = "ontouchend" in document.documentElement ? "touchend" : "mouseup", N = "ontouchmove" in document.documentElement ? "touchmove" : "mousemove";
|
256
|
+
function w(r) {
|
257
|
+
const t = window.getComputedStyle(r), e = t.transform || t.mozTransform;
|
258
|
+
if (e === "none")
|
206
259
|
return {
|
207
260
|
x: 0,
|
208
261
|
y: 0,
|
209
262
|
z: 0
|
210
263
|
};
|
211
|
-
const s =
|
264
|
+
const s = e.includes("3d") ? "3d" : "2d", i = e.match(/matrix.*\((.+)\)/)[1].split(", ");
|
212
265
|
if (s === "2d")
|
213
266
|
return {
|
214
267
|
x: Number(i[4]),
|
@@ -222,26 +275,26 @@ function m(r) {
|
|
222
275
|
z: Number(i[14])
|
223
276
|
};
|
224
277
|
}
|
225
|
-
function
|
226
|
-
const
|
278
|
+
function L(r) {
|
279
|
+
const e = r.querySelector(".wrapper").querySelectorAll(".item");
|
227
280
|
let s = 0;
|
228
|
-
return
|
229
|
-
const a = getComputedStyle(i), o = parseInt(a.marginLeft),
|
230
|
-
s += i.getBoundingClientRect().width + o +
|
281
|
+
return e.forEach((i) => {
|
282
|
+
const a = getComputedStyle(i), o = parseInt(a.marginLeft), d = parseInt(a.marginRight);
|
283
|
+
s += i.getBoundingClientRect().width + o + d;
|
231
284
|
}), s;
|
232
285
|
}
|
233
|
-
function
|
234
|
-
if (
|
286
|
+
function D(r) {
|
287
|
+
if (w(r.slideWrapEl).x >= r.translateMin)
|
235
288
|
return "is-start";
|
236
|
-
if (
|
289
|
+
if (w(r.slideWrapEl).x <= r.translateMax)
|
237
290
|
return "is-end";
|
238
|
-
if (
|
291
|
+
if (w(r.slideWrapEl).x < r.translateMin && w(r.slideWrapEl).x > r.translateMax)
|
239
292
|
return "is-middle";
|
240
293
|
}
|
241
|
-
function
|
242
|
-
const
|
243
|
-
|
244
|
-
switch (r.isDown = !0, r.slidable &&
|
294
|
+
function wt(r) {
|
295
|
+
const t = r.el, e = t.querySelector(".wrapper");
|
296
|
+
e.addEventListener(F, function(s) {
|
297
|
+
switch (r.isDown = !0, r.slidable && e.classList.add("dragging"), F) {
|
245
298
|
case "mousedown":
|
246
299
|
r.startX = s.pageX;
|
247
300
|
break;
|
@@ -249,9 +302,9 @@ function pe(r) {
|
|
249
302
|
r.startX = s.changedTouches[0].pageX;
|
250
303
|
break;
|
251
304
|
}
|
252
|
-
r.nowTranslateX =
|
253
|
-
}),
|
254
|
-
r.isDown = !1,
|
305
|
+
r.nowTranslateX = w(e).x;
|
306
|
+
}), e.addEventListener(U, function(s) {
|
307
|
+
r.isDown = !1, e.classList.remove("dragging"), e.classList.remove("moving");
|
255
308
|
let i;
|
256
309
|
switch (N) {
|
257
310
|
case "mousemove":
|
@@ -262,16 +315,16 @@ function pe(r) {
|
|
262
315
|
break;
|
263
316
|
}
|
264
317
|
if (i === 0 && s.target.closest(".item")) {
|
265
|
-
if (
|
318
|
+
if (U === "mouseup" && s.button !== 0)
|
266
319
|
return;
|
267
|
-
|
320
|
+
e.querySelectorAll(".item").forEach((o) => {
|
268
321
|
o.classList.remove("active");
|
269
322
|
}), s.target.closest(".item").classList.add("active"), r.moveActive(r.params.speed);
|
270
323
|
} else
|
271
|
-
r.slidable && r.resetPos(
|
272
|
-
}),
|
273
|
-
r.isDown && r.slidable && (r.isDown = !1,
|
274
|
-
}),
|
324
|
+
r.slidable && r.resetPos(t);
|
325
|
+
}), e.addEventListener("mouseleave", function() {
|
326
|
+
r.isDown && r.slidable && (r.isDown = !1, e.classList.remove("dragging"), e.classList.remove("moving"), r.resetPos(t));
|
327
|
+
}), e.addEventListener(N, function(s) {
|
275
328
|
if (r.draggable && r.slidable) {
|
276
329
|
if (!r.isDown)
|
277
330
|
return;
|
@@ -286,123 +339,123 @@ function pe(r) {
|
|
286
339
|
break;
|
287
340
|
}
|
288
341
|
if (i !== 0) {
|
289
|
-
|
342
|
+
e.classList.add("moving");
|
290
343
|
const a = {
|
291
344
|
transition: "all 0ms ease 0s",
|
292
345
|
transform: `translate3d(${r.nowTranslateX + i}px,0,0)`
|
293
346
|
};
|
294
|
-
Object.assign(
|
347
|
+
Object.assign(e.style, a);
|
295
348
|
}
|
296
349
|
}
|
297
350
|
});
|
298
351
|
}
|
299
|
-
function
|
300
|
-
const
|
301
|
-
for (var
|
302
|
-
e
|
352
|
+
function vt(r) {
|
353
|
+
const t = r.querySelectorAll("a");
|
354
|
+
for (var e = 0, s = t.length; e < s; e++)
|
355
|
+
t[e].draggable = !1;
|
303
356
|
}
|
304
|
-
class
|
305
|
-
constructor(
|
306
|
-
this.el = typeof
|
357
|
+
class Et {
|
358
|
+
constructor(t, e) {
|
359
|
+
this.el = typeof t == "string" ? document.querySelector(t) : t, this.slideWrapEl = this.el.querySelector(".wrapper"), this.params = {
|
307
360
|
speed: 300,
|
308
361
|
clickSwitch: !0,
|
309
362
|
breakpoint: !1
|
310
|
-
}, Object.assign(this.params,
|
363
|
+
}, Object.assign(this.params, e), this.draggable = !0, this.isDown = !1, this.startX = 0, this.nowTranslateX = w(this.slideWrapEl).x, this.slideTotalWidth = L(this.el), this.translateMin = 0, this.translateMax = -Math.floor(
|
311
364
|
Math.abs(
|
312
|
-
|
365
|
+
L(this.el) - this.el.querySelector(".wrapper").getBoundingClientRect().width
|
313
366
|
)
|
314
367
|
), this.slidable = this.slideTotalWidth > Math.round(this.el.getBoundingClientRect().width) && (!this.params.breakpoint || window.innerWidth <= this.params.breakpoint), this.init();
|
315
368
|
}
|
316
369
|
init() {
|
317
|
-
const
|
318
|
-
|
319
|
-
|
320
|
-
}),
|
370
|
+
const t = this;
|
371
|
+
t.slidable && (t.slideWrapEl.style.width = `${t.slideTotalWidth}px`, t.el.classList.add("slidable"), t.slideWrapEl.querySelector(".item.active") && t.moveActive()), window.addEventListener("resize", function() {
|
372
|
+
t.update();
|
373
|
+
}), wt(t), vt(t.el);
|
321
374
|
}
|
322
|
-
moveActive(
|
323
|
-
const
|
324
|
-
if (
|
325
|
-
if (-a < 0 && -a >
|
375
|
+
moveActive(t) {
|
376
|
+
const e = this, s = e.slideWrapEl.querySelector(".item.active"), a = s.previousElementSibling ? s.offsetLeft - e.el.clientWidth / 2 + s.clientWidth / 2 : 0;
|
377
|
+
if (e.slidable) {
|
378
|
+
if (-a < 0 && -a > e.translateMax) {
|
326
379
|
const o = {
|
327
|
-
transition: `all ${
|
380
|
+
transition: `all ${t || 0}ms ease 0s`,
|
328
381
|
transform: `translate3d(-${a}px,0,0)`
|
329
382
|
};
|
330
|
-
Object.assign(
|
383
|
+
Object.assign(e.slideWrapEl.style, o);
|
331
384
|
} else if (-a >= 0) {
|
332
385
|
const o = {
|
333
|
-
transition: `all ${
|
386
|
+
transition: `all ${t || 0}ms ease 0s`,
|
334
387
|
transform: "translate3d(0,0,0)"
|
335
388
|
};
|
336
|
-
Object.assign(
|
389
|
+
Object.assign(e.slideWrapEl.style, o);
|
337
390
|
} else {
|
338
391
|
const o = {
|
339
|
-
transition: `all ${
|
340
|
-
transform: `translate3d(${
|
392
|
+
transition: `all ${t || 0}ms ease 0s`,
|
393
|
+
transform: `translate3d(${e.translateMax}px,0,0)`
|
341
394
|
};
|
342
|
-
Object.assign(
|
395
|
+
Object.assign(e.slideWrapEl.style, o);
|
343
396
|
}
|
344
|
-
if (
|
345
|
-
|
397
|
+
if (t)
|
398
|
+
e.slideWrapEl.addEventListener(
|
346
399
|
"transitionend",
|
347
400
|
function() {
|
348
|
-
switch (
|
401
|
+
switch (e.nowTranslateX = w(e.slideWrapEl).x, D(e)) {
|
349
402
|
case "is-start":
|
350
|
-
|
403
|
+
e.el.classList.add("is-start"), e.el.classList.remove("is-end");
|
351
404
|
break;
|
352
405
|
case "is-middle":
|
353
|
-
|
406
|
+
e.el.classList.remove("is-start"), e.el.classList.remove("is-end");
|
354
407
|
break;
|
355
408
|
case "is-end":
|
356
|
-
|
409
|
+
e.el.classList.remove("is-start"), e.el.classList.add("is-end");
|
357
410
|
break;
|
358
411
|
}
|
359
412
|
},
|
360
413
|
!1
|
361
414
|
);
|
362
415
|
else
|
363
|
-
switch (
|
416
|
+
switch (e.nowTranslateX = w(e.slideWrapEl).x, D(e)) {
|
364
417
|
case "is-start":
|
365
|
-
|
418
|
+
e.el.classList.add("is-start"), e.el.classList.remove("is-end");
|
366
419
|
break;
|
367
420
|
case "is-middle":
|
368
|
-
|
421
|
+
e.el.classList.remove("is-start"), e.el.classList.remove("is-end");
|
369
422
|
break;
|
370
423
|
case "is-end":
|
371
|
-
|
424
|
+
e.el.classList.remove("is-start"), e.el.classList.add("is-end");
|
372
425
|
break;
|
373
426
|
}
|
374
427
|
}
|
375
428
|
}
|
376
429
|
resetPos() {
|
377
|
-
const
|
378
|
-
switch (
|
430
|
+
const t = this;
|
431
|
+
switch (D(t)) {
|
379
432
|
case "is-start":
|
380
|
-
|
381
|
-
transition: `all ${
|
433
|
+
t.el.classList.add("is-start"), t.el.classList.remove("is-end"), Object.assign(t.slideWrapEl.style, {
|
434
|
+
transition: `all ${t.params.speed}ms ease 0s`,
|
382
435
|
transform: "translate3d(0,0,0)"
|
383
436
|
});
|
384
437
|
break;
|
385
438
|
case "is-middle":
|
386
|
-
|
439
|
+
t.el.classList.remove("is-start"), t.el.classList.remove("is-end");
|
387
440
|
break;
|
388
441
|
case "is-end":
|
389
|
-
|
390
|
-
transition: `all ${
|
391
|
-
transform: `translate3d(${
|
442
|
+
t.el.classList.remove("is-start"), t.el.classList.add("is-end"), Object.assign(t.slideWrapEl.style, {
|
443
|
+
transition: `all ${t.params.speed}ms ease 0s`,
|
444
|
+
transform: `translate3d(${t.translateMax}px,0,0)`
|
392
445
|
});
|
393
446
|
break;
|
394
447
|
}
|
395
448
|
}
|
396
449
|
update() {
|
397
|
-
const
|
398
|
-
|
450
|
+
const t = this;
|
451
|
+
t.el.querySelector(".wrapper").removeAttribute("style"), t.slideTotalWidth = L(t.el), t.translateMax = -Math.floor(
|
399
452
|
Math.abs(
|
400
|
-
|
453
|
+
L(t.el) - t.el.querySelector(".wrapper").getBoundingClientRect().width
|
401
454
|
)
|
402
|
-
),
|
455
|
+
), t.slidable = t.slideTotalWidth > Math.round(t.el.getBoundingClientRect().width) && (!t.params.breakpoint || window.innerWidth <= t.params.breakpoint), t.slidable ? (t.slideWrapEl.style.width = `${t.slideTotalWidth}px`, t.el.classList.add("slidable"), t.slideWrapEl.querySelector(".item.active") && t.moveActive()) : (t.el.classList.remove("slidable"), t.el.classList.remove("is-start"), t.el.classList.remove("is-end"), t.slideWrapEl.removeAttribute("style"));
|
403
456
|
}
|
404
457
|
}
|
405
|
-
const
|
458
|
+
const V = (r) => {
|
406
459
|
if (r == "facebook")
|
407
460
|
return "https://www.facebook.com/sharer/sharer.php?u=";
|
408
461
|
if (r == "line")
|
@@ -414,95 +467,95 @@ const P = (r) => {
|
|
414
467
|
if (r == "telegram")
|
415
468
|
return "https://telegram.me/share/url?url=";
|
416
469
|
};
|
417
|
-
var
|
418
|
-
class
|
419
|
-
constructor(
|
420
|
-
|
421
|
-
|
422
|
-
|
470
|
+
var I, et, X, st, R, rt;
|
471
|
+
class Ct {
|
472
|
+
constructor(t, e = {}) {
|
473
|
+
g(this, I);
|
474
|
+
g(this, X);
|
475
|
+
g(this, R);
|
423
476
|
this.__storage__ = {
|
424
|
-
el:
|
425
|
-
options:
|
426
|
-
},
|
477
|
+
el: t,
|
478
|
+
options: e
|
479
|
+
}, p(this, I, et).call(this);
|
427
480
|
}
|
428
481
|
}
|
429
|
-
|
430
|
-
const { el:
|
431
|
-
!
|
432
|
-
},
|
433
|
-
const { elements:
|
434
|
-
|
482
|
+
I = new WeakSet(), et = function() {
|
483
|
+
const { el: t, options: e } = this.__storage__, { SETTINGS: s } = pt;
|
484
|
+
!Y(t) || !z(t) || (this.elements = q(t), this.options = Object.assign({}, s, e), p(this, X, st).call(this));
|
485
|
+
}, X = new WeakSet(), st = function() {
|
486
|
+
const { elements: t, options: e } = this;
|
487
|
+
t.forEach((s) => {
|
435
488
|
s.querySelectorAll("[share-target]").forEach((i) => {
|
436
|
-
i.share = {}, i.share.instance = this, i.share.params =
|
489
|
+
i.share = {}, i.share.instance = this, i.share.params = e, i.share.eventHandler = p(this, R, rt), i.addEventListener("click", i.share.eventHandler);
|
437
490
|
});
|
438
491
|
});
|
439
|
-
},
|
440
|
-
const { eventHandler:
|
492
|
+
}, R = new WeakSet(), rt = function() {
|
493
|
+
const { eventHandler: t, params: e } = this.share, s = this.getAttribute("share-target"), i = {
|
441
494
|
source: this.getAttribute("utm-source"),
|
442
495
|
medium: this.getAttribute("utm-medium"),
|
443
496
|
campaign: this.getAttribute("utm-campaign")
|
444
497
|
}, a = {
|
445
|
-
success: this.getAttribute("copy-success") ||
|
446
|
-
text: this.getAttribute("copy-text") ||
|
447
|
-
className: this.getAttribute("copy-class") ||
|
448
|
-
duration: this.getAttribute("copy-duration") ||
|
498
|
+
success: this.getAttribute("copy-success") || e.success,
|
499
|
+
text: this.getAttribute("copy-text") || e.text,
|
500
|
+
className: this.getAttribute("copy-class") || e.className,
|
501
|
+
duration: this.getAttribute("copy-duration") || e.duration
|
449
502
|
}, o = encodeURIComponent(document.URL);
|
450
|
-
let
|
503
|
+
let d = o;
|
451
504
|
if (s == "wechat") {
|
452
505
|
window.open(`https://api.qrserver.com/v1/create-qr-code/?data=${o}&size=250x250`, "share to wechat", "width=300,height=300");
|
453
506
|
return;
|
454
507
|
}
|
455
508
|
if (s == "url") {
|
456
|
-
if (
|
509
|
+
if (z(".copied-wrapper"))
|
457
510
|
return;
|
458
|
-
document.querySelector("body").insertAdjacentHTML(
|
459
|
-
const
|
460
|
-
a.className &&
|
511
|
+
document.querySelector("body").insertAdjacentHTML(ut.append, `<div class='copied-wrapper'><div class='text'>${a.success ? a.success : ""}</div><input id='clipboard' type='text' readonly></div>`);
|
512
|
+
const m = document.querySelector(".copied-wrapper");
|
513
|
+
a.className && m.classList.add(a.className), m.style.top = this.getBoundingClientRect().top + window.scrollY + "px", m.style.left = this.getBoundingClientRect().left + this.getBoundingClientRect().width / 2 + "px", m.style.display = "block";
|
461
514
|
const n = document.querySelector("#clipboard");
|
462
515
|
if (n.value = a.text ?? window.location.href, n.setSelectionRange(0, 9999), n.select(), document.execCommand("copy")) {
|
463
516
|
document.execCommand("copy");
|
464
|
-
const
|
465
|
-
|
466
|
-
const
|
517
|
+
const c = document.querySelector(".copied-wrapper"), u = document.querySelector(".copied-wrapper .text");
|
518
|
+
u.style.display = "block", u.style.opacity = 0;
|
519
|
+
const h = (l, y) => {
|
467
520
|
let b = 0;
|
468
|
-
const
|
469
|
-
b +=
|
470
|
-
|
471
|
-
|
521
|
+
const $ = 50, C = $ / y, B = setInterval(function() {
|
522
|
+
b += C, l.style.opacity = b, b >= 1 && (clearInterval(B), setTimeout(function() {
|
523
|
+
v(l, 300, function() {
|
524
|
+
c.remove();
|
472
525
|
});
|
473
526
|
}, a.duration));
|
474
|
-
},
|
475
|
-
},
|
476
|
-
let
|
477
|
-
const
|
478
|
-
|
479
|
-
},
|
527
|
+
}, $);
|
528
|
+
}, v = (l, y, b) => {
|
529
|
+
let $ = 1;
|
530
|
+
const C = 50, B = C / y, it = setInterval(() => {
|
531
|
+
$ -= B, l.style.opacity = $, $ <= 0 && (clearInterval(it), l.style.display = "none", b && b());
|
532
|
+
}, C);
|
480
533
|
};
|
481
|
-
|
534
|
+
h(u, 300);
|
482
535
|
}
|
483
536
|
return;
|
484
537
|
}
|
485
|
-
|
486
|
-
this.addEventListener("click",
|
538
|
+
d = `${d}${i.source ? `?utm_source=${i.source}` : ""}${i.medium ? `&utm_medium${i.medium}` : ""}${i.campaign ? `&utm_campaign${i.campaign}` : ""}`, d = d.replace("?", "%3F").replace(new RegExp("&", "g"), "%26"), s == "line" ? window.open(`${V(s)}${o}`) : window.open(`${V(s)}${d}"e=${d}`), this.removeEventListener("click", t), setTimeout(() => {
|
539
|
+
this.addEventListener("click", t);
|
487
540
|
}, 100);
|
488
541
|
};
|
489
542
|
export {
|
490
|
-
|
491
|
-
|
492
|
-
|
493
|
-
|
494
|
-
|
495
|
-
|
496
|
-
|
497
|
-
|
498
|
-
|
499
|
-
|
500
|
-
|
501
|
-
|
502
|
-
|
503
|
-
|
504
|
-
|
505
|
-
|
506
|
-
|
543
|
+
Wt as Anchor4,
|
544
|
+
kt as Aost4,
|
545
|
+
xt as Article4,
|
546
|
+
Et as CategorySlider,
|
547
|
+
Tt as Collapse4,
|
548
|
+
_t as Configs,
|
549
|
+
At as Detect4,
|
550
|
+
Ot as Dropdown4,
|
551
|
+
Mt as ImagePreview,
|
552
|
+
It as ImageValidate,
|
553
|
+
Xt as Marquee4,
|
554
|
+
Rt as Modal4,
|
555
|
+
Bt as Multipurpose4,
|
556
|
+
Nt as Ripple4,
|
557
|
+
Ct as Share4,
|
558
|
+
Dt as Tab4,
|
559
|
+
at as Video4
|
507
560
|
};
|
508
561
|
//# sourceMappingURL=fesd-bundle.js.map
|