@applemusic-like-lyrics/core 0.0.7 → 0.0.10
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/README.md +2 -0
- package/dist/amll-core.js +1 -1
- package/dist/amll-core.js.map +1 -1
- package/dist/amll-core.mjs +197 -219
- package/dist/amll-core.mjs.map +1 -1
- package/dist/lyric-player/index.d.ts +1 -1
- package/package.json +1 -1
package/dist/amll-core.mjs
CHANGED
|
@@ -1,60 +1,60 @@
|
|
|
1
1
|
import { Container as v } from "@pixi/display";
|
|
2
2
|
import { Application as M } from "@pixi/app";
|
|
3
3
|
import { BlurFilter as y } from "@pixi/filter-blur";
|
|
4
|
-
import { ColorMatrixFilter as
|
|
4
|
+
import { ColorMatrixFilter as E } from "@pixi/filter-color-matrix";
|
|
5
5
|
import { Texture as C } from "@pixi/core";
|
|
6
6
|
import { Sprite as L } from "@pixi/sprite";
|
|
7
7
|
import { create as z } from "jss";
|
|
8
8
|
import A from "jss-preset-default";
|
|
9
9
|
const D = /^(((?<hour>[0-9]+):)?(?<min>[0-9]+):)?(?<sec>[0-9]+([\.:]([0-9]+))?)/;
|
|
10
|
-
function T(
|
|
11
|
-
const e = D.exec(
|
|
10
|
+
function T(d) {
|
|
11
|
+
const e = D.exec(d);
|
|
12
12
|
if (e) {
|
|
13
13
|
const t = Number(e.groups?.hour || "0"), i = Number(e.groups?.min || "0"), n = Number(e.groups?.sec.replace(/:/, ".") || "0");
|
|
14
14
|
return Math.floor((t * 3600 + i * 60 + n) * 1e3);
|
|
15
15
|
} else
|
|
16
16
|
throw new TypeError("时间戳字符串解析失败");
|
|
17
17
|
}
|
|
18
|
-
function I(
|
|
18
|
+
function I(d) {
|
|
19
19
|
const t = new DOMParser().parseFromString(
|
|
20
|
-
|
|
20
|
+
d,
|
|
21
21
|
"application/xml"
|
|
22
22
|
);
|
|
23
23
|
let i = "v1";
|
|
24
|
-
for (const
|
|
25
|
-
if (
|
|
26
|
-
const s =
|
|
24
|
+
for (const a of t.querySelectorAll("ttm\\:agent"))
|
|
25
|
+
if (a.getAttribute("type") === "person") {
|
|
26
|
+
const s = a.getAttribute("xml:id");
|
|
27
27
|
s && (i = s);
|
|
28
28
|
}
|
|
29
29
|
const n = [];
|
|
30
|
-
for (const
|
|
30
|
+
for (const a of t.querySelectorAll("body p[begin][end]")) {
|
|
31
31
|
const s = {
|
|
32
32
|
words: [],
|
|
33
|
-
startTime: T(
|
|
34
|
-
endTime: T(
|
|
33
|
+
startTime: T(a.getAttribute("begin") ?? "0:0"),
|
|
34
|
+
endTime: T(a.getAttribute("end") ?? "0:0"),
|
|
35
35
|
translatedLyric: "",
|
|
36
36
|
romanLyric: "",
|
|
37
37
|
isBG: !1,
|
|
38
|
-
isDuet:
|
|
38
|
+
isDuet: a.getAttribute("ttm:agent") !== i
|
|
39
39
|
};
|
|
40
40
|
let r = null;
|
|
41
|
-
for (const
|
|
42
|
-
if (
|
|
43
|
-
const
|
|
44
|
-
/^(\s+)$/.test(
|
|
41
|
+
for (const l of a.childNodes)
|
|
42
|
+
if (l.nodeType === Node.TEXT_NODE) {
|
|
43
|
+
const h = l.textContent ?? "";
|
|
44
|
+
/^(\s+)$/.test(h) ? s.words.push({
|
|
45
45
|
word: " ",
|
|
46
46
|
startTime: 0,
|
|
47
47
|
endTime: 0
|
|
48
48
|
}) : s.words.push({
|
|
49
|
-
word:
|
|
49
|
+
word: h,
|
|
50
50
|
startTime: 0,
|
|
51
51
|
endTime: 0
|
|
52
52
|
});
|
|
53
|
-
} else if (
|
|
54
|
-
const
|
|
55
|
-
if (
|
|
53
|
+
} else if (l.nodeType === Node.ELEMENT_NODE) {
|
|
54
|
+
const h = l, o = h.getAttribute("ttm:role");
|
|
55
|
+
if (h.nodeName === "span" && o)
|
|
56
56
|
if (o === "x-bg") {
|
|
57
|
-
const
|
|
57
|
+
const c = {
|
|
58
58
|
words: [],
|
|
59
59
|
startTime: s.startTime,
|
|
60
60
|
endTime: s.endTime,
|
|
@@ -63,47 +63,47 @@ function I(c) {
|
|
|
63
63
|
isBG: !0,
|
|
64
64
|
isDuet: s.isDuet
|
|
65
65
|
};
|
|
66
|
-
for (const
|
|
67
|
-
if (
|
|
68
|
-
const f =
|
|
69
|
-
/^(\s+)$/.test(f) ?
|
|
66
|
+
for (const u of h.childNodes)
|
|
67
|
+
if (u.nodeType === Node.TEXT_NODE) {
|
|
68
|
+
const f = u.textContent ?? "";
|
|
69
|
+
/^(\s+)$/.test(f) ? c.words.push({
|
|
70
70
|
word: " ",
|
|
71
71
|
startTime: 0,
|
|
72
72
|
endTime: 0
|
|
73
|
-
}) :
|
|
73
|
+
}) : c.words.push({
|
|
74
74
|
word: f,
|
|
75
75
|
startTime: 0,
|
|
76
76
|
endTime: 0
|
|
77
77
|
});
|
|
78
|
-
} else if (
|
|
79
|
-
const f =
|
|
80
|
-
if (f.nodeName === "span" &&
|
|
81
|
-
|
|
78
|
+
} else if (u.nodeType === Node.ELEMENT_NODE) {
|
|
79
|
+
const f = u, b = f.getAttribute("ttm:role");
|
|
80
|
+
if (f.nodeName === "span" && b)
|
|
81
|
+
b === "x-translation" ? c.translatedLyric = f.innerHTML.trim() : b === "x-roman" && (c.romanLyric = f.innerHTML.trim());
|
|
82
82
|
else if (f.hasAttribute("begin") && f.hasAttribute("end")) {
|
|
83
83
|
const x = {
|
|
84
|
-
word:
|
|
84
|
+
word: u.textContent,
|
|
85
85
|
startTime: T(f.getAttribute("begin")),
|
|
86
86
|
endTime: T(f.getAttribute("end"))
|
|
87
87
|
};
|
|
88
|
-
|
|
88
|
+
c.words.push(x);
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
|
-
const m =
|
|
92
|
-
|
|
93
|
-
const
|
|
94
|
-
|
|
91
|
+
const m = c.words[0];
|
|
92
|
+
c.startTime = m.startTime, m?.word.startsWith("(") && (m.word = m.word.substring(1));
|
|
93
|
+
const p = c.words[c.words.length - 1];
|
|
94
|
+
c.endTime = p.endTime, p?.word.endsWith(")") && (p.word = p.word.substring(
|
|
95
95
|
0,
|
|
96
|
-
|
|
97
|
-
)), r =
|
|
96
|
+
p.word.length - 1
|
|
97
|
+
)), r = c;
|
|
98
98
|
} else
|
|
99
|
-
o === "x-translation" ? s.translatedLyric =
|
|
100
|
-
else if (
|
|
101
|
-
const
|
|
102
|
-
word:
|
|
103
|
-
startTime: T(
|
|
104
|
-
endTime: T(
|
|
99
|
+
o === "x-translation" ? s.translatedLyric = h.innerHTML : o === "x-roman" && (s.romanLyric = h.innerHTML);
|
|
100
|
+
else if (h.hasAttribute("begin") && h.hasAttribute("end")) {
|
|
101
|
+
const c = {
|
|
102
|
+
word: l.textContent ?? "",
|
|
103
|
+
startTime: T(h.getAttribute("begin")),
|
|
104
|
+
endTime: T(h.getAttribute("end"))
|
|
105
105
|
};
|
|
106
|
-
s.words.push(
|
|
106
|
+
s.words.push(c);
|
|
107
107
|
}
|
|
108
108
|
}
|
|
109
109
|
n.push(s), r && n.push(r);
|
|
@@ -146,11 +146,11 @@ class k {
|
|
|
146
146
|
1,
|
|
147
147
|
this.curContainer.alpha + e / 60
|
|
148
148
|
);
|
|
149
|
-
const [t, i, n,
|
|
149
|
+
const [t, i, n, a] = this.curContainer.children, s = Math.max(this.app.screen.width, this.app.screen.height);
|
|
150
150
|
t.position.set(this.app.screen.width / 2, this.app.screen.height / 2), i.position.set(
|
|
151
151
|
this.app.screen.width / 2.5,
|
|
152
152
|
this.app.screen.height / 2.5
|
|
153
|
-
), n.position.set(this.app.screen.width / 2, this.app.screen.height / 2),
|
|
153
|
+
), n.position.set(this.app.screen.width / 2, this.app.screen.height / 2), a.position.set(this.app.screen.width / 2, this.app.screen.height / 2), t.width = s * Math.sqrt(2), t.height = t.width, i.width = s * 0.8, i.height = i.width, n.width = s * 0.5, n.height = n.width, a.width = s * 0.25, a.height = a.width, this.curContainer.time += e * this.flowSpeed, t.rotation += e / 1e3 * this.flowSpeed, i.rotation -= e / 500 * this.flowSpeed, n.rotation += e / 1e3 * this.flowSpeed, a.rotation -= e / 750 * this.flowSpeed, n.x = this.app.screen.width / 2 + this.app.screen.width / 4 * Math.cos(this.curContainer.time / 1e3 * 0.75), n.y = this.app.screen.height / 2 + this.app.screen.width / 4 * Math.cos(this.curContainer.time / 1e3 * 0.75), a.x = this.app.screen.width / 2 + this.app.screen.width / 4 * 0.1 + Math.cos(this.curContainer.time * 6e-3 * 0.75), a.y = this.app.screen.height / 2 + this.app.screen.width / 4 * 0.1 + Math.cos(this.curContainer.time * 6e-3 * 0.75);
|
|
154
154
|
}
|
|
155
155
|
};
|
|
156
156
|
flowSpeed = 2;
|
|
@@ -177,11 +177,11 @@ class k {
|
|
|
177
177
|
), this.rebuildFilters();
|
|
178
178
|
}
|
|
179
179
|
rebuildFilters() {
|
|
180
|
-
const e = Math.min(this.canvas.width, this.canvas.height), t = new
|
|
180
|
+
const e = Math.min(this.canvas.width, this.canvas.height), t = new E();
|
|
181
181
|
t.saturate(1.2, !1);
|
|
182
|
-
const i = new
|
|
182
|
+
const i = new E();
|
|
183
183
|
i.brightness(0.6, !1);
|
|
184
|
-
const n = new
|
|
184
|
+
const n = new E();
|
|
185
185
|
n.contrast(0.3, !0), this.app.stage.filters = [], this.app.stage.filters.push(new y(5, 1)), this.app.stage.filters.push(new y(10, 1)), this.app.stage.filters.push(new y(20, 2)), this.app.stage.filters.push(new y(40, 2)), e > 512 && this.app.stage.filters.push(new y(80, 2)), e > 768 && this.app.stage.filters.push(new y(160, 4)), e > 768 * 2 && this.app.stage.filters.push(new y(320, 4)), this.app.stage.filters.push(t, i, n), this.app.stage.filters.push(new y(5, 1));
|
|
186
186
|
}
|
|
187
187
|
/**
|
|
@@ -210,8 +210,8 @@ class k {
|
|
|
210
210
|
* @param albumUrl 图片的目标链接
|
|
211
211
|
*/
|
|
212
212
|
async setAlbumImage(e) {
|
|
213
|
-
const t = await C.fromURL(e), i = new B(), n = new L(t),
|
|
214
|
-
n.anchor.set(0.5, 0.5),
|
|
213
|
+
const t = await C.fromURL(e), i = new B(), n = new L(t), a = new L(t), s = new L(t), r = new L(t);
|
|
214
|
+
n.anchor.set(0.5, 0.5), a.anchor.set(0.5, 0.5), s.anchor.set(0.5, 0.5), r.anchor.set(0.5, 0.5), n.rotation = Math.random() * Math.PI * 2, a.rotation = Math.random() * Math.PI * 2, s.rotation = Math.random() * Math.PI * 2, r.rotation = Math.random() * Math.PI * 2, i.addChild(n, a, s, r), this.curContainer && this.lastContainer.add(this.curContainer), this.curContainer = i, this.app.stage.addChild(this.curContainer), this.curContainer.alpha = 0;
|
|
215
215
|
}
|
|
216
216
|
dispose() {
|
|
217
217
|
this.observer.disconnect(), this.app.ticker.remove(this.onTick);
|
|
@@ -230,13 +230,13 @@ class Z extends k {
|
|
|
230
230
|
super.dispose(), this.element.remove();
|
|
231
231
|
}
|
|
232
232
|
}
|
|
233
|
-
const N = (
|
|
234
|
-
function O(
|
|
233
|
+
const N = (d, e) => d.size === e.size && [...d].every((t) => e.has(t));
|
|
234
|
+
function O(d) {
|
|
235
235
|
const t = 2.5949095;
|
|
236
|
-
return
|
|
236
|
+
return d < 0.5 ? Math.pow(2 * d, 2) * ((t + 1) * 2 * d - t) / 2 : (Math.pow(2 * d - 2, 2) * ((t + 1) * (d * 2 - 2) + t) + 2) / 2;
|
|
237
237
|
}
|
|
238
|
-
const g = (
|
|
239
|
-
class
|
|
238
|
+
const g = (d, e, t) => Math.max(d, Math.min(e, t));
|
|
239
|
+
class $ {
|
|
240
240
|
constructor(e) {
|
|
241
241
|
this.lyricPlayer = e, this.element.className = this.lyricPlayer.style.classes.interludeDots, this.element.appendChild(this.dot0), this.element.appendChild(this.dot1), this.element.appendChild(this.dot2);
|
|
242
242
|
}
|
|
@@ -266,20 +266,20 @@ class W {
|
|
|
266
266
|
if (t += `transform:translate(${this.left}px, ${this.top}px)`, this.currentInterlude) {
|
|
267
267
|
const i = this.currentInterlude[1] - this.currentInterlude[0], n = this.currentTime - this.currentInterlude[0];
|
|
268
268
|
if (n <= i) {
|
|
269
|
-
const
|
|
269
|
+
const a = i / Math.ceil(i / this.targetBreatheDuration);
|
|
270
270
|
let s = 1, r = 1;
|
|
271
|
-
s *= Math.sin(1.5 * Math.PI - n /
|
|
271
|
+
s *= Math.sin(1.5 * Math.PI - n / a * 2) / 10 + 1, n < 1e3 && (s *= 1 - Math.pow((1e3 - n) / 1e3, 2)), n < 500 ? r = 0 : n < 1e3 && (r *= (n - 500) / 500), i - n < 750 && (s *= 1 - O(
|
|
272
272
|
(750 - (i - n)) / 750 / 2
|
|
273
273
|
)), i - n < 375 && (r *= g(
|
|
274
274
|
0,
|
|
275
275
|
(i - n) / 375,
|
|
276
276
|
1
|
|
277
277
|
)), s = Math.max(0, s), t += ` scale(${s})`;
|
|
278
|
-
const
|
|
278
|
+
const l = g(
|
|
279
279
|
0.25,
|
|
280
280
|
n * 3 / i * 0.75,
|
|
281
281
|
1
|
|
282
|
-
),
|
|
282
|
+
), h = g(
|
|
283
283
|
0.25,
|
|
284
284
|
(n - i / 3) * 3 / i * 0.75,
|
|
285
285
|
1
|
|
@@ -290,11 +290,11 @@ class W {
|
|
|
290
290
|
);
|
|
291
291
|
this.dot0.style.opacity = `${g(
|
|
292
292
|
0,
|
|
293
|
-
Math.max(0, r *
|
|
293
|
+
Math.max(0, r * l),
|
|
294
294
|
1
|
|
295
295
|
)}`, this.dot1.style.opacity = `${g(
|
|
296
296
|
0,
|
|
297
|
-
Math.max(0, r *
|
|
297
|
+
Math.max(0, r * h),
|
|
298
298
|
1
|
|
299
299
|
)}`, this.dot2.style.opacity = `${g(
|
|
300
300
|
0,
|
|
@@ -311,7 +311,7 @@ class W {
|
|
|
311
311
|
this.element.remove();
|
|
312
312
|
}
|
|
313
313
|
}
|
|
314
|
-
class
|
|
314
|
+
class S {
|
|
315
315
|
currentPosition = 0;
|
|
316
316
|
targetPosition = 0;
|
|
317
317
|
currentTime = 0;
|
|
@@ -325,7 +325,7 @@ class P {
|
|
|
325
325
|
}
|
|
326
326
|
resetSolver() {
|
|
327
327
|
const e = this.getV(this.currentTime);
|
|
328
|
-
this.currentTime = 0, this.currentSolver =
|
|
328
|
+
this.currentTime = 0, this.currentSolver = q(
|
|
329
329
|
this.currentPosition,
|
|
330
330
|
e,
|
|
331
331
|
this.targetPosition,
|
|
@@ -363,35 +363,35 @@ class P {
|
|
|
363
363
|
return this.currentPosition;
|
|
364
364
|
}
|
|
365
365
|
}
|
|
366
|
-
function
|
|
367
|
-
const
|
|
368
|
-
if (
|
|
369
|
-
const o = -Math.sqrt(s /
|
|
370
|
-
return (m) => (m -= i, m < 0 ?
|
|
366
|
+
function q(d, e, t, i = 0, n) {
|
|
367
|
+
const a = n?.soft ?? !1, s = n?.stiffness ?? 100, r = n?.damping ?? 10, l = n?.mass ?? 1, h = t - d;
|
|
368
|
+
if (a || 1 <= r / (2 * Math.sqrt(s * l))) {
|
|
369
|
+
const o = -Math.sqrt(s / l), c = -o * h - e;
|
|
370
|
+
return (m) => (m -= i, m < 0 ? d : t - (h + m * c) * Math.E ** (m * o));
|
|
371
371
|
} else {
|
|
372
372
|
const o = Math.sqrt(
|
|
373
|
-
4 *
|
|
374
|
-
),
|
|
375
|
-
return (
|
|
373
|
+
4 * l * s - r ** 2
|
|
374
|
+
), c = (r * h - 2 * l * e) / o, m = 0.5 * o / l, p = -(0.5 * r) / l;
|
|
375
|
+
return (u) => (u -= i, u < 0 ? d : t - (Math.cos(u * m) * h + Math.sin(u * m) * c) * Math.E ** (u * p));
|
|
376
376
|
}
|
|
377
377
|
}
|
|
378
|
-
function
|
|
379
|
-
return (t) => (
|
|
378
|
+
function F(d) {
|
|
379
|
+
return (t) => (d(t + 1e-3) - d(t - 1e-3)) / (2 * 1e-3);
|
|
380
380
|
}
|
|
381
|
-
function R(
|
|
382
|
-
return
|
|
381
|
+
function R(d) {
|
|
382
|
+
return F(d);
|
|
383
383
|
}
|
|
384
|
-
const
|
|
385
|
-
function
|
|
386
|
-
const i = 2 +
|
|
384
|
+
const w = /^[\p{Unified_Ideograph}\u0800-\u9FFC]+$/u;
|
|
385
|
+
function W(d, e = "rgba(0,0,0,1)", t = "rgba(0,0,0,0.5)") {
|
|
386
|
+
const i = 2 + d, n = d / i, a = (1 - n) / 2;
|
|
387
387
|
return [
|
|
388
|
-
`linear-gradient(to right,${e} ${
|
|
388
|
+
`linear-gradient(to right,${e} ${a * 100}%,${t} ${(a + n) * 100}%)`,
|
|
389
389
|
n,
|
|
390
390
|
i
|
|
391
391
|
];
|
|
392
392
|
}
|
|
393
|
-
function
|
|
394
|
-
return
|
|
393
|
+
function P(d) {
|
|
394
|
+
return d.endTime - d.startTime >= 1e3 && d.word.length <= 7;
|
|
395
395
|
}
|
|
396
396
|
class _ {
|
|
397
397
|
constructor(e, t = {
|
|
@@ -407,8 +407,8 @@ class _ {
|
|
|
407
407
|
"class",
|
|
408
408
|
this.lyricPlayer.style.classes.lyricLine
|
|
409
409
|
), this.lyricLine.isBG && this.element.classList.add(this.lyricPlayer.style.classes.lyricBgLine), this.lyricLine.isDuet && this.element.classList.add(this.lyricPlayer.style.classes.lyricDuetLine), this.element.appendChild(document.createElement("div")), this.element.appendChild(document.createElement("div")), this.element.appendChild(document.createElement("div"));
|
|
410
|
-
const i = this.element.children[0], n = this.element.children[1],
|
|
411
|
-
i.setAttribute("class", this.lyricPlayer.style.classes.lyricMainLine), n.setAttribute("class", this.lyricPlayer.style.classes.lyricSubLine),
|
|
410
|
+
const i = this.element.children[0], n = this.element.children[1], a = this.element.children[2];
|
|
411
|
+
i.setAttribute("class", this.lyricPlayer.style.classes.lyricMainLine), n.setAttribute("class", this.lyricPlayer.style.classes.lyricSubLine), a.setAttribute("class", this.lyricPlayer.style.classes.lyricSubLine), this.rebuildElement(), this.rebuildStyle();
|
|
412
412
|
}
|
|
413
413
|
element = document.createElement("div");
|
|
414
414
|
left = 0;
|
|
@@ -420,9 +420,9 @@ class _ {
|
|
|
420
420
|
// 由 LyricPlayer 来设置
|
|
421
421
|
lineSize = [0, 0];
|
|
422
422
|
lineTransforms = {
|
|
423
|
-
posX: new
|
|
424
|
-
posY: new
|
|
425
|
-
scale: new
|
|
423
|
+
posX: new S(0),
|
|
424
|
+
posY: new S(0),
|
|
425
|
+
scale: new S(1)
|
|
426
426
|
};
|
|
427
427
|
isEnabled = !1;
|
|
428
428
|
enable() {
|
|
@@ -480,19 +480,11 @@ class _ {
|
|
|
480
480
|
}
|
|
481
481
|
rebuildElement() {
|
|
482
482
|
const e = this.element.children[0], t = this.element.children[1], i = this.element.children[2];
|
|
483
|
-
this.splittedWords = [], this.lyricLine.words.forEach((
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
height: 0,
|
|
489
|
-
elements: [],
|
|
490
|
-
elementAnimations: [],
|
|
491
|
-
shouldEmphasize: E(a)
|
|
492
|
-
});
|
|
493
|
-
else {
|
|
494
|
-
const l = /^(\s*)(\S*)(\s*)$/.exec(a.word);
|
|
495
|
-
l ? (l[1].length > 0 && this.splittedWords.push({
|
|
483
|
+
this.splittedWords = [], this.lyricLine.words.forEach((l) => {
|
|
484
|
+
const h = l.word.split(/\s+/), o = h.reduce((m, p) => m + p.length, 0);
|
|
485
|
+
let c = 0;
|
|
486
|
+
h.forEach((m, p) => {
|
|
487
|
+
p > 0 && this.splittedWords.push({
|
|
496
488
|
word: " ",
|
|
497
489
|
startTime: 0,
|
|
498
490
|
endTime: 0,
|
|
@@ -502,81 +494,63 @@ class _ {
|
|
|
502
494
|
elementAnimations: [],
|
|
503
495
|
shouldEmphasize: !1
|
|
504
496
|
}), this.splittedWords.push({
|
|
505
|
-
word:
|
|
506
|
-
startTime:
|
|
507
|
-
endTime:
|
|
508
|
-
width: 0,
|
|
509
|
-
height: 0,
|
|
510
|
-
elements: [],
|
|
511
|
-
elementAnimations: [],
|
|
512
|
-
shouldEmphasize: E(a)
|
|
513
|
-
}), l[3].length > 0 && this.splittedWords.push({
|
|
514
|
-
word: " ",
|
|
515
|
-
startTime: 0,
|
|
516
|
-
endTime: 0,
|
|
517
|
-
width: 0,
|
|
518
|
-
height: 0,
|
|
519
|
-
elements: [],
|
|
520
|
-
elementAnimations: [],
|
|
521
|
-
shouldEmphasize: !1
|
|
522
|
-
})) : a.word.trim().length > 0 && this.splittedWords.push({
|
|
523
|
-
word: a.word.trim(),
|
|
524
|
-
startTime: a.startTime,
|
|
525
|
-
endTime: a.endTime,
|
|
497
|
+
word: m,
|
|
498
|
+
startTime: l.startTime + (l.endTime - l.startTime) / o * c,
|
|
499
|
+
endTime: l.startTime + (l.endTime - l.startTime) / o * (c + m.length),
|
|
526
500
|
width: 0,
|
|
527
501
|
height: 0,
|
|
528
502
|
elements: [],
|
|
529
503
|
elementAnimations: [],
|
|
530
|
-
shouldEmphasize:
|
|
531
|
-
});
|
|
532
|
-
}
|
|
504
|
+
shouldEmphasize: P(l)
|
|
505
|
+
}), c += m.length;
|
|
506
|
+
});
|
|
533
507
|
});
|
|
534
|
-
const n = [],
|
|
535
|
-
function s(
|
|
536
|
-
for (;
|
|
537
|
-
|
|
508
|
+
const n = [], a = [];
|
|
509
|
+
function s(l) {
|
|
510
|
+
for (; l.firstChild; )
|
|
511
|
+
l.firstChild.nodeType === Node.ELEMENT_NODE ? n.push(e.firstChild) : l.firstChild.nodeType === Node.TEXT_NODE && a.push(e.firstChild), l.removeChild(l.firstChild), s(l.firstChild);
|
|
538
512
|
}
|
|
539
513
|
s(e);
|
|
540
514
|
let r = null;
|
|
541
|
-
this.splittedWords.forEach((
|
|
542
|
-
if (
|
|
543
|
-
if (
|
|
544
|
-
const
|
|
545
|
-
|
|
546
|
-
for (const o of
|
|
547
|
-
const
|
|
548
|
-
|
|
515
|
+
this.splittedWords.forEach((l) => {
|
|
516
|
+
if (l.word.trim().length > 0)
|
|
517
|
+
if (l.shouldEmphasize) {
|
|
518
|
+
const h = n.pop() ?? document.createElement("span");
|
|
519
|
+
h.className = "emphasize", l.elements = [h];
|
|
520
|
+
for (const o of l.word) {
|
|
521
|
+
const c = n.pop() ?? document.createElement("span");
|
|
522
|
+
c.className = "", c.innerText = o, h.appendChild(c), l.elements.push(c);
|
|
549
523
|
}
|
|
550
|
-
if (
|
|
524
|
+
if (l.elementAnimations = this.initEmphasizeAnimation(l), console.log(l.word, w.test(l.word)), r && !w.test(l.word))
|
|
551
525
|
if (r.childElementCount > 0)
|
|
552
|
-
r.appendChild(
|
|
526
|
+
r.appendChild(h);
|
|
553
527
|
else {
|
|
554
528
|
const o = n.pop() ?? document.createElement("span");
|
|
555
|
-
o.className = "", r.remove(), o.appendChild(r), o.appendChild(
|
|
529
|
+
o.className = "", r.remove(), o.appendChild(r), o.appendChild(h), e.appendChild(o), r = o;
|
|
556
530
|
}
|
|
557
531
|
else
|
|
558
|
-
r =
|
|
532
|
+
r = w.test(l.word) ? null : h, e.appendChild(h);
|
|
559
533
|
} else {
|
|
560
|
-
const
|
|
561
|
-
if (
|
|
534
|
+
const h = n.pop() ?? document.createElement("span");
|
|
535
|
+
if (h.className = "", h.innerText = l.word, l.elements = [h], l.elementAnimations.push(this.initFloatAnimation(l, h)), r)
|
|
562
536
|
if (r.childElementCount > 0)
|
|
563
|
-
r.appendChild(
|
|
537
|
+
r.appendChild(h);
|
|
564
538
|
else {
|
|
565
539
|
const o = n.pop() ?? document.createElement("span");
|
|
566
|
-
o.className = "", r.remove(), o.appendChild(r), o.appendChild(
|
|
540
|
+
o.className = "", r.remove(), o.appendChild(r), o.appendChild(h), e.appendChild(o), r = o;
|
|
567
541
|
}
|
|
568
542
|
else
|
|
569
|
-
r =
|
|
543
|
+
r = h, e.appendChild(h);
|
|
570
544
|
}
|
|
571
|
-
else if (
|
|
572
|
-
const
|
|
573
|
-
e.appendChild(
|
|
545
|
+
else if (l.word.length > 0) {
|
|
546
|
+
const h = a.pop() ?? document.createTextNode(" ");
|
|
547
|
+
e.appendChild(h), r = null;
|
|
574
548
|
} else
|
|
575
549
|
r = null;
|
|
576
550
|
}), t.innerText = this.lyricLine.translatedLyric, i.innerText = this.lyricLine.romanLyric;
|
|
577
551
|
}
|
|
578
552
|
initFloatAnimation(e, t) {
|
|
579
|
-
const i = t.animate(
|
|
553
|
+
const i = e.startTime - this.lyricLine.startTime, n = Math.max(1e3, e.endTime - e.startTime), a = t.animate(
|
|
580
554
|
[
|
|
581
555
|
{
|
|
582
556
|
transform: "translateY(0px)"
|
|
@@ -586,19 +560,19 @@ class _ {
|
|
|
586
560
|
}
|
|
587
561
|
],
|
|
588
562
|
{
|
|
589
|
-
duration:
|
|
590
|
-
delay:
|
|
563
|
+
duration: isFinite(n) ? n : 0,
|
|
564
|
+
delay: isFinite(i) ? i : 0,
|
|
591
565
|
id: "float-word",
|
|
592
566
|
composite: "add",
|
|
593
567
|
fill: "both"
|
|
594
568
|
}
|
|
595
569
|
);
|
|
596
|
-
return
|
|
570
|
+
return a.pause(), a;
|
|
597
571
|
}
|
|
598
572
|
initEmphasizeAnimation(e) {
|
|
599
573
|
const t = e.startTime - this.lyricLine.startTime, i = e.endTime - e.startTime;
|
|
600
|
-
return e.elements.map((n,
|
|
601
|
-
if (
|
|
574
|
+
return e.elements.map((n, a, s) => {
|
|
575
|
+
if (a === 0)
|
|
602
576
|
return this.initFloatAnimation(e, n);
|
|
603
577
|
{
|
|
604
578
|
const r = n.animate(
|
|
@@ -621,7 +595,7 @@ class _ {
|
|
|
621
595
|
],
|
|
622
596
|
{
|
|
623
597
|
duration: Math.max(1e3, e.endTime - e.startTime),
|
|
624
|
-
delay: t + i / (s.length - 1) * (
|
|
598
|
+
delay: t + i / (s.length - 1) * (a - 1),
|
|
625
599
|
id: "glow-word",
|
|
626
600
|
iterations: 1,
|
|
627
601
|
composite: "replace",
|
|
@@ -637,37 +611,37 @@ class _ {
|
|
|
637
611
|
const t = e.elements[0];
|
|
638
612
|
if (t) {
|
|
639
613
|
e.width = t.clientWidth, e.height = t.clientHeight;
|
|
640
|
-
const [i, n,
|
|
614
|
+
const [i, n, a] = W(
|
|
641
615
|
16 / e.width,
|
|
642
616
|
"rgba(0,0,0,0.75)",
|
|
643
617
|
"rgba(0,0,0,0.25)"
|
|
644
|
-
), s = `${
|
|
618
|
+
), s = `${a * 100}% 100%`;
|
|
645
619
|
this.lyricPlayer.supportMaskImage ? (t.style.maskImage = i, t.style.maskOrigin = "left", t.style.maskSize = s) : (t.style.webkitMaskImage = i, t.style.webkitMaskOrigin = "left", t.style.webkitMaskSize = s);
|
|
646
|
-
const r = e.width + 16,
|
|
647
|
-
t.style.maskPosition =
|
|
620
|
+
const r = e.width + 16, l = `clamp(${-r}px,calc(${-r}px + (var(--amll-player-time) - ${e.startTime})*${r / Math.abs(e.endTime - e.startTime)}px),0px) 0px, left top`;
|
|
621
|
+
t.style.maskPosition = l, t.style.webkitMaskPosition = l;
|
|
648
622
|
}
|
|
649
623
|
}), this._hide && (this.element.style.display = "none", this.element.style.visibility = "");
|
|
650
624
|
}
|
|
651
625
|
getElement() {
|
|
652
626
|
return this.element;
|
|
653
627
|
}
|
|
654
|
-
setTransform(e = this.left, t = this.top, i = this.scale, n = 1,
|
|
628
|
+
setTransform(e = this.left, t = this.top, i = this.scale, n = 1, a = 0, s = !1, r = 0) {
|
|
655
629
|
this.left = e, this.top = t, this.scale = i, this.delay = r * 1e3 | 0;
|
|
656
|
-
const
|
|
657
|
-
|
|
630
|
+
const l = this.element.children[0];
|
|
631
|
+
l.style.opacity = `${n}`, s || !this.lyricPlayer.getEnableSpring() ? (this.blur = Math.min(32, a), s && this.element.classList.add(
|
|
658
632
|
this.lyricPlayer.style.classes.tmpDisableTransition
|
|
659
633
|
), this.lineTransforms.posX.setPosition(e), this.lineTransforms.posY.setPosition(t), this.lineTransforms.scale.setPosition(i), this.lyricPlayer.getEnableSpring() ? this.rebuildStyle() : this.show(), s && requestAnimationFrame(() => {
|
|
660
634
|
this.element.classList.remove(
|
|
661
635
|
this.lyricPlayer.style.classes.tmpDisableTransition
|
|
662
636
|
);
|
|
663
|
-
})) : (this.lineTransforms.posX.setTargetPosition(e, r), this.lineTransforms.posY.setTargetPosition(t, r), this.lineTransforms.scale.setTargetPosition(i), this.blur !== Math.min(32,
|
|
637
|
+
})) : (this.lineTransforms.posX.setTargetPosition(e, r), this.lineTransforms.posY.setTargetPosition(t, r), this.lineTransforms.scale.setTargetPosition(i), this.blur !== Math.min(32, a) && (this.blur = Math.min(32, a), this.element.style.filter = `blur(${Math.min(32, a)}px)`));
|
|
664
638
|
}
|
|
665
639
|
update(e = 0) {
|
|
666
640
|
this.lyricPlayer.getEnableSpring() && (this.lineTransforms.posX.update(e), this.lineTransforms.posY.update(e), this.lineTransforms.scale.update(e), this.isInSight ? this.show() : this.hide());
|
|
667
641
|
}
|
|
668
642
|
get isInSight() {
|
|
669
|
-
const e = this.lineTransforms.posX.getCurrentPosition(), t = this.lineTransforms.posY.getCurrentPosition(), i = e + this.lineSize[0], n = t + this.lineSize[1],
|
|
670
|
-
return !(e > r || t >
|
|
643
|
+
const e = this.lineTransforms.posX.getCurrentPosition(), t = this.lineTransforms.posY.getCurrentPosition(), i = e + this.lineSize[0], n = t + this.lineSize[1], a = this.lyricPlayer.pos[0], s = this.lyricPlayer.pos[1], r = this.lyricPlayer.pos[0] + this.lyricPlayer.size[0], l = this.lyricPlayer.pos[1] + this.lyricPlayer.size[1];
|
|
644
|
+
return !(e > r || t > l || i < a || n < s);
|
|
671
645
|
}
|
|
672
646
|
dispose() {
|
|
673
647
|
this.element.remove();
|
|
@@ -839,7 +813,7 @@ class ee extends EventTarget {
|
|
|
839
813
|
this.calcLayout(!0);
|
|
840
814
|
};
|
|
841
815
|
constructor() {
|
|
842
|
-
super(), this.interludeDots = new
|
|
816
|
+
super(), this.interludeDots = new $(this), this.element.setAttribute("class", this.style.classes.lyricPlayer), this.disableSpring && this.element.classList.add(this.style.classes.disableSpring), this.rebuildStyle(), this.resizeObserver.observe(this.element), this.element.appendChild(this.interludeDots.getElement()), this.style.attach(), this.interludeDots.setTransform(0, 200), window.addEventListener("pageshow", this.onPageShow);
|
|
843
817
|
}
|
|
844
818
|
/**
|
|
845
819
|
* 获取当前播放时间里是否处于间奏区间
|
|
@@ -855,11 +829,12 @@ class ee extends EventTarget {
|
|
|
855
829
|
const e = this.currentTime + 20, t = this.scrollToIndex;
|
|
856
830
|
if (t === 0) {
|
|
857
831
|
if (this.processedLines[0]?.startTime && this.processedLines[0].startTime > e)
|
|
858
|
-
return [0, this.processedLines[0].startTime];
|
|
832
|
+
return [0, this.processedLines[0].startTime, -2];
|
|
859
833
|
} else if (this.processedLines[t]?.endTime && this.processedLines[t + 1]?.startTime && this.processedLines[t + 1].startTime > e && this.processedLines[t].endTime < e)
|
|
860
834
|
return [
|
|
861
835
|
this.processedLines[t].endTime,
|
|
862
|
-
this.processedLines[t + 1].startTime
|
|
836
|
+
this.processedLines[t + 1].startTime,
|
|
837
|
+
t
|
|
863
838
|
];
|
|
864
839
|
}
|
|
865
840
|
/**
|
|
@@ -885,13 +860,15 @@ class ee extends EventTarget {
|
|
|
885
860
|
setLyricLines(e) {
|
|
886
861
|
this.lyricLines = e;
|
|
887
862
|
const t = 750;
|
|
888
|
-
this.processedLines = e.
|
|
863
|
+
this.processedLines = e.filter(
|
|
864
|
+
(i) => i.words.reduce((n, a) => n + a.word.trim().length, 0) > 0
|
|
865
|
+
).map((i, n, a) => {
|
|
889
866
|
if (i.isBG)
|
|
890
867
|
return {
|
|
891
868
|
...i
|
|
892
869
|
};
|
|
893
870
|
{
|
|
894
|
-
const s =
|
|
871
|
+
const s = a[n - 1], r = a[n - 2];
|
|
895
872
|
if (s?.isBG && r) {
|
|
896
873
|
if (r.endTime < i.startTime)
|
|
897
874
|
return {
|
|
@@ -907,19 +884,19 @@ class ee extends EventTarget {
|
|
|
907
884
|
...i
|
|
908
885
|
};
|
|
909
886
|
}
|
|
910
|
-
}), this.processedLines.forEach((i, n,
|
|
911
|
-
const s =
|
|
912
|
-
r &&
|
|
913
|
-
}), this.processedLines.forEach((i, n,
|
|
887
|
+
}), this.processedLines.forEach((i, n, a) => {
|
|
888
|
+
const s = a[n + 1], r = i.words[i.words.length - 1];
|
|
889
|
+
r && P(r) && (s ? s.startTime > i.endTime && (i.endTime = Math.min(i.endTime + 1500, s.startTime)) : i.endTime = i.endTime + 1500);
|
|
890
|
+
}), this.processedLines.forEach((i, n, a) => {
|
|
914
891
|
if (i.isBG)
|
|
915
892
|
return;
|
|
916
|
-
const s =
|
|
893
|
+
const s = a[n + 1];
|
|
917
894
|
s?.isBG && (s.startTime = Math.min(s.startTime, i.startTime));
|
|
918
895
|
}), this.lyricLinesEl.forEach((i) => i.dispose()), this.lyricLinesEl = this.processedLines.map(
|
|
919
896
|
(i) => new _(this, i)
|
|
920
897
|
), this.lyricLinesEl.forEach((i) => {
|
|
921
898
|
this.element.appendChild(i.getElement()), i.updateMaskImage();
|
|
922
|
-
}), this.setLinePosXSpringParams({}), this.setLinePosYSpringParams({}), this.setLineScaleSpringParams({}), this.setCurrentTime(0, !0), this.calcLayout(!0);
|
|
899
|
+
}), this.hotLines.clear(), this.bufferedLines.clear(), this.setLinePosXSpringParams({}), this.setLinePosYSpringParams({}), this.setLineScaleSpringParams({}), this.setCurrentTime(0, !0), this.calcLayout(!0);
|
|
923
900
|
}
|
|
924
901
|
/**
|
|
925
902
|
* 重新布局定位歌词行的位置,调用完成后再逐帧调用 `update`
|
|
@@ -936,50 +913,50 @@ class ee extends EventTarget {
|
|
|
936
913
|
* @param reflow 是否进行重新布局(重新计算每行歌词大小)
|
|
937
914
|
*/
|
|
938
915
|
calcLayout(e = !1) {
|
|
939
|
-
e && (this.lyricLinesEl.forEach((
|
|
940
|
-
const
|
|
941
|
-
this.lyricLinesSize.set(
|
|
916
|
+
e && (this.lyricLinesEl.forEach((o) => {
|
|
917
|
+
const c = o.measureSize();
|
|
918
|
+
this.lyricLinesSize.set(o, c), o.lineSize = c;
|
|
942
919
|
}), this.interludeDotsSize[0] = this.interludeDots.getElement().clientWidth, this.interludeDotsSize[1] = this.interludeDots.getElement().clientHeight);
|
|
943
920
|
const t = 0.95;
|
|
944
921
|
let n = -this.lyricLinesEl.slice(0, this.scrollToIndex).reduce(
|
|
945
|
-
(
|
|
922
|
+
(o, c) => o + (c.getLine().isBG ? 0 : this.lyricLinesSize.get(c)?.[1] ?? 0),
|
|
946
923
|
0
|
|
947
924
|
);
|
|
948
925
|
if (this.alignAnchor === "bottom") {
|
|
949
926
|
n += this.element.clientHeight / 2;
|
|
950
|
-
const
|
|
951
|
-
if (
|
|
952
|
-
const
|
|
953
|
-
n -=
|
|
927
|
+
const o = this.lyricLinesEl[this.scrollToIndex];
|
|
928
|
+
if (o) {
|
|
929
|
+
const c = this.lyricLinesSize.get(o)?.[1] ?? 0;
|
|
930
|
+
n -= c / 2;
|
|
954
931
|
}
|
|
955
932
|
} else if (typeof this.alignAnchor == "number") {
|
|
956
933
|
n += this.element.clientHeight * this.alignAnchor;
|
|
957
|
-
const
|
|
958
|
-
if (
|
|
959
|
-
const
|
|
960
|
-
n -=
|
|
934
|
+
const o = this.lyricLinesEl[this.scrollToIndex];
|
|
935
|
+
if (o) {
|
|
936
|
+
const c = this.lyricLinesSize.get(o)?.[1] ?? 0;
|
|
937
|
+
n -= c / 2;
|
|
961
938
|
}
|
|
962
939
|
}
|
|
963
|
-
const
|
|
940
|
+
const a = this.getCurrentInterlude();
|
|
964
941
|
let s = 0;
|
|
965
|
-
if (
|
|
966
|
-
const
|
|
967
|
-
|
|
942
|
+
if (a && (s = a[1] - a[0], s >= 5e3)) {
|
|
943
|
+
const o = this.lyricLinesEl[a[2] + 1];
|
|
944
|
+
o && (n -= this.lyricLinesSize.get(o)?.[1] ?? 0);
|
|
968
945
|
}
|
|
969
946
|
const r = Math.max(...this.bufferedLines);
|
|
970
|
-
let
|
|
971
|
-
this.lyricLinesEl.forEach((
|
|
972
|
-
const
|
|
973
|
-
let
|
|
974
|
-
u.isDuet && (
|
|
975
|
-
|
|
947
|
+
let l = 0, h = !1;
|
|
948
|
+
this.lyricLinesEl.forEach((o, c) => {
|
|
949
|
+
const m = this.bufferedLines.has(c), p = m || c >= this.scrollToIndex && c < r, u = o.getLine();
|
|
950
|
+
let f = 0;
|
|
951
|
+
u.isDuet && (f = this.size[0] - (this.lyricLinesSize.get(o)?.[0] ?? 0)), !h && s >= 5e3 && (c === this.scrollToIndex && a?.[2] === -2 || c === this.scrollToIndex + 1) && (h = !0, this.interludeDots.setTransform(0, n), a && this.interludeDots.setInterlude([a[0], a[1]]), n += this.interludeDotsSize[1]), o.setTransform(
|
|
952
|
+
f,
|
|
976
953
|
n,
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
this.enableBlur ? 3 * (
|
|
954
|
+
p ? 1 : t,
|
|
955
|
+
m ? 1 : 1 / 3,
|
|
956
|
+
this.enableBlur ? 3 * (p ? 0 : 1 + (c < this.scrollToIndex ? Math.abs(this.scrollToIndex - c) : Math.abs(c - Math.max(this.scrollToIndex, r)))) : 0,
|
|
980
957
|
e,
|
|
981
|
-
|
|
982
|
-
), u.isBG &&
|
|
958
|
+
l
|
|
959
|
+
), u.isBG && p ? n += this.lyricLinesSize.get(o)?.[1] ?? 0 : u.isBG || (n += this.lyricLinesSize.get(o)?.[1] ?? 0), n >= 0 && (l += 0.05);
|
|
983
960
|
});
|
|
984
961
|
}
|
|
985
962
|
/**
|
|
@@ -1023,30 +1000,31 @@ class ee extends EventTarget {
|
|
|
1023
1000
|
*/
|
|
1024
1001
|
setCurrentTime(e, t = !1) {
|
|
1025
1002
|
this.currentTime = e, this.element.style.setProperty("--amll-player-time", `${e}`);
|
|
1026
|
-
const i = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Set(),
|
|
1003
|
+
const i = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Set(), a = /* @__PURE__ */ new Set();
|
|
1027
1004
|
this.hotLines.forEach((s) => {
|
|
1028
1005
|
const r = this.processedLines[s];
|
|
1029
|
-
if (
|
|
1030
|
-
if (r)
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
(r.startTime > e || r.endTime <= e) && (this.hotLines.delete(s), i.add(s), t && this.lyricLinesEl[s].disable());
|
|
1006
|
+
if (r) {
|
|
1007
|
+
if (r.isBG)
|
|
1008
|
+
return;
|
|
1009
|
+
const l = this.processedLines[s + 1];
|
|
1010
|
+
if (l?.isBG) {
|
|
1011
|
+
const h = Math.min(r.startTime, l?.startTime), o = Math.max(r.endTime, l?.endTime);
|
|
1012
|
+
(h > e || o <= e) && (this.hotLines.delete(s), i.add(s), this.hotLines.delete(s + 1), i.add(s + 1), t && (this.lyricLinesEl[s].disable(), this.lyricLinesEl[s + 1].disable()));
|
|
1037
1013
|
} else
|
|
1038
|
-
this.hotLines.delete(s), i.add(s), t && this.lyricLinesEl[s].disable();
|
|
1039
|
-
|
|
1040
|
-
|
|
1014
|
+
(r.startTime > e || r.endTime <= e) && (this.hotLines.delete(s), i.add(s), t && this.lyricLinesEl[s].disable());
|
|
1015
|
+
} else
|
|
1016
|
+
this.hotLines.delete(s), i.add(s), t && this.lyricLinesEl[s].disable();
|
|
1017
|
+
}), this.processedLines.forEach((s, r, l) => {
|
|
1018
|
+
!s.isBG && s.startTime <= e && s.endTime > e && (this.hotLines.has(r) || (this.hotLines.add(r), a.add(r), t && this.lyricLinesEl[r].enable(), l[r + 1]?.isBG && (this.hotLines.add(r + 1), a.add(r + 1), t && this.lyricLinesEl[r + 1].enable())));
|
|
1041
1019
|
}), this.bufferedLines.forEach((s) => {
|
|
1042
1020
|
this.hotLines.has(s) || (n.add(s), t && this.lyricLinesEl[s].disable());
|
|
1043
1021
|
}), t ? (this.bufferedLines.size > 0 ? this.scrollToIndex = Math.min(...this.bufferedLines) : this.scrollToIndex = this.processedLines.findIndex(
|
|
1044
1022
|
(s) => s.startTime >= e
|
|
1045
|
-
), this.bufferedLines.clear(), this.hotLines.forEach((s) => this.bufferedLines.add(s)), this.calcLayout(!0)) : (n.size > 0 ||
|
|
1023
|
+
), this.bufferedLines.clear(), this.hotLines.forEach((s) => this.bufferedLines.add(s)), this.calcLayout(!0)) : (n.size > 0 || a.size > 0) && (n.size === 0 && a.size > 0 ? (a.forEach((s) => {
|
|
1046
1024
|
this.bufferedLines.add(s), this.lyricLinesEl[s].enable();
|
|
1047
|
-
}), this.scrollToIndex = Math.min(...this.bufferedLines)) :
|
|
1025
|
+
}), this.scrollToIndex = Math.min(...this.bufferedLines)) : a.size === 0 && n.size > 0 ? N(n, this.bufferedLines) && this.bufferedLines.forEach((s) => {
|
|
1048
1026
|
this.hotLines.has(s) || (this.bufferedLines.delete(s), this.lyricLinesEl[s].disable());
|
|
1049
|
-
}) : (
|
|
1027
|
+
}) : (a.forEach((s) => {
|
|
1050
1028
|
this.bufferedLines.add(s), this.lyricLinesEl[s].enable();
|
|
1051
1029
|
}), n.forEach((s) => {
|
|
1052
1030
|
this.bufferedLines.delete(s), this.lyricLinesEl[s].disable();
|