@applemusic-like-lyrics/core 0.1.0 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +674 -0
- package/dist/amll-core.cjs +6 -6
- package/dist/amll-core.cjs.map +1 -1
- package/dist/amll-core.js +229 -190
- package/dist/amll-core.js.map +1 -1
- package/dist/bg-render/base.d.ts +6 -6
- package/dist/bg-render/eplor-renderer.d.ts +1 -2
- package/dist/bg-render/index.d.ts +1 -1
- package/dist/bg-render/pixi-renderer.d.ts +1 -1
- package/dist/utils/resource.d.ts +4 -0
- package/package.json +8 -5
package/dist/amll-core.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var a = (o, i, e) => (
|
|
4
|
-
import { Container as
|
|
5
|
-
import { Application as
|
|
1
|
+
var Ie = Object.defineProperty;
|
|
2
|
+
var de = (o, i, e) => i in o ? Ie(o, i, { enumerable: !0, configurable: !0, writable: !0, value: e }) : o[i] = e;
|
|
3
|
+
var a = (o, i, e) => (de(o, typeof i != "symbol" ? i + "" : i, e), e);
|
|
4
|
+
import { Container as me } from "@pixi/display";
|
|
5
|
+
import { Application as fe } from "@pixi/app";
|
|
6
6
|
import { BlurFilter as R } from "@pixi/filter-blur";
|
|
7
7
|
import { ColorMatrixFilter as X } from "@pixi/filter-color-matrix";
|
|
8
|
-
import { Texture as
|
|
8
|
+
import { Texture as ue } from "@pixi/core";
|
|
9
9
|
import { Sprite as N } from "@pixi/sprite";
|
|
10
10
|
import { BulgePinchFilter as G } from "@pixi/filter-bulge-pinch";
|
|
11
|
-
import { create as
|
|
12
|
-
import
|
|
13
|
-
class
|
|
11
|
+
import { create as pe } from "jss";
|
|
12
|
+
import ge from "jss-preset-default";
|
|
13
|
+
class ye {
|
|
14
14
|
}
|
|
15
|
-
class te extends
|
|
15
|
+
class te extends ye {
|
|
16
16
|
constructor(e) {
|
|
17
17
|
super();
|
|
18
18
|
a(this, "observer");
|
|
@@ -56,13 +56,56 @@ class te extends pe {
|
|
|
56
56
|
this.observer.disconnect(), this.canvas.remove();
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
|
-
|
|
59
|
+
function Te(o) {
|
|
60
|
+
return new Promise((i, e) => {
|
|
61
|
+
const t = document.createElement("img");
|
|
62
|
+
t.onload = () => i(t), t.onerror = e, t.src = o, t.crossOrigin = "anonymous", t.decode().then(() => i(t)).catch(e);
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
function Ee(o) {
|
|
66
|
+
return new Promise((i, e) => {
|
|
67
|
+
const t = document.createElement("video");
|
|
68
|
+
let s = !1, l = !1, r = !1;
|
|
69
|
+
t.addEventListener(
|
|
70
|
+
"playing",
|
|
71
|
+
() => {
|
|
72
|
+
s = !0, n();
|
|
73
|
+
},
|
|
74
|
+
!0
|
|
75
|
+
), t.addEventListener(
|
|
76
|
+
"timeupdate",
|
|
77
|
+
() => {
|
|
78
|
+
l = !0, n();
|
|
79
|
+
},
|
|
80
|
+
!0
|
|
81
|
+
), t.addEventListener(
|
|
82
|
+
"error",
|
|
83
|
+
(h) => {
|
|
84
|
+
r = !0, e(h);
|
|
85
|
+
},
|
|
86
|
+
!0
|
|
87
|
+
);
|
|
88
|
+
function n() {
|
|
89
|
+
s && l && !r && i(t);
|
|
90
|
+
}
|
|
91
|
+
t.src = o, t.playsInline = !0, t.crossOrigin = "anonymous", t.autoplay = !0, t.loop = !0, t.muted = !0, t.play();
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
function ie(o, i = !1) {
|
|
95
|
+
return i ? Ee(o) : Te(o);
|
|
96
|
+
}
|
|
97
|
+
function se(o) {
|
|
98
|
+
return new Promise((i, e) => {
|
|
99
|
+
(o instanceof HTMLImageElement ? o.complete : o.readyState >= 3) ? i(o) : (o.onload = () => i(o), o.onerror = e);
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
class we extends me {
|
|
60
103
|
constructor() {
|
|
61
104
|
super(...arguments);
|
|
62
105
|
a(this, "time", 0);
|
|
63
106
|
}
|
|
64
107
|
}
|
|
65
|
-
class
|
|
108
|
+
class pt extends te {
|
|
66
109
|
constructor(e) {
|
|
67
110
|
super(e);
|
|
68
111
|
a(this, "app");
|
|
@@ -84,7 +127,7 @@ class dt extends te {
|
|
|
84
127
|
), l.position.set(this.app.screen.width / 2, this.app.screen.height / 2), r.position.set(this.app.screen.width / 2, this.app.screen.height / 2), t.width = n * Math.sqrt(2), t.height = t.width, s.width = n * 0.8, s.height = s.width, l.width = n * 0.5, l.height = l.width, r.width = n * 0.25, r.height = r.width, this.curContainer.time += e * this.flowSpeed, t.rotation += e / 1e3 * this.flowSpeed, s.rotation -= e / 500 * this.flowSpeed, l.rotation += e / 1e3 * this.flowSpeed, r.rotation -= e / 750 * this.flowSpeed, l.x = this.app.screen.width / 2 + this.app.screen.width / 4 * Math.cos(this.curContainer.time / 1e3 * 0.75), l.y = this.app.screen.height / 2 + this.app.screen.width / 4 * Math.cos(this.curContainer.time / 1e3 * 0.75), r.x = this.app.screen.width / 2 + this.app.screen.width / 4 * 0.1 + Math.cos(this.curContainer.time * 6e-3 * 0.75), r.y = this.app.screen.height / 2 + this.app.screen.width / 4 * 0.1 + Math.cos(this.curContainer.time * 6e-3 * 0.75), this.curContainer.alpha >= 1 && this.lastContainer.size === 0 && this.staticMode && this.app.ticker.stop();
|
|
85
128
|
}
|
|
86
129
|
});
|
|
87
|
-
this.canvas = e, this.app = new
|
|
130
|
+
this.canvas = e, this.app = new fe({
|
|
88
131
|
view: e,
|
|
89
132
|
resizeTo: this.canvas,
|
|
90
133
|
powerPreference: "low-power",
|
|
@@ -148,31 +191,29 @@ class dt extends te {
|
|
|
148
191
|
}
|
|
149
192
|
setHasLyric(e) {
|
|
150
193
|
}
|
|
151
|
-
async
|
|
152
|
-
var
|
|
153
|
-
if (e.trim().length === 0)
|
|
194
|
+
async setAlbum(e, t) {
|
|
195
|
+
var m, f;
|
|
196
|
+
if (typeof e == "string" && e.trim().length === 0)
|
|
154
197
|
return;
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
let s = 5, l;
|
|
158
|
-
for (; !((m = (d = l == null ? void 0 : l.baseTexture) == null ? void 0 : d.resource) != null && m.valid) && s > 0; )
|
|
198
|
+
let s = null, l = 5, r = null;
|
|
199
|
+
for (; !((f = (m = r == null ? void 0 : r.baseTexture) == null ? void 0 : m.resource) != null && f.valid) && l > 0; )
|
|
159
200
|
try {
|
|
160
|
-
await t
|
|
201
|
+
typeof e == "string" ? s = await ie(e, t) : s = await se(e), r = ue.from(s, {
|
|
161
202
|
resourceOptions: {
|
|
162
203
|
autoLoad: !1
|
|
163
204
|
}
|
|
164
|
-
}), await
|
|
165
|
-
} catch (
|
|
205
|
+
}), await r.baseTexture.resource.load();
|
|
206
|
+
} catch (p) {
|
|
166
207
|
console.warn(
|
|
167
|
-
`failed on loading album image, retrying (${
|
|
208
|
+
`failed on loading album image, retrying (${l})`,
|
|
168
209
|
e,
|
|
169
|
-
|
|
170
|
-
),
|
|
210
|
+
p
|
|
211
|
+
), r = null, l--;
|
|
171
212
|
}
|
|
172
|
-
if (!
|
|
213
|
+
if (!r)
|
|
173
214
|
return;
|
|
174
|
-
const
|
|
175
|
-
|
|
215
|
+
const n = new we(), h = new N(r), c = new N(r), I = new N(r), d = new N(r);
|
|
216
|
+
h.anchor.set(0.5, 0.5), c.anchor.set(0.5, 0.5), I.anchor.set(0.5, 0.5), d.anchor.set(0.5, 0.5), h.rotation = Math.random() * Math.PI * 2, c.rotation = Math.random() * Math.PI * 2, I.rotation = Math.random() * Math.PI * 2, d.rotation = Math.random() * Math.PI * 2, n.addChild(h, c, I, d), this.curContainer && this.lastContainer.add(this.curContainer), this.curContainer = n, this.app.stage.addChild(n), this.curContainer.alpha = 0, this.app.ticker.start();
|
|
176
217
|
}
|
|
177
218
|
dispose() {
|
|
178
219
|
super.dispose(), this.app.ticker.remove(this.onTick), this.app.destroy(!0);
|
|
@@ -191,7 +232,7 @@ void main() {
|
|
|
191
232
|
gl_Position = vec4(v_coord, 0.0f, 1.0f);
|
|
192
233
|
f_v_coord = (vec2(v_coord.x, v_coord.y) + vec2(1.0f, 1.0f)) / 2.0f;
|
|
193
234
|
}
|
|
194
|
-
`,
|
|
235
|
+
`, be = `#version 300 es
|
|
195
236
|
precision highp float;
|
|
196
237
|
|
|
197
238
|
uniform sampler2D src;
|
|
@@ -202,7 +243,7 @@ void main() {
|
|
|
202
243
|
vec2 coord = f_v_coord;
|
|
203
244
|
fragColor = texture(src, coord);
|
|
204
245
|
}
|
|
205
|
-
`,
|
|
246
|
+
`, Se = `#version 300 es
|
|
206
247
|
precision highp float;
|
|
207
248
|
|
|
208
249
|
uniform sampler2D src;
|
|
@@ -219,8 +260,8 @@ void main() {
|
|
|
219
260
|
vec4 srcColor = texture(src, tex_coord);
|
|
220
261
|
fragColor = mix(vec4(srcColor.xyz, 0.0f), srcColor, lerp);
|
|
221
262
|
}
|
|
222
|
-
`,
|
|
223
|
-
precision highp float;uniform float IIIlllllllIIIllIl,lIIIlllllIllIl,IIIlllIlIIllll;uniform sampler2D IlllIIlIlllIll;uniform vec2 IIlIlIIlIlIllI,IllIlllIlIIlllI;out vec4 lIIlIIIIIlIlIlllIIIIlIIl;float lIlIIllllIllIll(float IIIlIIlIIIlllIII){IIIlIIlIIIlllIII-=0.;return sin(IIIlIIlIIIlllIII);}float lIlIlllllIllIll(float IIIlIIlIIIlllIII){IIIlIIlIIIlllIII+=acos(0.);return sin(IIIlIIlIIIlllIII);}mat2 lIIllIIlIIIllIl(float IIIlIIlIIIlllIII){return mat2(lIlIlllllIllIll(IIIlIIlIIIlllIII),-lIlIIllllIllIll(IIIlIIlIIIlllIII),lIlIIllllIllIll(IIIlIIlIIIlllIII),lIlIlllllIllIll(IIIlIIlIIIlllIII));}mat2 lIIllIIlIIIlllI(float IIIlIIlIIIlllIII){return mat2(lIlIIllllIllIll(IIIlIIlIIIlllIII),-lIlIlllllIllIll(IIIlIIlIIIlllIII),lIlIlllllIllIll(IIIlIIlIIIlllIII),lIlIIllllIllIll(IIIlIIlIIIlllIII));}float IllllIIlIllII(float llIIllIllIIIllI){return fract(lIlIIllllIllIll(llIIllIllIIIllI)*43758.5453);}float llIlIIllllIII(vec2 IIIlIIlIIIlllIII){vec2 IIllIlIIlllI=floor(IIIlIIlIIIlllIII),lIlIllIIIIIlIl=fract(IIIlIIlIIIlllIII);lIlIllIIIIIlIl=lIlIllIIIIIlIl*lIlIllIIIIIlIl*(3.-2.*lIlIllIIIIIlIl);float lIlIlIlIlIlIIl=IIllIlIIlllI.x+IIllIlIIlllI.y*57.;return mix(mix(IllllIIlIllII(lIlIlIlIlIlIIl),IllllIIlIllII(lIlIlIlIlIlIIl+1.),lIlIllIIIIIlIl.x),mix(IllllIIlIllII(lIlIlIlIlIlIIl+57.),IllllIIlIllII(lIlIlIlIlIlIIl+58.),lIlIllIIIIIlIl.x),lIlIllIIIIIlIl.y);}vec2 lllIIIIIIllIlIIIlI(vec2 IlllIIlIIIIlIIII,float lIIIIlllIIIIllIlIlI,vec2 IlIlIIIIlIlllIlIII){float lIIlIllIIIlIl=llIlIIllllIII(IlllIIlIIIIlIIII*vec2(1)*3.5+.1)*4.2831*mix(.2,1.,IIIlllllllIIIllIl);IlllIIlIIIIlIIII+=vec2(-1,.5);lIIlIllIIIlIl-=lIIIIlllIIIIllIlIlI;return vec2(lIlIlllllIllIll(lIIlIllIIIlIl),lIlIIllllIllIll(lIIlIllIIIlIl));}const mat3 lIIllIIIlllIl=mat3(1.,.02,.002,.02,1.,.008,.002,.02,1.),lIIIlllIIIIll=mat3(1.022,-.02,-.002,-.02,1.028,-.008,-.002,-.02,1.022);void main(){vec2 lIIIlIIllIlIIlI=lIlIIllllIllIll(lIIIlllllIllIl*.2)*.01+.5+gl_FragCoord.xy/IIlIlIIlIlIllI.xy,lIIllIIlIIIllI=lIIIlIIllIlIIlI*.77f+IllIlllIlIIlllI;lIIllIIlIIIllI.x*=IIlIlIIlIlIllI.x/IIlIlIIlIlIllI.y;float lIIlIIlIIlIIIlII=gl_FragCoord.x/max(IIlIlIIlIlIllI.x,IIlIlIIlIlIllI.y),lIIIlIllIllIlIIl=0.f;vec3 lIIIlIlIIIlIlIIl=vec3(0);vec2 lIlIIlIlIIIllIll=lIIllIIlIIIllI;for(int IllIlIIlIIlllllIIIl=0;IllIlIIlIIlllllIIIl<8;IllIlIIlIIlllllIIIl++){bool lIlIlIIllIllIIll=IllIlIIlIIlllllIIIl%2==0;vec2 lIlllIlllIlllII=lllIIIIIIllIlIIIlI(lIIllIIlIIIllI,lIIlIIlIIlIIIlII,lIIIlIIllIlIIlI),lIllIIlIIlIIIll=lIlllIlllIlllII;float lIIlIlIIlIIlIllI=float(IllIlIIlIIlllllIIIl)/8.f;vec3 llIIlIIIIlIIlIII=texture(IlllIIlIlllIll,-lIIIlllllIllIl*.01+.8*lIIllIIlIIIllI*lIIllIIlIIIllIl(-lIIIlllllIllIl*.2)+vec2(IIIlllIlIIllll*.3*(float(lIlIlIIllIllIIll)*2.-1.)*lIIllIIlIIIlllI(lIIIlllllIllIl*.2+1.5))).xyz;lIIIlIlIIIlIlIIl+=llIIlIIIIlIIlIII;lIIIlIllIllIlIIl+=4.f*lIIlIlIIlIIlIllI*(1.f-lIIlIlIIlIIlIllI);lIIllIIlIIIllI+=.01f*lIllIIlIIlIIIll*(lIlIIllllIllIll(lIIIlllllIllIl)*4.8+.8);lIlIIlIlIIIllIll+=.05f*lIllIIlIIlIIIll;}lIIIlIlIIIlIlIIl/=lIIIlIllIllIlIIl;lIIIlIlIIIlIlIIl*=1.6f;lIIIlIlIIIlIlIIl=1.f-exp(-lIIIlIlIIIlIlIIl);lIIIlIlIIIlIlIIl=pow(lIIIlIlIIIlIlIIl,vec3(2.2));lIIIlIlIIIlIlIIl*=.8f;lIIlIIIIIlIlIlllIIIIlIIl=vec4(lIIIlIlIIIlIlIIl,1);}`,
|
|
263
|
+
`, Le = `#version 300 es
|
|
264
|
+
precision highp float;uniform float IIIlllllllIIIllIl,lIIIlllllIllIl,IIIlllIlIIllll;uniform sampler2D IlllIIlIlllIll;uniform vec2 IIlIlIIlIlIllI,IllIlllIlIIlllI;out vec4 lIIlIIIIIlIlIlllIIIIlIIl;float lIlIIllllIllIll(float IIIlIIlIIIlllIII){IIIlIIlIIIlllIII-=0.;return sin(IIIlIIlIIIlllIII);}float lIlIlllllIllIll(float IIIlIIlIIIlllIII){IIIlIIlIIIlllIII+=acos(0.);return sin(IIIlIIlIIIlllIII);}mat2 lIIllIIlIIIllIl(float IIIlIIlIIIlllIII){return mat2(lIlIlllllIllIll(IIIlIIlIIIlllIII),-lIlIIllllIllIll(IIIlIIlIIIlllIII),lIlIIllllIllIll(IIIlIIlIIIlllIII),lIlIlllllIllIll(IIIlIIlIIIlllIII));}mat2 lIIllIIlIIIlllI(float IIIlIIlIIIlllIII){return mat2(lIlIIllllIllIll(IIIlIIlIIIlllIII),-lIlIlllllIllIll(IIIlIIlIIIlllIII),lIlIlllllIllIll(IIIlIIlIIIlllIII),lIlIIllllIllIll(IIIlIIlIIIlllIII));}float IllllIIlIllII(float llIIllIllIIIllI){return fract(lIlIIllllIllIll(llIIllIllIIIllI)*43758.5453);}float llIlIIllllIII(vec2 IIIlIIlIIIlllIII){vec2 IIllIlIIlllI=floor(IIIlIIlIIIlllIII),lIlIllIIIIIlIl=fract(IIIlIIlIIIlllIII);lIlIllIIIIIlIl=lIlIllIIIIIlIl*lIlIllIIIIIlIl*(3.-2.*lIlIllIIIIIlIl);float lIlIlIlIlIlIIl=IIllIlIIlllI.x+IIllIlIIlllI.y*57.;return mix(mix(IllllIIlIllII(lIlIlIlIlIlIIl),IllllIIlIllII(lIlIlIlIlIlIIl+1.),lIlIllIIIIIlIl.x),mix(IllllIIlIllII(lIlIlIlIlIlIIl+57.),IllllIIlIllII(lIlIlIlIlIlIIl+58.),lIlIllIIIIIlIl.x),lIlIllIIIIIlIl.y);}vec2 lllIIIIIIllIlIIIlI(vec2 IlllIIlIIIIlIIII,float lIIIIlllIIIIllIlIlI,vec2 IlIlIIIIlIlllIlIII){float lIIlIllIIIlIl=llIlIIllllIII(IlllIIlIIIIlIIII*vec2(1)*3.5+.1)*4.2831*mix(.2,1.,IIIlllllllIIIllIl);IlllIIlIIIIlIIII+=vec2(-1,.5);lIIlIllIIIlIl-=lIIIIlllIIIIllIlIlI;return vec2(lIlIlllllIllIll(lIIlIllIIIlIl),lIlIIllllIllIll(lIIlIllIIIlIl));}const mat3 lIIllIIIlllIl=mat3(1.,.02,.002,.02,1.,.008,.002,.02,1.),lIIIlllIIIIll=mat3(1.022,-.02,-.002,-.02,1.028,-.008,-.002,-.02,1.022);void main(){vec2 lIIIlIIllIlIIlI=lIlIIllllIllIll(lIIIlllllIllIl*.2)*.01+.5+gl_FragCoord.xy/IIlIlIIlIlIllI.xy,lIIllIIlIIIllI=lIIIlIIllIlIIlI*.77f+IllIlllIlIIlllI;lIIllIIlIIIllI.x*=IIlIlIIlIlIllI.x/IIlIlIIlIlIllI.y;float lIIlIIlIIlIIIlII=gl_FragCoord.x/max(IIlIlIIlIlIllI.x,IIlIlIIlIlIllI.y),lIIIlIllIllIlIIl=0.f;vec3 lIIIlIlIIIlIlIIl=vec3(0);vec2 lIlIIlIlIIIllIll=lIIllIIlIIIllI;for(int IllIlIIlIIlllllIIIl=0;IllIlIIlIIlllllIIIl<8;IllIlIIlIIlllllIIIl++){bool lIlIlIIllIllIIll=IllIlIIlIIlllllIIIl%2==0;vec2 lIlllIlllIlllII=lllIIIIIIllIlIIIlI(lIIllIIlIIIllI,lIIlIIlIIlIIIlII,lIIIlIIllIlIIlI),lIllIIlIIlIIIll=lIlllIlllIlllII;float lIIlIlIIlIIlIllI=float(IllIlIIlIIlllllIIIl)/8.f;vec3 llIIlIIIIlIIlIII=texture(IlllIIlIlllIll,-lIIIlllllIllIl*.01+.8*lIIllIIlIIIllI*lIIllIIlIIIllIl(-lIIIlllllIllIl*.2)+vec2(IIIlllIlIIllll*.3*(float(lIlIlIIllIllIIll)*2.-1.)*lIIllIIlIIIlllI(lIIIlllllIllIl*.2+1.5))).xyz;lIIIlIlIIIlIlIIl+=llIIlIIIIlIIlIII;lIIIlIllIllIlIIl+=4.f*lIIlIlIIlIIlIllI*(1.f-lIIlIlIIlIIlIllI);lIIllIIlIIIllI+=.01f*lIllIIlIIlIIIll*(lIlIIllllIllIll(lIIIlllllIllIl)*4.8+.8);lIlIIlIlIIIllIll+=.05f*lIllIIlIIlIIIll;}lIIIlIlIIIlIlIIl/=lIIIlIllIllIlIIl;lIIIlIlIIIlIlIIl*=1.6f;lIIIlIlIIIlIlIIl=1.f-exp(-lIIIlIlIIIlIlIIl);lIIIlIlIIIlIlIIl=pow(lIIIlIlIIIlIlIIl,vec3(2.2));lIIIlIlIIIlIlIIl*=.8f;lIIlIIIIIlIlIlllIIIIlIIl=vec4(lIIIlIlIIIlIlIIl,1);}`, xe = `#version 300 es
|
|
224
265
|
precision highp float;
|
|
225
266
|
|
|
226
267
|
uniform sampler2D src;
|
|
@@ -240,38 +281,38 @@ void main() {
|
|
|
240
281
|
color += dither;
|
|
241
282
|
fragColor = color;
|
|
242
283
|
}
|
|
243
|
-
`,
|
|
284
|
+
`, Pe = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAYUklEQVR4nH3bV89VVRcF4IX7qNgVe8WKvaIiNsCuYCKCSEg0JCYm/gTjzf4R3njhlRdeWKKi2AvYEBV7b1ixY2+ofPuZcbwxXzie5OQ9Z5+11pxzjDHnKnu/k0477bSN+++/fzvyyCPbdttt17766qu2YcOG9ttvv7U33nijffHFF23atGntgAMOaN98803bc88926RJk9pnn31W10855ZT2888/1/vrr79ur732Wjv00EPbgQce2NavX99eeOGF+nvmmWfWuD4fc8wx1ffDDz9sTz31VPv000/bRx99VL/vsssu7eCDDy57hxxySPv222/L1saNG9vatWsbX19++eXyhb9//PFH23HHHdsHH3zQLrrooorjxRdfrPbG+/jjj9u6devaX3/91aZMmdImT57cdt1114lYu5133rnfeuut28yZM9t+++3XVq9e3T7//PMa9Ljjjqu/m222WTn73HPPtR122KF99913bcsttyyQnnzyybbbbrvVm4MMAe37778vUATIkaOPPrqCe+KJJ9qPP/7Ydt9993bvvfe2lStXtvfee69ttdVW7bzzzmvbbLNN++STT9rUqVPL7jvvvNP+/PPP8o1NNn7//fcakx3XL7300moPyC222KL8ev/99ws8Y2s3xFmAIpD9H374of36669txBEIvf3224UmR1w74YQTyhlgHHTQQeU845Bfs2ZN23fffcsQRn/55Zf6jQJOP/30GvjLL78sMPbee+8y6rM2gvPea6+9yg7Htt1223bSSSe1nXbaqWwC+K677iq2qMU1yqKK0WhUAWGREruuq3GBw8dVq1ZV4Pvss08744wzSgns/fTTT+UzoigIAL53gyM95P7+++9Cj1OQz+ACwb7PHAGA3133phKyY/TVV1+t3zHEAUa8t99++1IDJwAsKFIWkFQQOFaeffbZ9u6775aTgBXskKIVhDEBSxFJCaznOoCpNdJHGlvGNRa5s8N3PiLg5JNPbt1goNfIYKeeemo74ogjKmC5yxlIY/D5559v999/f8nxrLPOqsCBwknIkxcmpISXYFesWFGqIlNKck3bGTNmFNDyltPaUBXnsMWGfKZCeQto/QQqmOnTpxegvvNVH4G7Jg4AG4P8qVM6jCN5JDc5QYZyHHrynFGdDMBhaHJG8ZAy55xzThkFisABBxBsH3/88TUmprAM7VdeeaWcNz5wjSPoPfbYowDj+FFHHVWOC9bYWEuQ0ss1zALGi+qQRxUI8XrrrbdKfbFD5r6rSXzip2uPP/541aNuyJOeDMlCAVQLBI71Cy64oAAAzOabb16VnNzlELlTiNyEsOAES1bkDQhjcJIj2kghQLsmZ+W6AkyalCZAvwFn2bJl7b777qtAyFw9ELxgfNcWKcbBqOColB1KiF9qkBkJqeoNtehDAWaLETR9eemll+oHjPhOGRgnT1Md+WAYIJwCkoJHRgDhoP7amj4ffPDB+s5hzgpSmvjMMTkbx+LcM8880+644452+OGHV7CUE9bZ1t44FEcV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tdxwzQMQpmkAZjutb9J4UyTXjRFS1kGFzp1f10hZB/muBvgLWZ2156w0seBRADmHee2sAchdgcMKY8aVyzl2pxQqE6xUkM+CBAC2MJj/CEOCswn+ZLWKCAqSotm18tl4iimfkaCQjiN5xAD5cUQ+GQBC8kwApjvIQk9OcoBBjDvREQgQGDVD5CwhMmSIPLURZJ48kfO2o9Irx+P2F5ziKOY4zSbV5Ukw9gFOMcayiKrpbPBRH2Pl2UGAq0m+U6mZBxh5WBtp/wOJEZce9OdHHAAAAABJRU5ErkJggg==", Z = (() => {
|
|
244
285
|
const o = document.createElement("img");
|
|
245
|
-
return o.src =
|
|
286
|
+
return o.src = Pe, o;
|
|
246
287
|
})();
|
|
247
|
-
function
|
|
288
|
+
function Ae(o, i, e) {
|
|
248
289
|
const t = o.data, s = o.width, l = o.height;
|
|
249
|
-
let r, n, h, c, I, d, m,
|
|
290
|
+
let r, n, h, c, I, d, m, f, p, y, u, g, E;
|
|
250
291
|
const L = s - 1, w = l - 1, T = i + 1, b = i + T, S = i + 1, M = i + S, x = 1 / (b * M), P = [], A = [], v = [], z = [], O = [], _ = [];
|
|
251
292
|
for (; e-- > 0; ) {
|
|
252
293
|
for (E = g = 0, d = 0; d < l; d++) {
|
|
253
294
|
for (r = t[E] * T, n = t[E + 1] * T, h = t[E + 2] * T, c = t[E + 3] * T, m = 1; m <= i; m++)
|
|
254
|
-
|
|
295
|
+
f = E + ((m > L ? L : m) << 2), r += t[f++], n += t[f++], h += t[f++], c += t[f];
|
|
255
296
|
for (I = 0; I < s; I++)
|
|
256
297
|
P[g] = r, A[g] = n, v[g] = h, z[g] = c, d === 0 && (O[I] = Math.min(I + T, L) << 2, _[I] = Math.max(I - i, 0) << 2), p = E + O[I], y = E + _[I], r += t[p++] - t[y++], n += t[p++] - t[y++], h += t[p++] - t[y++], c += t[p] - t[y], g++;
|
|
257
298
|
E += s << 2;
|
|
258
299
|
}
|
|
259
300
|
for (I = 0; I < s; I++) {
|
|
260
|
-
for (
|
|
261
|
-
|
|
301
|
+
for (u = I, r = P[u] * S, n = A[u] * S, h = v[u] * S, c = z[u] * S, m = 1; m <= i; m++)
|
|
302
|
+
u += m > w ? 0 : s, r += P[u], n += A[u], h += v[u], c += z[u];
|
|
262
303
|
for (g = I << 2, d = 0; d < l; d++)
|
|
263
304
|
t[g] = r * x + 0.5 | 0, t[g + 1] = n * x + 0.5 | 0, t[g + 2] = h * x + 0.5 | 0, t[g + 3] = c * x + 0.5 | 0, I === 0 && (O[d] = Math.min(d + S, w) * s, _[d] = Math.max(d - i, 0) * s), p = I + O[d], y = I + _[d], r += P[p] - P[y], n += A[p] - A[y], h += v[p] - v[y], c += z[p] - z[y], g += s << 2;
|
|
264
305
|
}
|
|
265
306
|
}
|
|
266
307
|
}
|
|
267
|
-
function
|
|
308
|
+
function ve(o, i) {
|
|
268
309
|
const e = o.data;
|
|
269
310
|
for (let t = 0; t < e.length; t += 4) {
|
|
270
311
|
const s = e[t], l = e[t + 1], r = e[t + 2], n = e[t + 3], h = s * 0.3 + l * 0.59 + r * 0.11;
|
|
271
312
|
e[t] = h * (1 - i) + s * i, e[t + 1] = h * (1 - i) + l * i, e[t + 2] = h * (1 - i) + r * i, e[t + 3] = n;
|
|
272
313
|
}
|
|
273
314
|
}
|
|
274
|
-
function
|
|
315
|
+
function Me(o, i) {
|
|
275
316
|
const e = o.data;
|
|
276
317
|
for (let t = 0; t < e.length; t += 4) {
|
|
277
318
|
const s = e[t], l = e[t + 1], r = e[t + 2], n = e[t + 3];
|
|
@@ -428,7 +469,7 @@ class j {
|
|
|
428
469
|
this.gl.deleteBuffer(this.buffer);
|
|
429
470
|
}
|
|
430
471
|
}
|
|
431
|
-
class
|
|
472
|
+
class Re {
|
|
432
473
|
constructor(i, e, t, s, l) {
|
|
433
474
|
a(this, "albumTexture");
|
|
434
475
|
a(this, "alpha", 0);
|
|
@@ -453,7 +494,7 @@ class Pe {
|
|
|
453
494
|
this.gl.deleteTexture(this.albumTexture);
|
|
454
495
|
}
|
|
455
496
|
}
|
|
456
|
-
class
|
|
497
|
+
class De {
|
|
457
498
|
constructor(i) {
|
|
458
499
|
a(this, "tex");
|
|
459
500
|
a(this, "alpha", 0);
|
|
@@ -501,25 +542,25 @@ const F = class F extends te {
|
|
|
501
542
|
a(this, "mainProgram", new q(
|
|
502
543
|
this.gl,
|
|
503
544
|
Y,
|
|
504
|
-
|
|
545
|
+
Le,
|
|
505
546
|
"main"
|
|
506
547
|
));
|
|
507
548
|
a(this, "blendProgram", new q(
|
|
508
549
|
this.gl,
|
|
509
550
|
Y,
|
|
510
|
-
|
|
551
|
+
Se,
|
|
511
552
|
"blend"
|
|
512
553
|
));
|
|
513
554
|
a(this, "copyProgram", new q(
|
|
514
555
|
this.gl,
|
|
515
556
|
Y,
|
|
516
|
-
|
|
557
|
+
be,
|
|
517
558
|
"copy"
|
|
518
559
|
));
|
|
519
560
|
a(this, "noiseProgram", new q(
|
|
520
561
|
this.gl,
|
|
521
562
|
Y,
|
|
522
|
-
|
|
563
|
+
xe,
|
|
523
564
|
"noise"
|
|
524
565
|
));
|
|
525
566
|
a(this, "vertexBuffer", new j(
|
|
@@ -534,7 +575,7 @@ const F = class F extends te {
|
|
|
534
575
|
F.rawIndexBuffer,
|
|
535
576
|
this.gl.STATIC_DRAW
|
|
536
577
|
));
|
|
537
|
-
a(this, "noiseTexture", new
|
|
578
|
+
a(this, "noiseTexture", new De(this.gl));
|
|
538
579
|
a(this, "fb");
|
|
539
580
|
a(this, "historyFrameBuffer", []);
|
|
540
581
|
a(this, "_currentSize", [0, 0]);
|
|
@@ -649,46 +690,44 @@ const F = class F extends te {
|
|
|
649
690
|
resume() {
|
|
650
691
|
this.paused = !1, this.requestTick();
|
|
651
692
|
}
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
}
|
|
658
|
-
async setAlbumImage(e) {
|
|
659
|
-
if (e.trim().length === 0)
|
|
660
|
-
return;
|
|
661
|
-
let t = 5, s = null;
|
|
662
|
-
for (; !s && t > 0; )
|
|
693
|
+
async setAlbum(e, t = !1) {
|
|
694
|
+
if (typeof e == "string" && e.trim().length === 0)
|
|
695
|
+
throw new Error("Empty album url");
|
|
696
|
+
let s = null, l = 5;
|
|
697
|
+
for (console.log("setAlbum", e); !s && l > 0; )
|
|
663
698
|
try {
|
|
664
|
-
s = await
|
|
665
|
-
} catch (
|
|
699
|
+
typeof e == "string" ? s = await ie(e, t) : s = await se(e);
|
|
700
|
+
} catch (p) {
|
|
666
701
|
console.warn(
|
|
667
|
-
`failed on loading album
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
702
|
+
`failed on loading album resource, retrying (${l})`,
|
|
703
|
+
{
|
|
704
|
+
albumSource: e,
|
|
705
|
+
error: p
|
|
706
|
+
}
|
|
707
|
+
), l--;
|
|
671
708
|
}
|
|
672
|
-
if (!s)
|
|
709
|
+
if (console.log("loaded album resource", s), !s)
|
|
673
710
|
return;
|
|
674
|
-
const
|
|
675
|
-
if (!
|
|
711
|
+
const r = this.reduceImageSizeCanvas, n = r.getContext("2d");
|
|
712
|
+
if (!n)
|
|
676
713
|
throw new Error("Failed to create canvas context");
|
|
677
|
-
|
|
678
|
-
const
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
const d =
|
|
714
|
+
n.clearRect(0, 0, r.width, r.height);
|
|
715
|
+
const h = 10, c = s instanceof HTMLVideoElement ? s.videoWidth : s.naturalWidth, I = s instanceof HTMLVideoElement ? s.videoHeight : s.naturalHeight;
|
|
716
|
+
if (c * I === 0)
|
|
717
|
+
throw new Error("Invalid image size");
|
|
718
|
+
n.drawImage(s, 0, 0, c, I, 0, 0, r.width, r.height);
|
|
719
|
+
const d = n.getImageData(0, 0, r.width, r.height);
|
|
720
|
+
Me(d, 0.8), ve(d, 1.5), Ae(d, h, 4);
|
|
721
|
+
const m = new Re(
|
|
683
722
|
this.gl,
|
|
684
723
|
this.mainProgram,
|
|
685
724
|
this.vertexBuffer,
|
|
686
725
|
this.indexBuffer,
|
|
687
|
-
|
|
726
|
+
d
|
|
688
727
|
);
|
|
689
|
-
this.sprites.push(
|
|
690
|
-
const
|
|
691
|
-
|
|
728
|
+
this.sprites.push(m), this.playTime = Math.random() * 1e5, this.lastFrameTime = performance.now(), console.info(Math.random() * 1e4);
|
|
729
|
+
const f = Number.parseInt((Math.random() * 1e4).toFixed(0)) % 3;
|
|
730
|
+
f === 0 ? this.IllIlllIlIIlllI = [-1.3, -0.9] : f === 1 ? this.IllIlllIlIIlllI = [-1.1, -0.9] : this.IllIlllIlIIlllI = [-1.3, -0.9], this.requestTick();
|
|
692
731
|
}
|
|
693
732
|
setHasLyric(e) {
|
|
694
733
|
this.hasLyric = e, this.requestTick();
|
|
@@ -719,7 +758,7 @@ a(F, "rawVertexBuffer", new Float32Array([
|
|
|
719
758
|
1
|
|
720
759
|
])), a(F, "rawIndexBuffer", new Uint16Array([0, 1, 2, 1, 2, 3]));
|
|
721
760
|
let J = F;
|
|
722
|
-
class
|
|
761
|
+
class le {
|
|
723
762
|
constructor(i, e) {
|
|
724
763
|
a(this, "element");
|
|
725
764
|
a(this, "renderer");
|
|
@@ -727,7 +766,7 @@ class ie {
|
|
|
727
766
|
}
|
|
728
767
|
static new(i) {
|
|
729
768
|
const e = document.createElement("canvas");
|
|
730
|
-
return new
|
|
769
|
+
return new le(new i(e), e);
|
|
731
770
|
}
|
|
732
771
|
setRenderScale(i) {
|
|
733
772
|
this.renderer.setRenderScale(i);
|
|
@@ -753,8 +792,8 @@ class ie {
|
|
|
753
792
|
setHasLyric(i) {
|
|
754
793
|
this.renderer.setHasLyric(i);
|
|
755
794
|
}
|
|
756
|
-
|
|
757
|
-
return this.renderer.
|
|
795
|
+
setAlbum(i, e) {
|
|
796
|
+
return this.renderer.setAlbum(i, e);
|
|
758
797
|
}
|
|
759
798
|
getElement() {
|
|
760
799
|
return this.element;
|
|
@@ -763,12 +802,12 @@ class ie {
|
|
|
763
802
|
this.renderer.dispose(), this.element.remove();
|
|
764
803
|
}
|
|
765
804
|
}
|
|
766
|
-
const
|
|
767
|
-
function
|
|
805
|
+
const Fe = (o, i) => o.size === i.size && [...o].every((e) => i.has(e));
|
|
806
|
+
function Ce(o) {
|
|
768
807
|
return (e) => (o(e + 1e-3) - o(e - 1e-3)) / (2 * 1e-3);
|
|
769
808
|
}
|
|
770
809
|
function K(o) {
|
|
771
|
-
return
|
|
810
|
+
return Ce(o);
|
|
772
811
|
}
|
|
773
812
|
class U {
|
|
774
813
|
constructor(i = 0) {
|
|
@@ -785,7 +824,7 @@ class U {
|
|
|
785
824
|
}
|
|
786
825
|
resetSolver() {
|
|
787
826
|
const i = this.getV(this.currentTime);
|
|
788
|
-
this.currentTime = 0, this.currentSolver =
|
|
827
|
+
this.currentTime = 0, this.currentSolver = ze(
|
|
789
828
|
this.currentPosition,
|
|
790
829
|
i,
|
|
791
830
|
this.targetPosition,
|
|
@@ -825,16 +864,16 @@ class U {
|
|
|
825
864
|
return this.currentPosition;
|
|
826
865
|
}
|
|
827
866
|
}
|
|
828
|
-
function
|
|
867
|
+
function ze(o, i, e, t = 0, s) {
|
|
829
868
|
const l = (s == null ? void 0 : s.soft) ?? !1, r = (s == null ? void 0 : s.stiffness) ?? 100, n = (s == null ? void 0 : s.damping) ?? 10, h = (s == null ? void 0 : s.mass) ?? 1, c = e - o;
|
|
830
869
|
if (l || 1 <= n / (2 * Math.sqrt(r * h))) {
|
|
831
870
|
const p = -Math.sqrt(r / h), y = -p * c - i;
|
|
832
|
-
return (
|
|
871
|
+
return (u) => (u -= t, u < 0 ? o : e - (c + u * y) * Math.E ** (u * p));
|
|
833
872
|
}
|
|
834
|
-
const I = Math.sqrt(4 * h * r - n ** 2), d = (n * c - 2 * h * i) / I, m = 0.5 * I / h,
|
|
835
|
-
return (p) => (p -= t, p < 0 ? o : e - (Math.cos(p * m) * c + Math.sin(p * m) * d) * Math.E ** (p *
|
|
873
|
+
const I = Math.sqrt(4 * h * r - n ** 2), d = (n * c - 2 * h * i) / I, m = 0.5 * I / h, f = -(0.5 * n) / h;
|
|
874
|
+
return (p) => (p -= t, p < 0 ? o : e - (Math.cos(p * m) * c + Math.sin(p * m) * d) * Math.E ** (p * f));
|
|
836
875
|
}
|
|
837
|
-
class
|
|
876
|
+
class Be {
|
|
838
877
|
constructor(i) {
|
|
839
878
|
a(this, "element", document.createElement("div"));
|
|
840
879
|
a(this, "left", 0);
|
|
@@ -891,12 +930,12 @@ class De {
|
|
|
891
930
|
this.element.remove();
|
|
892
931
|
}
|
|
893
932
|
}
|
|
894
|
-
function
|
|
933
|
+
function ke(o) {
|
|
895
934
|
const e = 2.5949095;
|
|
896
935
|
return o < 0.5 ? Math.pow(2 * o, 2) * ((e + 1) * 2 * o - e) / 2 : (Math.pow(2 * o - 2, 2) * ((e + 1) * (o * 2 - 2) + e) + 2) / 2;
|
|
897
936
|
}
|
|
898
937
|
const D = (o, i, e) => Math.max(o, Math.min(i, e));
|
|
899
|
-
class
|
|
938
|
+
class Ue {
|
|
900
939
|
constructor(i) {
|
|
901
940
|
a(this, "element", document.createElement("div"));
|
|
902
941
|
a(this, "dot0", document.createElement("span"));
|
|
@@ -940,7 +979,7 @@ class Ce {
|
|
|
940
979
|
if (s <= t) {
|
|
941
980
|
const l = t / Math.ceil(t / this.targetBreatheDuration);
|
|
942
981
|
let r = 1, n = 1;
|
|
943
|
-
r *= Math.sin(1.5 * Math.PI - s / l * 2) / 20 + 1, s < 1e3 && (r *= 1 - ((1e3 - s) / 1e3) ** 2), s < 500 ? n = 0 : s < 1e3 && (n *= (s - 500) / 500), t - s < 750 && (r *= 1 -
|
|
982
|
+
r *= Math.sin(1.5 * Math.PI - s / l * 2) / 20 + 1, s < 1e3 && (r *= 1 - ((1e3 - s) / 1e3) ** 2), s < 500 ? n = 0 : s < 1e3 && (n *= (s - 500) / 500), t - s < 750 && (r *= 1 - ke(
|
|
944
983
|
(750 - (t - s)) / 750 / 2
|
|
945
984
|
)), t - s < 375 && (n *= D(
|
|
946
985
|
0,
|
|
@@ -985,7 +1024,7 @@ class Ce {
|
|
|
985
1024
|
this.element.remove();
|
|
986
1025
|
}
|
|
987
1026
|
}
|
|
988
|
-
function
|
|
1027
|
+
function Oe() {
|
|
989
1028
|
return [
|
|
990
1029
|
1,
|
|
991
1030
|
0,
|
|
@@ -1005,7 +1044,7 @@ function ze() {
|
|
|
1005
1044
|
1
|
|
1006
1045
|
];
|
|
1007
1046
|
}
|
|
1008
|
-
function
|
|
1047
|
+
function _e(o, i = 1, e = { x: 0, y: 0 }) {
|
|
1009
1048
|
const [t, s] = [e.x, e.y];
|
|
1010
1049
|
return [
|
|
1011
1050
|
o[0] * i,
|
|
@@ -1026,71 +1065,71 @@ function Be(o, i = 1, e = { x: 0, y: 0 }) {
|
|
|
1026
1065
|
o[15]
|
|
1027
1066
|
];
|
|
1028
1067
|
}
|
|
1029
|
-
function
|
|
1068
|
+
function Ne(o, i = 4) {
|
|
1030
1069
|
const e = (t, s) => t.toFixed(i);
|
|
1031
1070
|
return `matrix3d(${o.map(e).join(", ")})`;
|
|
1032
1071
|
}
|
|
1033
|
-
function
|
|
1072
|
+
function Ge(o) {
|
|
1034
1073
|
return o && o.__esModule && Object.prototype.hasOwnProperty.call(o, "default") ? o.default : o;
|
|
1035
1074
|
}
|
|
1036
|
-
var
|
|
1037
|
-
function
|
|
1075
|
+
var Ye = 4, qe = 1e-3, Ve = 1e-7, He = 10, B = 11, V = 1 / (B - 1), We = typeof Float32Array == "function";
|
|
1076
|
+
function re(o, i) {
|
|
1038
1077
|
return 1 - 3 * i + 3 * o;
|
|
1039
1078
|
}
|
|
1040
|
-
function
|
|
1079
|
+
function ne(o, i) {
|
|
1041
1080
|
return 3 * i - 6 * o;
|
|
1042
1081
|
}
|
|
1043
|
-
function
|
|
1082
|
+
function ae(o) {
|
|
1044
1083
|
return 3 * o;
|
|
1045
1084
|
}
|
|
1046
|
-
function
|
|
1047
|
-
return ((
|
|
1085
|
+
function W(o, i, e) {
|
|
1086
|
+
return ((re(i, e) * o + ne(i, e)) * o + ae(i)) * o;
|
|
1048
1087
|
}
|
|
1049
|
-
function
|
|
1050
|
-
return 3 *
|
|
1088
|
+
function oe(o, i, e) {
|
|
1089
|
+
return 3 * re(i, e) * o * o + 2 * ne(i, e) * o + ae(i);
|
|
1051
1090
|
}
|
|
1052
|
-
function
|
|
1091
|
+
function Xe(o, i, e, t, s) {
|
|
1053
1092
|
var l, r, n = 0;
|
|
1054
1093
|
do
|
|
1055
|
-
r = i + (e - i) / 2, l =
|
|
1056
|
-
while (Math.abs(l) >
|
|
1094
|
+
r = i + (e - i) / 2, l = W(r, t, s) - o, l > 0 ? e = r : i = r;
|
|
1095
|
+
while (Math.abs(l) > Ve && ++n < He);
|
|
1057
1096
|
return r;
|
|
1058
1097
|
}
|
|
1059
|
-
function
|
|
1060
|
-
for (var s = 0; s <
|
|
1061
|
-
var l =
|
|
1098
|
+
function Qe(o, i, e, t) {
|
|
1099
|
+
for (var s = 0; s < Ye; ++s) {
|
|
1100
|
+
var l = oe(i, e, t);
|
|
1062
1101
|
if (l === 0)
|
|
1063
1102
|
return i;
|
|
1064
|
-
var r =
|
|
1103
|
+
var r = W(i, e, t) - o;
|
|
1065
1104
|
i -= r / l;
|
|
1066
1105
|
}
|
|
1067
1106
|
return i;
|
|
1068
1107
|
}
|
|
1069
|
-
function
|
|
1108
|
+
function Ze(o) {
|
|
1070
1109
|
return o;
|
|
1071
1110
|
}
|
|
1072
|
-
var
|
|
1111
|
+
var je = function(i, e, t, s) {
|
|
1073
1112
|
if (!(0 <= i && i <= 1 && 0 <= t && t <= 1))
|
|
1074
1113
|
throw new Error("bezier x values must be in [0, 1] range");
|
|
1075
1114
|
if (i === e && t === s)
|
|
1076
|
-
return
|
|
1077
|
-
for (var l =
|
|
1078
|
-
l[r] =
|
|
1115
|
+
return Ze;
|
|
1116
|
+
for (var l = We ? new Float32Array(B) : new Array(B), r = 0; r < B; ++r)
|
|
1117
|
+
l[r] = W(r * V, i, t);
|
|
1079
1118
|
function n(h) {
|
|
1080
1119
|
for (var c = 0, I = 1, d = B - 1; I !== d && l[I] <= h; ++I)
|
|
1081
1120
|
c += V;
|
|
1082
1121
|
--I;
|
|
1083
|
-
var m = (h - l[I]) / (l[I + 1] - l[I]),
|
|
1084
|
-
return p >=
|
|
1122
|
+
var m = (h - l[I]) / (l[I + 1] - l[I]), f = c + m * V, p = oe(f, i, t);
|
|
1123
|
+
return p >= qe ? Qe(h, f, i, t) : p === 0 ? f : Xe(h, c, c + V, i, t);
|
|
1085
1124
|
}
|
|
1086
1125
|
return function(c) {
|
|
1087
|
-
return c === 0 ? 0 : c === 1 ? 1 :
|
|
1126
|
+
return c === 0 ? 0 : c === 1 ? 1 : W(n(c), e, s);
|
|
1088
1127
|
};
|
|
1089
1128
|
};
|
|
1090
|
-
const $ = /* @__PURE__ */
|
|
1129
|
+
const $ = /* @__PURE__ */ Ge(je), Je = /^[\p{Unified_Ideograph}\u0800-\u9FFC]+$/u, H = 32, he = (o, i) => (e) => Math.min(1, Math.max(0, (e - o) / (i - o))), C = 0.4, Ke = he(0, C), $e = he(C, 1), ce = (o) => {
|
|
1091
1130
|
const i = $(0.3, 0, 0.25, 1), e = $(0.5, 0, 0.3, 1);
|
|
1092
|
-
return (t) => t < o ? i(
|
|
1093
|
-
},
|
|
1131
|
+
return (t) => t < o ? i(Ke(t)) : 1 - e($e(t));
|
|
1132
|
+
}, et = ce(C);
|
|
1094
1133
|
function ee(o, i = 0, e = "rgba(0,0,0,0.85)", t = "rgba(0,0,0,0.25)") {
|
|
1095
1134
|
const s = 2 + o + i, l = o / s, r = (1 - l) / 2;
|
|
1096
1135
|
return [
|
|
@@ -1098,7 +1137,7 @@ function ee(o, i = 0, e = "rgba(0,0,0,0.85)", t = "rgba(0,0,0,0.25)") {
|
|
|
1098
1137
|
s
|
|
1099
1138
|
];
|
|
1100
1139
|
}
|
|
1101
|
-
function
|
|
1140
|
+
function tt(o) {
|
|
1102
1141
|
const i = [];
|
|
1103
1142
|
for (const l of o) {
|
|
1104
1143
|
const r = l.word.replace(/\s/g, "").length, n = l.word.split(" ").filter((h) => h.trim().length > 0);
|
|
@@ -1129,19 +1168,19 @@ function Je(o) {
|
|
|
1129
1168
|
const s = [];
|
|
1130
1169
|
for (const l of i) {
|
|
1131
1170
|
const r = l.word;
|
|
1132
|
-
e.push(r), t.push(l), r.length > 0 && r.trim().length === 0 ? (e.pop(), t.pop(), t.length === 1 ? s.push(t[0]) : t.length > 1 && s.push(t), s.push(l), e = [], t = []) : (!/^\s*[^\s]*\s*$/.test(e.join("")) ||
|
|
1171
|
+
e.push(r), t.push(l), r.length > 0 && r.trim().length === 0 ? (e.pop(), t.pop(), t.length === 1 ? s.push(t[0]) : t.length > 1 && s.push(t), s.push(l), e = [], t = []) : (!/^\s*[^\s]*\s*$/.test(e.join("")) || Je.test(r)) && (e.pop(), t.pop(), t.length === 1 ? s.push(t[0]) : t.length > 1 && s.push(t), e = [r], t = [l]);
|
|
1133
1172
|
}
|
|
1134
1173
|
return t.length === 1 ? s.push(t[0]) : s.push(t), s;
|
|
1135
1174
|
}
|
|
1136
1175
|
function k(o) {
|
|
1137
1176
|
return o.endTime - o.startTime >= 1e3 && o.word.trim().length <= 7 && o.word.trim().length >= 1;
|
|
1138
1177
|
}
|
|
1139
|
-
class
|
|
1178
|
+
class it extends MouseEvent {
|
|
1140
1179
|
constructor(i, e) {
|
|
1141
1180
|
super(e.type, e), this.line = i;
|
|
1142
1181
|
}
|
|
1143
1182
|
}
|
|
1144
|
-
class
|
|
1183
|
+
class st extends EventTarget {
|
|
1145
1184
|
// readonly lineWebAnimationTransforms = {
|
|
1146
1185
|
// posX: new WebAnimationSpring(this.element, "transform", (v) => `translateX(${v.toFixed(1)}px)`),
|
|
1147
1186
|
// posY: new WebAnimationSpring(this.element, "transform", (v) => `translateY(${v.toFixed(1)}px)`),
|
|
@@ -1173,7 +1212,7 @@ class $e extends EventTarget {
|
|
|
1173
1212
|
});
|
|
1174
1213
|
a(this, "listenersMap", /* @__PURE__ */ new Map());
|
|
1175
1214
|
a(this, "onMouseEvent", (e) => {
|
|
1176
|
-
const t = new
|
|
1215
|
+
const t = new it(this, e);
|
|
1177
1216
|
for (const s of this.listenersMap.get(e.type) ?? [])
|
|
1178
1217
|
s.call(this, t);
|
|
1179
1218
|
if (!this.dispatchEvent(t) || t.defaultPrevented)
|
|
@@ -1287,7 +1326,7 @@ class $e extends EventTarget {
|
|
|
1287
1326
|
e.innerText = this.lyricLine.words.map((r) => r.word).join(""), t.innerText = this.lyricLine.translatedLyric, s.innerText = this.lyricLine.romanLyric;
|
|
1288
1327
|
return;
|
|
1289
1328
|
}
|
|
1290
|
-
const l =
|
|
1329
|
+
const l = tt(this.lyricLine.words);
|
|
1291
1330
|
e.innerHTML = "", this.splittedWords = [];
|
|
1292
1331
|
for (const r of l)
|
|
1293
1332
|
if (Array.isArray(r)) {
|
|
@@ -1303,15 +1342,15 @@ class $e extends EventTarget {
|
|
|
1303
1342
|
const m = document.createElement("span");
|
|
1304
1343
|
if (h) {
|
|
1305
1344
|
m.classList.add("emphasize");
|
|
1306
|
-
const
|
|
1345
|
+
const f = [];
|
|
1307
1346
|
for (const y of d.word.trim().split("")) {
|
|
1308
|
-
const
|
|
1309
|
-
|
|
1347
|
+
const u = document.createElement("span");
|
|
1348
|
+
u.innerText = y, f.push(u), I.push(u), m.appendChild(u);
|
|
1310
1349
|
}
|
|
1311
1350
|
const p = {
|
|
1312
1351
|
...d,
|
|
1313
1352
|
mainElement: m,
|
|
1314
|
-
subElements:
|
|
1353
|
+
subElements: f,
|
|
1315
1354
|
elementAnimations: [this.initFloatAnimation(n, m)],
|
|
1316
1355
|
maskAnimations: [],
|
|
1317
1356
|
width: 0,
|
|
@@ -1359,8 +1398,8 @@ class $e extends EventTarget {
|
|
|
1359
1398
|
h.classList.add("emphasize");
|
|
1360
1399
|
const I = [];
|
|
1361
1400
|
for (const m of r.word.trim().split("")) {
|
|
1362
|
-
const
|
|
1363
|
-
|
|
1401
|
+
const f = document.createElement("span");
|
|
1402
|
+
f.innerText = m, I.push(f), h.appendChild(f);
|
|
1364
1403
|
}
|
|
1365
1404
|
c.subElements = I;
|
|
1366
1405
|
const d = Math.abs(c.endTime - c.startTime);
|
|
@@ -1412,19 +1451,19 @@ class $e extends EventTarget {
|
|
|
1412
1451
|
case "float-and-glow": {
|
|
1413
1452
|
let c = 0, I = 0;
|
|
1414
1453
|
r >= 1200 && r < 2e3 ? (c = 0.7, I = 0.5) : r >= 2e3 && r < 3e3 ? (c = 0.8, I = 0.6) : (r >= 3e3 && r < 4e3 || r >= 4e3) && (c = 1, I = 0.8);
|
|
1415
|
-
const d = Number.isFinite(r) ? Math.max(r * 1.2, 2e3) : 0, m =
|
|
1416
|
-
h = e.flatMap((
|
|
1417
|
-
const
|
|
1418
|
-
const b = (T + 1) /
|
|
1454
|
+
const d = Number.isFinite(r) ? Math.max(r * 1.2, 2e3) : 0, m = ce(C);
|
|
1455
|
+
h = e.flatMap((f, p, y) => {
|
|
1456
|
+
const u = l + r / 3 / y.length * p, g = [], E = new Array(H).fill(0).map((w, T) => {
|
|
1457
|
+
const b = (T + 1) / H, S = m(b), M = Math.sin(b * Math.PI * 2), x = Math.max(0, b < C ? S / 2 : S - 0.5) * I, P = _e(Oe(), 1 + S * 0.1 * c);
|
|
1419
1458
|
return {
|
|
1420
1459
|
offset: b,
|
|
1421
|
-
transform: `${
|
|
1460
|
+
transform: `${Ne(P, 4)} translate(${M * 5e-3 * c}em,${-S * 0.05}em)`,
|
|
1422
1461
|
textShadow: `rgba(255, 255, 255, ${x}) 0 0 10px`
|
|
1423
1462
|
};
|
|
1424
|
-
}), L =
|
|
1463
|
+
}), L = f.animate(E, {
|
|
1425
1464
|
duration: d,
|
|
1426
|
-
delay: Number.isFinite(
|
|
1427
|
-
id: `emphasize-word-float-and-glow-${
|
|
1465
|
+
delay: Number.isFinite(u) ? u : 0,
|
|
1466
|
+
id: `emphasize-word-float-and-glow-${f.innerText}-${p}`,
|
|
1428
1467
|
iterations: 1,
|
|
1429
1468
|
composite: "replace",
|
|
1430
1469
|
easing: "linear",
|
|
@@ -1438,8 +1477,8 @@ class $e extends EventTarget {
|
|
|
1438
1477
|
}
|
|
1439
1478
|
case "float-only": {
|
|
1440
1479
|
h = e.flatMap((c, I, d) => {
|
|
1441
|
-
const m = l + r / 1.5 / d.length * I,
|
|
1442
|
-
const E = (g + 1) /
|
|
1480
|
+
const m = l + r / 1.5 / d.length * I, f = [], p = new Array(H).fill(0).map((u, g) => {
|
|
1481
|
+
const E = (g + 1) / H, L = E < C ? et(E) : 1;
|
|
1443
1482
|
return {
|
|
1444
1483
|
offset: E,
|
|
1445
1484
|
transform: `translateY(${-L * 0.05}em)`
|
|
@@ -1455,7 +1494,7 @@ class $e extends EventTarget {
|
|
|
1455
1494
|
});
|
|
1456
1495
|
return y.onfinish = () => {
|
|
1457
1496
|
y.pause();
|
|
1458
|
-
}, y.pause(),
|
|
1497
|
+
}, y.pause(), f.push(y), f;
|
|
1459
1498
|
});
|
|
1460
1499
|
break;
|
|
1461
1500
|
}
|
|
@@ -1497,30 +1536,30 @@ class $e extends EventTarget {
|
|
|
1497
1536
|
), c = `${h * 100}% 100%`;
|
|
1498
1537
|
this.lyricPlayer.supportMaskImage ? (l.style.maskImage = n, l.style.maskRepeat = "no-repeat", l.style.maskOrigin = "left", l.style.maskSize = c) : (l.style.webkitMaskImage = n, l.style.webkitMaskRepeat = "no-repeat", l.style.webkitMaskOrigin = "left", l.style.webkitMaskSize = c);
|
|
1499
1538
|
const I = this.splittedWords.slice(0, s).reduce((w, T) => w + T.width, 0) + (this.splittedWords[0] ? r : 0), d = -(t.width + t.padding * 2 + r), m = (w) => Math.max(d, Math.min(0, w));
|
|
1500
|
-
let
|
|
1539
|
+
let f = -I - t.width - t.padding - r, p = 0;
|
|
1501
1540
|
const y = [];
|
|
1502
|
-
let
|
|
1541
|
+
let u = f, g = 0;
|
|
1503
1542
|
const E = () => {
|
|
1504
|
-
const w =
|
|
1505
|
-
if (
|
|
1506
|
-
const P = Math.abs(
|
|
1543
|
+
const w = f - u, T = Math.max(0, Math.min(1, p)), b = T - g, S = Math.abs(b / w);
|
|
1544
|
+
if (f > d && u < d) {
|
|
1545
|
+
const P = Math.abs(u - d) * S, A = `${m(u)}px 0`, v = {
|
|
1507
1546
|
offset: g + P,
|
|
1508
1547
|
maskPosition: A
|
|
1509
1548
|
};
|
|
1510
1549
|
y.push(v);
|
|
1511
1550
|
}
|
|
1512
|
-
if (
|
|
1513
|
-
const P = Math.abs(
|
|
1551
|
+
if (f > 0 && u < 0) {
|
|
1552
|
+
const P = Math.abs(u) * S, A = `${m(f)}px 0`, v = {
|
|
1514
1553
|
offset: g + P,
|
|
1515
1554
|
maskPosition: A
|
|
1516
1555
|
};
|
|
1517
1556
|
y.push(v);
|
|
1518
1557
|
}
|
|
1519
|
-
const M = `${m(
|
|
1558
|
+
const M = `${m(f)}px 0`, x = {
|
|
1520
1559
|
offset: T,
|
|
1521
1560
|
maskPosition: M
|
|
1522
1561
|
};
|
|
1523
|
-
y.push(x),
|
|
1562
|
+
y.push(x), u = f, g = T;
|
|
1524
1563
|
};
|
|
1525
1564
|
E();
|
|
1526
1565
|
let L = 0;
|
|
@@ -1531,7 +1570,7 @@ class $e extends EventTarget {
|
|
|
1531
1570
|
}
|
|
1532
1571
|
{
|
|
1533
1572
|
const b = w.endTime - w.startTime;
|
|
1534
|
-
p += b / e,
|
|
1573
|
+
p += b / e, f += w.width, T === 0 && (f += r * 1.5), T === this.splittedWords.length - 1 && (f += r * 0.5), b > 0 && E(), L += b;
|
|
1535
1574
|
}
|
|
1536
1575
|
});
|
|
1537
1576
|
for (const w of t.maskAnimations)
|
|
@@ -1556,8 +1595,8 @@ class $e extends EventTarget {
|
|
|
1556
1595
|
setTransform(e = this.left, t = this.top, s = this.scale, l = 1, r = 0, n = !1, h = 0) {
|
|
1557
1596
|
const c = Math.round(r), I = this.isInSight, d = this.lyricPlayer.getEnableSpring();
|
|
1558
1597
|
this.left = e, this.top = t, this.scale = s, this.delay = h * 1e3 | 0;
|
|
1559
|
-
const m = this.element.children[0],
|
|
1560
|
-
if (m.style.opacity = `${l}`,
|
|
1598
|
+
const m = this.element.children[0], f = this.element.children[1], p = this.element.children[2];
|
|
1599
|
+
if (m.style.opacity = `${l}`, f.style.opacity = `${l / 2}`, p.style.opacity = `${l / 2}`, n || !d) {
|
|
1561
1600
|
if (this.blur = Math.min(32, c), n && this.element.classList.add(
|
|
1562
1601
|
this.lyricPlayer.style.classes.tmpDisableTransition
|
|
1563
1602
|
), this.lineTransforms.posX.setPosition(e), this.lineTransforms.posY.setPosition(t), this.lineTransforms.scale.setPosition(s), d)
|
|
@@ -1588,13 +1627,13 @@ class $e extends EventTarget {
|
|
|
1588
1627
|
this.element.remove();
|
|
1589
1628
|
}
|
|
1590
1629
|
}
|
|
1591
|
-
const
|
|
1592
|
-
class
|
|
1630
|
+
const lt = pe(ge());
|
|
1631
|
+
class rt extends MouseEvent {
|
|
1593
1632
|
constructor(i, e, t) {
|
|
1594
1633
|
super(`line-${t.type}`, t), this.lineIndex = i, this.line = e;
|
|
1595
1634
|
}
|
|
1596
1635
|
}
|
|
1597
|
-
class
|
|
1636
|
+
class gt extends EventTarget {
|
|
1598
1637
|
constructor() {
|
|
1599
1638
|
super();
|
|
1600
1639
|
a(this, "element", document.createElement("div"));
|
|
@@ -1651,14 +1690,14 @@ class mt extends EventTarget {
|
|
|
1651
1690
|
a(this, "size", [0, 0]);
|
|
1652
1691
|
a(this, "innerSize", [0, 0]);
|
|
1653
1692
|
a(this, "onLineClickedHandler", (e) => {
|
|
1654
|
-
const t = new
|
|
1693
|
+
const t = new rt(
|
|
1655
1694
|
this.lyricLinesIndexes.get(e.line) ?? -1,
|
|
1656
1695
|
e.line,
|
|
1657
1696
|
e
|
|
1658
1697
|
);
|
|
1659
1698
|
this.dispatchEvent(t) || (e.preventDefault(), e.stopPropagation(), e.stopImmediatePropagation());
|
|
1660
1699
|
});
|
|
1661
|
-
a(this, "style",
|
|
1700
|
+
a(this, "style", lt.createStyleSheet({
|
|
1662
1701
|
lyricPlayer: {
|
|
1663
1702
|
userSelect: "none",
|
|
1664
1703
|
fontSize: "var(--amll-lyric-player-font-size,max(min(6vh, 8vw), 12px))",
|
|
@@ -1790,14 +1829,14 @@ class mt extends EventTarget {
|
|
|
1790
1829
|
a(this, "onPageHide", () => {
|
|
1791
1830
|
this.isPageVisible = !1;
|
|
1792
1831
|
});
|
|
1793
|
-
this.interludeDots = new
|
|
1832
|
+
this.interludeDots = new Ue(this), this.bottomLine = new Be(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.element.appendChild(this.bottomLine.getElement()), this.style.attach(), this.interludeDots.setTransform(0, 200), window.addEventListener("pageshow", this.onPageShow), window.addEventListener("pagehide", this.onPageHide);
|
|
1794
1833
|
let e = 0, t = "none", s = 0, l = 0, r = 0, n = Symbol("amll-scroll"), h = 0, c = 0;
|
|
1795
1834
|
this.element.addEventListener("touchstart", (I) => {
|
|
1796
1835
|
this.beginScrollHandler() && (I.preventDefault(), e = this.scrollOffset, s = I.touches[0].screenY, h = s, l = Date.now(), r = 0);
|
|
1797
1836
|
}), this.element.addEventListener("touchmove", (I) => {
|
|
1798
1837
|
if (this.beginScrollHandler()) {
|
|
1799
1838
|
I.preventDefault();
|
|
1800
|
-
const d = I.touches[0].screenY, m = d - s,
|
|
1839
|
+
const d = I.touches[0].screenY, m = d - s, f = d - h, p = f > 0 ? "down" : f < 0 ? "up" : "none";
|
|
1801
1840
|
t !== p ? (t = p, e = this.scrollOffset, s = d, l = Date.now()) : this.scrollOffset = e - m, h = d, c = Date.now(), this.limitScrollOffset(), this.calcLayout(!0);
|
|
1802
1841
|
}
|
|
1803
1842
|
}), this.element.addEventListener("touchend", (I) => {
|
|
@@ -1808,11 +1847,11 @@ class mt extends EventTarget {
|
|
|
1808
1847
|
return this.endScrollHandler();
|
|
1809
1848
|
const m = d - l;
|
|
1810
1849
|
r = (this.scrollOffset - e) / m * 1e3;
|
|
1811
|
-
let
|
|
1850
|
+
let f = 0;
|
|
1812
1851
|
const p = Symbol("amll-scroll");
|
|
1813
1852
|
n = p;
|
|
1814
|
-
const y = (
|
|
1815
|
-
|
|
1853
|
+
const y = (u) => {
|
|
1854
|
+
f || (f = u), n === p && this.beginScrollHandler() && (this.scrollOffset += r * (u - f) / 1e3, r *= 0.99, this.limitScrollOffset(), this.calcLayout(!0), Math.abs(r) > 1 && !this.scrollBoundary.includes(this.scrollOffset) && requestAnimationFrame(y), this.endScrollHandler(), f = u);
|
|
1816
1855
|
};
|
|
1817
1856
|
requestAnimationFrame(y), this.endScrollHandler();
|
|
1818
1857
|
}
|
|
@@ -1983,7 +2022,7 @@ class mt extends EventTarget {
|
|
|
1983
2022
|
}), this.lyricLinesEl.forEach((s) => {
|
|
1984
2023
|
s.removeMouseEventListener("click", this.onLineClickedHandler), s.removeMouseEventListener("contextmenu", this.onLineClickedHandler), s.dispose();
|
|
1985
2024
|
}), this.lyricLinesEl = this.processedLines.map((s) => {
|
|
1986
|
-
const l = new
|
|
2025
|
+
const l = new st(this, s);
|
|
1987
2026
|
return l.addMouseEventListener("click", this.onLineClickedHandler), l.addMouseEventListener("contextmenu", this.onLineClickedHandler), l;
|
|
1988
2027
|
}), this.lyricLinesEl.forEach((s, l) => {
|
|
1989
2028
|
this.element.appendChild(s.getElement()), this.lyricLinesIndexes.set(s, l), s.updateMaskImage();
|
|
@@ -2016,45 +2055,45 @@ class mt extends EventTarget {
|
|
|
2016
2055
|
*/
|
|
2017
2056
|
calcLayout(e = !1, t = !1) {
|
|
2018
2057
|
var y;
|
|
2019
|
-
t && (this.emUnit = parseFloat(getComputedStyle(this.element).fontSize), this.lyricLinesEl.forEach((
|
|
2020
|
-
const g =
|
|
2021
|
-
this.lyricLinesSize.set(
|
|
2058
|
+
t && (this.emUnit = parseFloat(getComputedStyle(this.element).fontSize), this.lyricLinesEl.forEach((u) => {
|
|
2059
|
+
const g = u.measureSize();
|
|
2060
|
+
this.lyricLinesSize.set(u, g), u.lineSize = g;
|
|
2022
2061
|
}), this.interludeDotsSize[0] = this.interludeDots.getElement().clientWidth, this.interludeDotsSize[1] = this.interludeDots.getElement().clientHeight, this.bottomLine.lineSize = this.bottomLine.measureSize());
|
|
2023
2062
|
const s = this.getCurrentInterlude();
|
|
2024
2063
|
let l = -this.scrollOffset, r = this.scrollToIndex, n = 0;
|
|
2025
2064
|
s ? (n = s[1] - s[0], n >= 5e3 && this.lyricLinesEl[s[2] + 1] && (r = s[2] + 1)) : this.interludeDots.setInterlude(void 0);
|
|
2026
2065
|
const h = this.enableScale ? 0.95 : 1, c = this.lyricLinesEl.slice(0, r).reduce(
|
|
2027
|
-
(
|
|
2066
|
+
(u, g) => {
|
|
2028
2067
|
var E;
|
|
2029
|
-
return
|
|
2068
|
+
return u + (g.getLine().isBG ? 0 : ((E = this.lyricLinesSize.get(g)) == null ? void 0 : E[1]) ?? 0);
|
|
2030
2069
|
},
|
|
2031
2070
|
0
|
|
2032
2071
|
);
|
|
2033
2072
|
this.scrollBoundary[0] = -c, l -= c, l += this.size[1] * this.alignPosition;
|
|
2034
2073
|
const I = this.lyricLinesEl[r];
|
|
2035
2074
|
if (I) {
|
|
2036
|
-
const
|
|
2075
|
+
const u = ((y = this.lyricLinesSize.get(I)) == null ? void 0 : y[1]) ?? 0;
|
|
2037
2076
|
switch (this.alignAnchor) {
|
|
2038
2077
|
case "bottom":
|
|
2039
|
-
l -=
|
|
2078
|
+
l -= u;
|
|
2040
2079
|
break;
|
|
2041
2080
|
case "center":
|
|
2042
|
-
l -=
|
|
2081
|
+
l -= u / 2;
|
|
2043
2082
|
break;
|
|
2044
2083
|
}
|
|
2045
2084
|
}
|
|
2046
2085
|
const d = Math.max(...this.bufferedLines);
|
|
2047
|
-
let m = 0,
|
|
2048
|
-
this.lyricLinesEl.forEach((
|
|
2086
|
+
let m = 0, f = 0.05, p = !1;
|
|
2087
|
+
this.lyricLinesEl.forEach((u, g) => {
|
|
2049
2088
|
var S, M, x;
|
|
2050
|
-
const E = this.bufferedLines.has(g), L = E || g >= this.scrollToIndex && g < d, w =
|
|
2051
|
-
w.isDuet && this.size[0] - (((S = this.lyricLinesSize.get(
|
|
2089
|
+
const E = this.bufferedLines.has(g), L = E || g >= this.scrollToIndex && g < d, w = u.getLine();
|
|
2090
|
+
w.isDuet && this.size[0] - (((S = this.lyricLinesSize.get(u)) == null ? void 0 : S[0]) ?? 0), !p && n >= 5e3 && (g === this.scrollToIndex && (s == null ? void 0 : s[2]) === -2 || g === this.scrollToIndex + 1) && (p = !0, this.interludeDots.setTransform(this.padding - 20, l + 10), s && this.interludeDots.setInterlude([s[0], s[1]]), l += this.interludeDotsSize[1] + 40);
|
|
2052
2091
|
let T = 1;
|
|
2053
2092
|
!L && g <= (s ? s[2] : this.scrollToIndex) ? this.hidePassedLines ? T = 0 : this.isNonDynamic ? T = 0.25 : T = 0.15 : E ? this.isNonDynamic ? T = 0.85 : T = 1 : this.isNonDynamic ? T = 0.25 : T = 0.5, this.invokedByScrollEvent && (this.isNonDynamic ? T = 0.85 : T = 1);
|
|
2054
2093
|
let b = 0;
|
|
2055
2094
|
this.enableBlur && (L ? b = 0 : (b = 1, g < this.scrollToIndex ? b += Math.abs(this.scrollToIndex - g) / 2 : b += Math.abs(
|
|
2056
2095
|
g - Math.max(this.scrollToIndex, d)
|
|
2057
|
-
))), this.invokedByScrollEvent && (b = 0),
|
|
2096
|
+
))), this.invokedByScrollEvent && (b = 0), u.setTransform(
|
|
2058
2097
|
this.padding,
|
|
2059
2098
|
l,
|
|
2060
2099
|
L ? 1 : h,
|
|
@@ -2062,7 +2101,7 @@ class mt extends EventTarget {
|
|
|
2062
2101
|
b * 1.5,
|
|
2063
2102
|
e,
|
|
2064
2103
|
m
|
|
2065
|
-
), w.isBG && L ? l += ((M = this.lyricLinesSize.get(
|
|
2104
|
+
), w.isBG && L ? l += ((M = this.lyricLinesSize.get(u)) == null ? void 0 : M[1]) ?? 0 : w.isBG || (l += ((x = this.lyricLinesSize.get(u)) == null ? void 0 : x[1]) ?? 0), l >= 0 && (m += f, f /= 1.2);
|
|
2066
2105
|
}), this.scrollBoundary[1] = l + this.scrollOffset - this.size[1] / 2, this.bottomLine.setTransform(this.padding, l, e, m);
|
|
2067
2106
|
}
|
|
2068
2107
|
/**
|
|
@@ -2155,7 +2194,7 @@ class mt extends EventTarget {
|
|
|
2155
2194
|
(n) => n.startTime >= e
|
|
2156
2195
|
), this.bufferedLines.clear(), this.hotLines.forEach((n) => this.bufferedLines.add(n)), this.calcLayout(!0)) : (l.size > 0 || r.size > 0) && (l.size === 0 && r.size > 0 ? (r.forEach((n) => {
|
|
2157
2196
|
this.bufferedLines.add(n), this.lyricLinesEl[n].enable(e);
|
|
2158
|
-
}), this.scrollToIndex = Math.min(...this.bufferedLines), this.calcLayout()) : r.size === 0 && l.size > 0 ?
|
|
2197
|
+
}), this.scrollToIndex = Math.min(...this.bufferedLines), this.calcLayout()) : r.size === 0 && l.size > 0 ? Fe(l, this.bufferedLines) && (this.bufferedLines.forEach((n) => {
|
|
2159
2198
|
this.hotLines.has(n) || (this.bufferedLines.delete(n), this.lyricLinesEl[n].disable(e));
|
|
2160
2199
|
}), this.calcLayout()) : (r.forEach((n) => {
|
|
2161
2200
|
this.bufferedLines.add(n), this.lyricLinesEl[n].enable(e);
|
|
@@ -2235,11 +2274,11 @@ class mt extends EventTarget {
|
|
|
2235
2274
|
}
|
|
2236
2275
|
}
|
|
2237
2276
|
export {
|
|
2238
|
-
|
|
2239
|
-
|
|
2277
|
+
ye as AbstractBaseRenderer,
|
|
2278
|
+
le as BackgroundRender,
|
|
2240
2279
|
te as BaseRenderer,
|
|
2241
2280
|
J as EplorRenderer,
|
|
2242
|
-
|
|
2243
|
-
|
|
2281
|
+
gt as LyricPlayer,
|
|
2282
|
+
pt as PixiRenderer
|
|
2244
2283
|
};
|
|
2245
2284
|
//# sourceMappingURL=amll-core.js.map
|