@applemusic-like-lyrics/core 0.0.8 → 0.0.11

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.
@@ -1 +1 @@
1
- {"version":3,"file":"amll-core.mjs","sources":["../src/lyric/ttml.ts","../src/bg-render/pixi-renderer.ts","../src/bg-render/index.ts","../src/utils/eq-set.ts","../src/lyric-player/interlude-dots.ts","../src/utils/spring.ts","../src/lyric-player/lyric-line.ts","../src/lyric-player/index.ts"],"sourcesContent":["import { LyricLine, LyricWord } from \"../interfaces\";\n\nconst timeRegexp =\n\t/^(((?<hour>[0-9]+):)?(?<min>[0-9]+):)?(?<sec>[0-9]+([\\.:]([0-9]+))?)/;\nfunction parseTimespan(timeSpan: string): number {\n\tconst matches = timeRegexp.exec(timeSpan);\n\tif (matches) {\n\t\tconst hour = Number(matches.groups?.hour || \"0\");\n\t\tconst min = Number(matches.groups?.min || \"0\");\n\t\tconst sec = Number(matches.groups?.sec.replace(/:/, \".\") || \"0\");\n\t\treturn Math.floor((hour * 3600 + min * 60 + sec) * 1000);\n\t} else {\n\t\tthrow new TypeError(\"时间戳字符串解析失败\");\n\t}\n}\n\nexport function parseTTML(ttmlText: string): LyricLine[] {\n\tconst domParser = new DOMParser();\n\tconst ttmlDoc: XMLDocument = domParser.parseFromString(\n\t\tttmlText,\n\t\t\"application/xml\",\n\t);\n\n\tlet mainAgentId = \"v1\";\n\n\tfor (const agent of ttmlDoc.querySelectorAll(\"ttm\\\\:agent\")) {\n\t\tif (agent.getAttribute(\"type\") === \"person\") {\n\t\t\tconst id = agent.getAttribute(\"xml:id\");\n\t\t\tif (id) {\n\t\t\t\tmainAgentId = id;\n\t\t\t}\n\t\t}\n\t}\n\n\tconst result: LyricLine[] = [];\n\n\tfor (const lineEl of ttmlDoc.querySelectorAll(\"body p[begin][end]\")) {\n\t\tconst line: LyricLine = {\n\t\t\twords: [],\n\t\t\tstartTime: parseTimespan(lineEl.getAttribute(\"begin\") ?? \"0:0\"),\n\t\t\tendTime: parseTimespan(lineEl.getAttribute(\"end\") ?? \"0:0\"),\n\t\t\ttranslatedLyric: \"\",\n\t\t\tromanLyric: \"\",\n\t\t\tisBG: false,\n\t\t\tisDuet: lineEl.getAttribute(\"ttm:agent\") !== mainAgentId,\n\t\t};\n\t\tlet curBGLine: LyricLine | null = null;\n\n\t\tfor (const wordNode of lineEl.childNodes) {\n\t\t\tif (wordNode.nodeType === Node.TEXT_NODE) {\n\t\t\t\tconst word = wordNode.textContent ?? \"\";\n\t\t\t\tif (/^(\\s+)$/.test(word)) {\n\t\t\t\t\tline.words.push({\n\t\t\t\t\t\tword: \" \",\n\t\t\t\t\t\tstartTime: 0,\n\t\t\t\t\t\tendTime: 0,\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tline.words.push({\n\t\t\t\t\t\tword: word,\n\t\t\t\t\t\tstartTime: 0,\n\t\t\t\t\t\tendTime: 0,\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t} else if (wordNode.nodeType === Node.ELEMENT_NODE) {\n\t\t\t\tconst wordEl = wordNode as Element;\n\t\t\t\tconst role = wordEl.getAttribute(\"ttm:role\");\n\n\t\t\t\tif (wordEl.nodeName === \"span\" && role) {\n\t\t\t\t\tif (role === \"x-bg\") {\n\t\t\t\t\t\tconst bgLine: LyricLine = {\n\t\t\t\t\t\t\twords: [],\n\t\t\t\t\t\t\tstartTime: line.startTime,\n\t\t\t\t\t\t\tendTime: line.endTime,\n\t\t\t\t\t\t\ttranslatedLyric: \"\",\n\t\t\t\t\t\t\tromanLyric: \"\",\n\t\t\t\t\t\t\tisBG: true,\n\t\t\t\t\t\t\tisDuet: line.isDuet,\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\tfor (const wordNode of wordEl.childNodes) {\n\t\t\t\t\t\t\tif (wordNode.nodeType === Node.TEXT_NODE) {\n\t\t\t\t\t\t\t\tconst word = wordNode.textContent ?? \"\";\n\t\t\t\t\t\t\t\tif (/^(\\s+)$/.test(word)) {\n\t\t\t\t\t\t\t\t\tbgLine.words.push({\n\t\t\t\t\t\t\t\t\t\tword: \" \",\n\t\t\t\t\t\t\t\t\t\tstartTime: 0,\n\t\t\t\t\t\t\t\t\t\tendTime: 0,\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tbgLine.words.push({\n\t\t\t\t\t\t\t\t\t\tword: word,\n\t\t\t\t\t\t\t\t\t\tstartTime: 0,\n\t\t\t\t\t\t\t\t\t\tendTime: 0,\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else if (wordNode.nodeType === Node.ELEMENT_NODE) {\n\t\t\t\t\t\t\t\tconst wordEl = wordNode as Element;\n\t\t\t\t\t\t\t\tconst role = wordEl.getAttribute(\"ttm:role\");\n\t\t\t\t\t\t\t\tif (wordEl.nodeName === \"span\" && role) {\n\t\t\t\t\t\t\t\t\tif (role === \"x-translation\") {\n\t\t\t\t\t\t\t\t\t\tbgLine.translatedLyric = wordEl.innerHTML.trim();\n\t\t\t\t\t\t\t\t\t} else if (role === \"x-roman\") {\n\t\t\t\t\t\t\t\t\t\tbgLine.romanLyric = wordEl.innerHTML.trim();\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} else if (\n\t\t\t\t\t\t\t\t\twordEl.hasAttribute(\"begin\") &&\n\t\t\t\t\t\t\t\t\twordEl.hasAttribute(\"end\")\n\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\tconst word = {\n\t\t\t\t\t\t\t\t\t\tword: wordNode.textContent,\n\t\t\t\t\t\t\t\t\t\tstartTime: parseTimespan(wordEl.getAttribute(\"begin\")!!),\n\t\t\t\t\t\t\t\t\t\tendTime: parseTimespan(wordEl.getAttribute(\"end\")!!),\n\t\t\t\t\t\t\t\t\t} as LyricWord;\n\t\t\t\t\t\t\t\t\tbgLine.words.push(word);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconst firstWord = bgLine.words[0];\n\t\t\t\t\t\tbgLine.startTime = firstWord.startTime;\n\t\t\t\t\t\tif (firstWord?.word.startsWith(\"(\")) {\n\t\t\t\t\t\t\tfirstWord.word = firstWord.word.substring(1);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconst lastWord = bgLine.words[bgLine.words.length - 1];\n\t\t\t\t\t\tbgLine.endTime = lastWord.endTime;\n\t\t\t\t\t\tif (lastWord?.word.endsWith(\")\")) {\n\t\t\t\t\t\t\tlastWord.word = lastWord.word.substring(\n\t\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\t\tlastWord.word.length - 1,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tcurBGLine = bgLine;\n\t\t\t\t\t} else if (role === \"x-translation\") {\n\t\t\t\t\t\tline.translatedLyric = wordEl.innerHTML;\n\t\t\t\t\t} else if (role === \"x-roman\") {\n\t\t\t\t\t\tline.romanLyric = wordEl.innerHTML;\n\t\t\t\t\t}\n\t\t\t\t} else if (wordEl.hasAttribute(\"begin\") && wordEl.hasAttribute(\"end\")) {\n\t\t\t\t\tconst word: LyricWord = {\n\t\t\t\t\t\tword: wordNode.textContent ?? \"\",\n\t\t\t\t\t\tstartTime: parseTimespan(wordEl.getAttribute(\"begin\")!!),\n\t\t\t\t\t\tendTime: parseTimespan(wordEl.getAttribute(\"end\")!!),\n\t\t\t\t\t};\n\t\t\t\t\tline.words.push(word);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tresult.push(line);\n\t\tif (curBGLine) {\n\t\t\t// line.startTime = Math.min(line.startTime, curBGLine.startTime);\n\t\t\t// line.endTime = Math.max(line.endTime, curBGLine.endTime);\n\t\t\t// curBGLine.startTime = line.startTime;\n\t\t\t// curBGLine.endTime = line.endTime;\n\t\t\tresult.push(curBGLine);\n\t\t}\n\t}\n\n\tconsole.log(result);\n\n\treturn result;\n}\n","import { Container } from \"@pixi/display\";\nimport { Application } from \"@pixi/app\";\nimport { BlurFilter } from \"@pixi/filter-blur\";\nimport { ColorMatrixFilter } from \"@pixi/filter-color-matrix\";\nimport { Texture } from \"@pixi/core\";\nimport { Sprite } from \"@pixi/sprite\";\nimport { Disposable } from \"../interfaces\";\n\nclass TimedContainer extends Container {\n\tpublic time = 0;\n}\n\nexport class PixiRenderer implements Disposable {\n\tprivate observer: ResizeObserver;\n\tprivate app: Application;\n\tprivate curContainer?: TimedContainer;\n\tprivate lastContainer: Set<TimedContainer> = new Set();\n\tprivate onTick = (delta: number): void => {\n\t\tfor (const lastContainer of this.lastContainer) {\n\t\t\tlastContainer.alpha = Math.max(0, lastContainer.alpha - delta / 60);\n\t\t\tif (lastContainer.alpha <= 0) {\n\t\t\t\tthis.app.stage.removeChild(lastContainer);\n\t\t\t\tthis.lastContainer.delete(lastContainer);\n\t\t\t}\n\t\t}\n\n\t\tif (this.curContainer) {\n\t\t\tthis.curContainer.alpha = Math.min(\n\t\t\t\t1,\n\t\t\t\tthis.curContainer.alpha + delta / 60,\n\t\t\t);\n\t\t\tconst [s1, s2, s3, s4] = this.curContainer.children as Sprite[];\n\t\t\tconst maxSize = Math.max(this.app.screen.width, this.app.screen.height);\n\t\t\ts1.position.set(this.app.screen.width / 2, this.app.screen.height / 2);\n\t\t\ts2.position.set(\n\t\t\t\tthis.app.screen.width / 2.5,\n\t\t\t\tthis.app.screen.height / 2.5,\n\t\t\t);\n\t\t\ts3.position.set(this.app.screen.width / 2, this.app.screen.height / 2);\n\t\t\ts4.position.set(this.app.screen.width / 2, this.app.screen.height / 2);\n\t\t\ts1.width = maxSize * Math.sqrt(2);\n\t\t\ts1.height = s1.width;\n\t\t\ts2.width = maxSize * 0.8;\n\t\t\ts2.height = s2.width;\n\t\t\ts3.width = maxSize * 0.5;\n\t\t\ts3.height = s3.width;\n\t\t\ts4.width = maxSize * 0.25;\n\t\t\ts4.height = s4.width;\n\n\t\t\tthis.curContainer.time += delta * this.flowSpeed;\n\n\t\t\ts1.rotation += (delta / 1000) * this.flowSpeed;\n\t\t\ts2.rotation -= (delta / 500) * this.flowSpeed;\n\t\t\ts3.rotation += (delta / 1000) * this.flowSpeed;\n\t\t\ts4.rotation -= (delta / 750) * this.flowSpeed;\n\n\t\t\ts3.x =\n\t\t\t\tthis.app.screen.width / 2 +\n\t\t\t\t(this.app.screen.width / 4) *\n\t\t\t\t\tMath.cos((this.curContainer.time / 1000) * 0.75);\n\t\t\ts3.y =\n\t\t\t\tthis.app.screen.height / 2 +\n\t\t\t\t(this.app.screen.width / 4) *\n\t\t\t\t\tMath.cos((this.curContainer.time / 1000) * 0.75);\n\n\t\t\ts4.x =\n\t\t\t\tthis.app.screen.width / 2 +\n\t\t\t\t(this.app.screen.width / 4) * 0.1 +\n\t\t\t\tMath.cos(this.curContainer.time * 0.006 * 0.75);\n\t\t\ts4.y =\n\t\t\t\tthis.app.screen.height / 2 +\n\t\t\t\t(this.app.screen.width / 4) * 0.1 +\n\t\t\t\tMath.cos(this.curContainer.time * 0.006 * 0.75);\n\t\t}\n\t};\n\tprivate flowSpeed = 2;\n\tprivate currerntRenderScale = 0.75;\n\tconstructor(private canvas: HTMLCanvasElement) {\n\t\tconst bounds = canvas.getBoundingClientRect();\n\t\tthis.canvas.width = bounds.width * this.currerntRenderScale;\n\t\tthis.canvas.height = bounds.height * this.currerntRenderScale;\n\t\tthis.observer = new ResizeObserver(() => {\n\t\t\tconst bounds = canvas.getBoundingClientRect();\n\t\t\tthis.canvas.width = Math.max(1, bounds.width);\n\t\t\tthis.canvas.height = Math.max(1, bounds.height);\n\t\t\tthis.app.renderer.resize(\n\t\t\t\tthis.canvas.width * this.currerntRenderScale,\n\t\t\t\tthis.canvas.height * this.currerntRenderScale,\n\t\t\t);\n\t\t\tthis.rebuildFilters();\n\t\t});\n\t\tthis.observer.observe(canvas);\n\t\tthis.app = new Application({\n\t\t\tview: canvas,\n\t\t\tresizeTo: this.canvas,\n\t\t\tpowerPreference: \"low-power\",\n\t\t\tbackgroundAlpha: 0,\n\t\t});\n\t\tthis.rebuildFilters();\n\t\tthis.app.ticker.add(this.onTick);\n\t\tthis.app.ticker.start();\n\t}\n\t/**\n\t * 修改背景的流动速度,数字越大越快,默认为 2\n\t * @param speed 背景的流动速度,默认为 2\n\t */\n\tsetFlowSpeed(speed: number) {\n\t\tthis.flowSpeed = speed;\n\t}\n\t/**\n\t * 修改背景的渲染比例,默认是 0.5\n\t *\n\t * 一般情况下这个程度既没有明显瑕疵也不会特别吃性能\n\t * @param scale 背景的渲染比例\n\t */\n\tsetRenderScale(scale: number) {\n\t\tthis.currerntRenderScale = scale;\n\t\tconst bounds = this.canvas.getBoundingClientRect();\n\t\tthis.canvas.width = Math.max(1, bounds.width);\n\t\tthis.canvas.height = Math.max(1, bounds.height);\n\t\tthis.app.renderer.resize(\n\t\t\tthis.canvas.width * this.currerntRenderScale,\n\t\t\tthis.canvas.height * this.currerntRenderScale,\n\t\t);\n\t\tthis.rebuildFilters();\n\t}\n\tprivate rebuildFilters() {\n\t\tconst minBorder = Math.min(this.canvas.width, this.canvas.height);\n\t\tconst c0 = new ColorMatrixFilter();\n\t\tc0.saturate(1.2, false);\n\t\tconst c1 = new ColorMatrixFilter();\n\t\tc1.brightness(0.6, false);\n\t\tconst c2 = new ColorMatrixFilter();\n\t\tc2.contrast(0.3, true);\n\t\tthis.app.stage.filters = [];\n\t\tthis.app.stage.filters.push(new BlurFilter(5, 1));\n\t\tthis.app.stage.filters.push(new BlurFilter(10, 1));\n\t\tthis.app.stage.filters.push(new BlurFilter(20, 2));\n\t\tthis.app.stage.filters.push(new BlurFilter(40, 2));\n\t\tif (minBorder > 512) this.app.stage.filters.push(new BlurFilter(80, 2));\n\t\tif (minBorder > 768) this.app.stage.filters.push(new BlurFilter(160, 4));\n\t\tif (minBorder > 768 * 2)\n\t\t\tthis.app.stage.filters.push(new BlurFilter(320, 4));\n\n\t\tthis.app.stage.filters.push(c0, c1, c2);\n\t\tthis.app.stage.filters.push(new BlurFilter(5, 1));\n\t}\n\t/**\n\t * 修改背景动画帧率,默认是 30 FPS\n\t *\n\t * 如果设置成 0 则会停止动画\n\t * @param fps 目标帧率,默认 30 FPS\n\t */\n\tsetFPS(fps: number) {\n\t\tthis.app.ticker.maxFPS = fps;\n\t}\n\t/**\n\t * 暂停背景动画,画面即便是更新了图片也不会发生变化\n\t */\n\tpause() {\n\t\tthis.app.ticker.stop();\n\t\tthis.app.render();\n\t}\n\t/**\n\t * 恢复播放背景动画\n\t */\n\tresume() {\n\t\tthis.app.ticker.start();\n\t}\n\t/**\n\t * 设置背景专辑图片,图片材质加载并设置完成后会返回\n\t * @param albumUrl 图片的目标链接\n\t */\n\tasync setAlbumImage(albumUrl: string) {\n\t\tconst tex = await Texture.fromURL(albumUrl);\n\t\tconst container = new TimedContainer();\n\t\tconst s1 = new Sprite(tex);\n\t\tconst s2 = new Sprite(tex);\n\t\tconst s3 = new Sprite(tex);\n\t\tconst s4 = new Sprite(tex);\n\t\ts1.anchor.set(0.5, 0.5);\n\t\ts2.anchor.set(0.5, 0.5);\n\t\ts3.anchor.set(0.5, 0.5);\n\t\ts4.anchor.set(0.5, 0.5);\n\t\ts1.rotation = Math.random() * Math.PI * 2;\n\t\ts2.rotation = Math.random() * Math.PI * 2;\n\t\ts3.rotation = Math.random() * Math.PI * 2;\n\t\ts4.rotation = Math.random() * Math.PI * 2;\n\t\tcontainer.addChild(s1, s2, s3, s4);\n\t\tif (this.curContainer) this.lastContainer.add(this.curContainer);\n\t\tthis.curContainer = container;\n\t\tthis.app.stage.addChild(this.curContainer);\n\t\tthis.curContainer.alpha = 0;\n\t}\n\n\tdispose() {\n\t\tthis.observer.disconnect();\n\t\tthis.app.ticker.remove(this.onTick);\n\t}\n}\n","/**\n * @fileoverview\n * 一个播放歌词的组件\n * @author SteveXMH\n */\n\nimport type { HasElement, Disposable } from \"../interfaces\";\nimport { PixiRenderer } from \"./pixi-renderer\";\n\nexport class BackgroundRender\n\textends PixiRenderer\n\timplements HasElement, Disposable\n{\n\tprivate element: HTMLCanvasElement;\n\tconstructor() {\n\t\tconst canvas = document.createElement(\"canvas\");\n\t\tsuper(canvas);\n\t\tthis.element = canvas;\n\t\tcanvas.style.pointerEvents = \"none\";\n\t\tcanvas.style.zIndex = \"-1\";\n\t}\n\tgetElement() {\n\t\treturn this.element;\n\t}\n\tdispose() {\n\t\tsuper.dispose();\n\t\tthis.element.remove();\n\t}\n}\n","export const eqSet: <T>(xs: Set<T>, ys: Set<T>) => boolean = (\n\txs,\n\tys,\n): boolean => xs.size === ys.size && [...xs].every((x) => ys.has(x));\n","import { LyricPlayer } from \".\";\nimport type { Disposable, HasElement } from \"../interfaces\";\n\nfunction easeInOutBack(x: number): number {\n\tconst c1 = 1.70158;\n\tconst c2 = c1 * 1.525;\n\n\treturn x < 0.5\n\t\t? (Math.pow(2 * x, 2) * ((c2 + 1) * 2 * x - c2)) / 2\n\t\t: (Math.pow(2 * x - 2, 2) * ((c2 + 1) * (x * 2 - 2) + c2) + 2) / 2;\n}\n\nconst clamp = (min: number, cur: number, max: number) =>\n\tMath.max(min, Math.min(cur, max));\n\nexport class InterludeDots implements HasElement, Disposable {\n\tprivate element: HTMLElement = document.createElement(\"div\");\n\tprivate dot0: HTMLElement = document.createElement(\"span\");\n\tprivate dot1: HTMLElement = document.createElement(\"span\");\n\tprivate dot2: HTMLElement = document.createElement(\"span\");\n\tprivate left = 0;\n\tprivate top = 0;\n\tprivate scale = 1;\n\tprivate lastStyle = \"\";\n\tprivate currentInterlude?: [number, number];\n\tprivate currentTime = 0;\n\tprivate targetBreatheDuration = 1500;\n\tconstructor(private readonly lyricPlayer: LyricPlayer) {\n\t\tthis.element.className = this.lyricPlayer.style.classes.interludeDots;\n\t\tthis.element.appendChild(this.dot0);\n\t\tthis.element.appendChild(this.dot1);\n\t\tthis.element.appendChild(this.dot2);\n\t}\n\tgetElement() {\n\t\treturn this.element;\n\t}\n\tsetTransform(left: number = this.left, top: number = this.top) {\n\t\tthis.left = left;\n\t\tthis.top = top;\n\t\tthis.update();\n\t}\n\tsetInterlude(interlude?: [number, number]) {\n\t\tthis.currentInterlude = interlude;\n\t\tthis.currentTime = interlude?.[0] ?? 0;\n\t}\n\tupdate(delta = 0) {\n\t\tthis.currentTime += delta;\n\t\tlet curStyle = \"\";\n\n\t\tcurStyle += `transform:translate(${this.left}px, ${this.top}px)`;\n\n\t\t// 计算缩放大小\n\n\t\tif (this.currentInterlude) {\n\t\t\tconst interludeDuration =\n\t\t\t\tthis.currentInterlude[1] - this.currentInterlude[0];\n\t\t\tconst currentDuration = this.currentTime - this.currentInterlude[0];\n\t\t\tif (currentDuration <= interludeDuration) {\n\t\t\t\tconst breatheDuration =\n\t\t\t\t\tinterludeDuration /\n\t\t\t\t\tMath.ceil(interludeDuration / this.targetBreatheDuration);\n\t\t\t\tlet scale = 1;\n\t\t\t\tlet globalOpacity = 1;\n\n\t\t\t\tscale *=\n\t\t\t\t\tMath.sin(1.5 * Math.PI - (currentDuration / breatheDuration) * 2) /\n\t\t\t\t\t\t10 +\n\t\t\t\t\t1;\n\n\t\t\t\tif (currentDuration < 1000) {\n\t\t\t\t\tscale *= 1 - Math.pow((1000 - currentDuration) / 1000, 2);\n\t\t\t\t}\n\n\t\t\t\tif (currentDuration < 500) {\n\t\t\t\t\tglobalOpacity = 0;\n\t\t\t\t} else if (currentDuration < 1000) {\n\t\t\t\t\tglobalOpacity *= (currentDuration - 500) / 500;\n\t\t\t\t}\n\n\t\t\t\tif (interludeDuration - currentDuration < 750) {\n\t\t\t\t\tscale *=\n\t\t\t\t\t\t1 -\n\t\t\t\t\t\teaseInOutBack(\n\t\t\t\t\t\t\t(750 - (interludeDuration - currentDuration)) / 750 / 2,\n\t\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tif (interludeDuration - currentDuration < 375) {\n\t\t\t\t\tglobalOpacity *= clamp(\n\t\t\t\t\t\t0,\n\t\t\t\t\t\t(interludeDuration - currentDuration) / 375,\n\t\t\t\t\t\t1,\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tscale = Math.max(0, scale);\n\n\t\t\t\tcurStyle += ` scale(${scale})`;\n\n\t\t\t\tconst dot0Opacity = clamp(\n\t\t\t\t\t0.25,\n\t\t\t\t\t((currentDuration * 3) / interludeDuration) * 0.75,\n\t\t\t\t\t1,\n\t\t\t\t);\n\t\t\t\tconst dot1Opacity = clamp(\n\t\t\t\t\t0.25,\n\t\t\t\t\t(((currentDuration - interludeDuration / 3) * 3) /\n\t\t\t\t\t\tinterludeDuration) *\n\t\t\t\t\t\t0.75,\n\t\t\t\t\t1,\n\t\t\t\t);\n\t\t\t\tconst dot2Opacity = clamp(\n\t\t\t\t\t0.25,\n\t\t\t\t\t(((currentDuration - (interludeDuration / 3) * 2) * 3) /\n\t\t\t\t\t\tinterludeDuration) *\n\t\t\t\t\t\t0.75,\n\t\t\t\t\t1,\n\t\t\t\t);\n\n\t\t\t\tthis.dot0.style.opacity = `${clamp(\n\t\t\t\t\t0,\n\t\t\t\t\tMath.max(0, globalOpacity * dot0Opacity),\n\t\t\t\t\t1,\n\t\t\t\t)}`;\n\t\t\t\tthis.dot1.style.opacity = `${clamp(\n\t\t\t\t\t0,\n\t\t\t\t\tMath.max(0, globalOpacity * dot1Opacity),\n\t\t\t\t\t1,\n\t\t\t\t)}`;\n\t\t\t\tthis.dot2.style.opacity = `${clamp(\n\t\t\t\t\t0,\n\t\t\t\t\tMath.max(0, globalOpacity * dot2Opacity),\n\t\t\t\t\t1,\n\t\t\t\t)}`;\n\t\t\t} else {\n\t\t\t\tcurStyle += \" scale(0)\";\n\t\t\t\tthis.dot0.style.opacity = \"0\";\n\t\t\t\tthis.dot1.style.opacity = \"0\";\n\t\t\t\tthis.dot2.style.opacity = \"0\";\n\t\t\t}\n\t\t} else {\n\t\t\tcurStyle += \" scale(0)\";\n\t\t\tthis.dot0.style.opacity = \"0\";\n\t\t\tthis.dot1.style.opacity = \"0\";\n\t\t\tthis.dot2.style.opacity = \"0\";\n\t\t}\n\n\t\tcurStyle += \";\";\n\n\t\tif (this.lastStyle !== curStyle) {\n\t\t\tthis.element.setAttribute(\"style\", curStyle);\n\t\t\tthis.lastStyle = curStyle;\n\t\t}\n\t}\n\tdispose() {\n\t\tthis.element.remove();\n\t}\n}\n","/** MIT License github.com/pushkine/ */\nexport interface SpringParams {\n\tmass: number; // = 1.0\n\tdamping: number; // = 10.0\n\tstiffness: number; // = 100.0\n\tsoft: boolean; // = false\n}\n\ntype seconds = number;\n\nexport class Spring {\n\tprivate currentPosition = 0;\n\tprivate targetPosition = 0;\n\tprivate currentTime = 0;\n\tprivate params: Partial<SpringParams> = {};\n\tprivate currentSolver: (t: seconds) => number;\n\tprivate getV: (t: seconds) => number;\n\tprivate queueParams:\n\t\t| (Partial<SpringParams> & {\n\t\t\t\ttime: number;\n\t\t })\n\t\t| undefined;\n\tprivate queuePosition:\n\t\t| {\n\t\t\t\ttime: number;\n\t\t\t\tposition: number;\n\t\t }\n\t\t| undefined;\n\tconstructor(currentPosition = 0) {\n\t\tthis.targetPosition = currentPosition;\n\t\tthis.currentPosition = this.targetPosition;\n\t\tthis.currentSolver = () => this.targetPosition;\n\t\tthis.getV = () => 0;\n\t}\n\tprivate resetSolver() {\n\t\tconst curV = this.getV(this.currentTime);\n\t\tthis.currentTime = 0;\n\t\tthis.currentSolver = solveSpring(\n\t\t\tthis.currentPosition,\n\t\t\tcurV,\n\t\t\tthis.targetPosition,\n\t\t\t0,\n\t\t\tthis.params,\n\t\t);\n\t\tthis.getV = getVelocity(this.currentSolver);\n\t}\n\tarrived() {\n\t\treturn (\n\t\t\tMath.abs(this.targetPosition - this.currentPosition) < 0.01 &&\n\t\t\tthis.getV(this.currentTime) < 0.01 &&\n\t\t\tthis.queueParams === undefined &&\n\t\t\tthis.queuePosition === undefined\n\t\t);\n\t}\n\tsetPosition(targetPosition: number) {\n\t\tthis.targetPosition = targetPosition;\n\t\tthis.currentPosition = targetPosition;\n\t\tthis.currentSolver = () => this.targetPosition;\n\t\tthis.getV = () => 0;\n\t}\n\tupdate(delta = 0) {\n\t\tthis.currentTime += delta;\n\t\tthis.currentPosition = this.currentSolver(this.currentTime);\n\t\tif (this.queueParams) {\n\t\t\tthis.queueParams.time -= delta;\n\t\t\tif (this.queueParams.time <= 0) {\n\t\t\t\tthis.updateParams({\n\t\t\t\t\t...this.queueParams,\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\tif (this.queuePosition) {\n\t\t\tthis.queuePosition.time -= delta;\n\t\t\tif (this.queuePosition.time <= 0) {\n\t\t\t\tthis.setTargetPosition(this.queuePosition.position);\n\t\t\t}\n\t\t}\n\t\tif (this.arrived()) {\n\t\t\tthis.setPosition(this.targetPosition);\n\t\t}\n\t}\n\tupdateParams(params: Partial<SpringParams>, delay = 0) {\n\t\tif (delay > 0) {\n\t\t\tthis.queueParams = {\n\t\t\t\t...params,\n\t\t\t\ttime: delay,\n\t\t\t};\n\t\t} else {\n\t\t\tthis.params = {\n\t\t\t\t...this.params,\n\t\t\t\t...params,\n\t\t\t};\n\t\t\tthis.resetSolver();\n\t\t}\n\t}\n\tsetTargetPosition(targetPosition: number, delay = 0) {\n\t\tif (delay > 0) {\n\t\t\tthis.queuePosition = {\n\t\t\t\tposition: targetPosition,\n\t\t\t\ttime: delay,\n\t\t\t};\n\t\t} else {\n\t\t\tthis.queuePosition = undefined;\n\t\t\tthis.targetPosition = targetPosition;\n\t\t\tthis.resetSolver();\n\t\t}\n\t}\n\tgetCurrentPosition() {\n\t\treturn this.currentPosition;\n\t}\n}\n\nfunction solveSpring(\n\tfrom: number,\n\tvelocity: number,\n\tto: number,\n\tdelay: seconds = 0,\n\tparams?: Partial<SpringParams>,\n): (t: seconds) => number {\n\tconst soft = params?.soft ?? false;\n\tconst stiffness = params?.stiffness ?? 100;\n\tconst damping = params?.damping ?? 10;\n\tconst mass = params?.mass ?? 1;\n\tconst delta = to - from;\n\tif (soft || 1.0 <= damping / (2.0 * Math.sqrt(stiffness * mass))) {\n\t\tconst angular_frequency = -Math.sqrt(stiffness / mass);\n\t\tconst leftover = -angular_frequency * delta - velocity;\n\t\treturn (t: seconds) => {\n\t\t\tt -= delay;\n\t\t\tif (t < 0) return from;\n\t\t\treturn to - (delta + t * leftover) * Math.E ** (t * angular_frequency);\n\t\t};\n\t} else {\n\t\tconst damping_frequency = Math.sqrt(\n\t\t\t4.0 * mass * stiffness - damping ** 2.0,\n\t\t);\n\t\tconst leftover =\n\t\t\t(damping * delta - 2.0 * mass * velocity) / damping_frequency;\n\t\tconst dfm = (0.5 * damping_frequency) / mass;\n\t\tconst dm = -(0.5 * damping) / mass;\n\t\treturn (t: seconds) => {\n\t\t\tt -= delay;\n\t\t\tif (t < 0) return from;\n\t\t\treturn (\n\t\t\t\tto -\n\t\t\t\t(Math.cos(t * dfm) * delta + Math.sin(t * dfm) * leftover) *\n\t\t\t\t\tMath.E ** (t * dm)\n\t\t\t);\n\t\t};\n\t}\n}\n\nfunction derivative(f: (x: number) => number) {\n\tconst h = 0.001;\n\treturn (x: number) => (f(x + h) - f(x - h)) / (2 * h);\n}\n\nfunction getVelocity(f: (t: seconds) => number): (t: seconds) => number {\n\treturn derivative(f);\n}\n","import { LyricPlayer } from \".\";\nimport { Disposable, HasElement, LyricLine, LyricWord } from \"../interfaces\";\nimport { Spring } from \"../utils/spring\";\n\nconst CJKEXP = /^[\\p{Unified_Ideograph}\\u0800-\\u9FFC]+$/u;\n\ninterface RealWord extends LyricWord {\n\telements: HTMLSpanElement[];\n\telementAnimations: Animation[];\n\twidth: number;\n\theight: number;\n\tshouldEmphasize: boolean;\n}\n\nfunction generateFadeGradient(\n\twidth: number,\n\tbright = \"rgba(0,0,0,1)\",\n\tdark = \"rgba(0,0,0,0.5)\",\n): [string, number, number] {\n\tconst totalAspect = 2 + width;\n\tconst widthInTotal = width / totalAspect;\n\tconst leftPos = (1 - widthInTotal) / 2;\n\treturn [\n\t\t`linear-gradient(to right,${bright} ${leftPos * 100}%,${dark} ${\n\t\t\t(leftPos + widthInTotal) * 100\n\t\t}%)`,\n\t\twidthInTotal,\n\t\ttotalAspect,\n\t];\n}\n\n// 果子在对辉光效果的解释是一种强调(emphasized)效果\n// 条件是一个单词时长大于等于 1s 且长度小于等于 7\nexport function shouldEmphasize(word: LyricWord): boolean {\n\treturn word.endTime - word.startTime >= 1000 && word.word.length <= 7;\n}\n\nexport class LyricLineEl implements HasElement, Disposable {\n\tprivate element: HTMLElement = document.createElement(\"div\");\n\tprivate left = 0;\n\tprivate top = 0;\n\tprivate scale = 1;\n\tprivate blur = 0;\n\tprivate delay = 0;\n\tprivate splittedWords: RealWord[] = [];\n\t// 由 LyricPlayer 来设置\n\tlineSize: number[] = [0, 0];\n\treadonly lineTransforms = {\n\t\tposX: new Spring(0),\n\t\tposY: new Spring(0),\n\t\tscale: new Spring(1),\n\t};\n\tconstructor(\n\t\tprivate lyricPlayer: LyricPlayer,\n\t\tprivate lyricLine: LyricLine = {\n\t\t\twords: [],\n\t\t\ttranslatedLyric: \"\",\n\t\t\tromanLyric: \"\",\n\t\t\tstartTime: 0,\n\t\t\tendTime: 0,\n\t\t\tisBG: false,\n\t\t\tisDuet: false,\n\t\t},\n\t) {\n\t\tthis.element.setAttribute(\n\t\t\t\"class\",\n\t\t\tthis.lyricPlayer.style.classes.lyricLine,\n\t\t);\n\t\tif (this.lyricLine.isBG) {\n\t\t\tthis.element.classList.add(this.lyricPlayer.style.classes.lyricBgLine);\n\t\t}\n\t\tif (this.lyricLine.isDuet) {\n\t\t\tthis.element.classList.add(this.lyricPlayer.style.classes.lyricDuetLine);\n\t\t}\n\t\tthis.element.appendChild(document.createElement(\"div\")); // 歌词行\n\t\tthis.element.appendChild(document.createElement(\"div\")); // 翻译行\n\t\tthis.element.appendChild(document.createElement(\"div\")); // 音译行\n\t\tconst main = this.element.children[0] as HTMLDivElement;\n\t\tconst trans = this.element.children[1] as HTMLDivElement;\n\t\tconst roman = this.element.children[2] as HTMLDivElement;\n\t\tmain.setAttribute(\"class\", this.lyricPlayer.style.classes.lyricMainLine);\n\t\ttrans.setAttribute(\"class\", this.lyricPlayer.style.classes.lyricSubLine);\n\t\troman.setAttribute(\"class\", this.lyricPlayer.style.classes.lyricSubLine);\n\t\tthis.rebuildElement();\n\t\tthis.rebuildStyle();\n\t}\n\tprivate isEnabled = false;\n\tenable() {\n\t\tthis.isEnabled = true;\n\t\tthis.element.classList.add(\"active\");\n\t\tconst main = this.element.children[0] as HTMLDivElement;\n\t\tthis.splittedWords.forEach((word) => {\n\t\t\tword.elementAnimations.forEach((a) => {\n\t\t\t\ta.currentTime = 0;\n\t\t\t\ta.playbackRate = 1;\n\t\t\t\ta.play();\n\t\t\t});\n\t\t});\n\t\tmain.classList.add(\"active\");\n\t}\n\tmeasureSize(): [number, number] {\n\t\tif (this._hide) {\n\t\t\tthis.element.style.display = \"\";\n\t\t\tthis.element.style.visibility = \"hidden\";\n\t\t}\n\t\tconst size: [number, number] = [\n\t\t\tthis.element.clientWidth,\n\t\t\tthis.element.clientHeight,\n\t\t];\n\t\tif (this._hide) {\n\t\t\tthis.element.style.display = \"none\";\n\t\t\tthis.element.style.visibility = \"\";\n\t\t}\n\t\treturn size;\n\t}\n\tdisable() {\n\t\tthis.isEnabled = false;\n\t\tthis.element.classList.remove(\"active\");\n\t\tconst main = this.element.children[0] as HTMLDivElement;\n\t\tthis.splittedWords.forEach((word) => {\n\t\t\tword.elementAnimations.forEach((a) => {\n\t\t\t\tif (a.id === \"float-word\") {\n\t\t\t\t\ta.playbackRate = -1;\n\t\t\t\t\ta.play();\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t\tmain.classList.remove(\"active\");\n\t}\n\tsetLine(line: LyricLine) {\n\t\tthis.lyricLine = line;\n\t\tif (this.lyricLine.isBG) {\n\t\t\tthis.element.classList.add(this.lyricPlayer.style.classes.lyricBgLine);\n\t\t} else {\n\t\t\tthis.element.classList.remove(this.lyricPlayer.style.classes.lyricBgLine);\n\t\t}\n\t\tif (this.lyricLine.isDuet) {\n\t\t\tthis.element.classList.add(this.lyricPlayer.style.classes.lyricDuetLine);\n\t\t} else {\n\t\t\tthis.element.classList.remove(\n\t\t\t\tthis.lyricPlayer.style.classes.lyricDuetLine,\n\t\t\t);\n\t\t}\n\t\tthis.rebuildElement();\n\t\tthis.rebuildStyle();\n\t}\n\tgetLine() {\n\t\treturn this.lyricLine;\n\t}\n\tprivate _hide = true;\n\tprivate lastStyle = \"\";\n\tshow() {\n\t\tthis._hide = false;\n\t\tthis.rebuildStyle();\n\t}\n\thide() {\n\t\tthis._hide = true;\n\t\tthis.rebuildStyle();\n\t}\n\trebuildStyle() {\n\t\tif (this._hide) {\n\t\t\tif (this.lastStyle !== \"display:none;transform:translate(0,-10000px);\") {\n\t\t\t\tthis.lastStyle = \"display:none;transform:translate(0,-10000px);\";\n\t\t\t\tthis.element.setAttribute(\n\t\t\t\t\t\"style\",\n\t\t\t\t\t\"display:none;transform:translate(0,-10000px);\",\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tlet style = `transform:translate(${this.lineTransforms.posX.getCurrentPosition()}px,${this.lineTransforms.posY.getCurrentPosition()}px) scale(${this.lineTransforms.scale.getCurrentPosition()});`;\n\t\tif (!this.lyricPlayer.getEnableSpring() && this.isInSight) {\n\t\t\tstyle += `transition-delay:${this.delay}ms;`;\n\t\t}\n\t\tstyle += `filter:blur(${Math.min(32, this.blur)}px);`;\n\t\tif (style !== this.lastStyle) {\n\t\t\tthis.lastStyle = style;\n\t\t\tthis.element.setAttribute(\"style\", style);\n\t\t}\n\t}\n\trebuildElement() {\n\t\tconst main = this.element.children[0] as HTMLDivElement;\n\t\tconst trans = this.element.children[1] as HTMLDivElement;\n\t\tconst roman = this.element.children[2] as HTMLDivElement;\n\t\tthis.splittedWords = [];\n\t\tthis.lyricLine.words.forEach((word) => {\n\t\t\tconst splited = word.word.split(/\\s+/);\n\t\t\tconst trimmedLength = splited.reduce((pv, cv) => pv + cv.length, 0);\n\t\t\tlet pos = 0;\n\t\t\tsplited.forEach((sub, i) => {\n\t\t\t\tif (i > 0) {\n\t\t\t\t\tthis.splittedWords.push({\n\t\t\t\t\t\tword: \" \",\n\t\t\t\t\t\tstartTime: 0,\n\t\t\t\t\t\tendTime: 0,\n\t\t\t\t\t\twidth: 0,\n\t\t\t\t\t\theight: 0,\n\t\t\t\t\t\telements: [],\n\t\t\t\t\t\telementAnimations: [],\n\t\t\t\t\t\tshouldEmphasize: false,\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tthis.splittedWords.push({\n\t\t\t\t\tword: sub,\n\t\t\t\t\tstartTime:\n\t\t\t\t\t\tword.startTime +\n\t\t\t\t\t\t((word.endTime - word.startTime) / trimmedLength) * pos,\n\t\t\t\t\tendTime:\n\t\t\t\t\t\tword.startTime +\n\t\t\t\t\t\t((word.endTime - word.startTime) / trimmedLength) *\n\t\t\t\t\t\t\t(pos + sub.length),\n\t\t\t\t\twidth: 0,\n\t\t\t\t\theight: 0,\n\t\t\t\t\telements: [],\n\t\t\t\t\telementAnimations: [],\n\t\t\t\t\tshouldEmphasize: shouldEmphasize(word),\n\t\t\t\t});\n\t\t\t\tpos += sub.length;\n\t\t\t});\n\t\t});\n\t\t// 回收元素以复用\n\t\tconst reusableElements: HTMLElement[] = [];\n\t\tconst reusableTextNodes: Text[] = [];\n\t\tfunction collectNodes(curNode: Node) {\n\t\t\twhile (curNode.firstChild) {\n\t\t\t\tif (curNode.firstChild.nodeType === Node.ELEMENT_NODE)\n\t\t\t\t\treusableElements.push(main.firstChild as HTMLElement);\n\t\t\t\telse if (curNode.firstChild.nodeType === Node.TEXT_NODE)\n\t\t\t\t\treusableTextNodes.push(main.firstChild as Text);\n\t\t\t\tcurNode.removeChild(curNode.firstChild);\n\t\t\t\tcollectNodes(curNode.firstChild);\n\t\t\t}\n\t\t}\n\t\tcollectNodes(main);\n\t\tlet lastWordEl: HTMLSpanElement | null = null;\n\t\tthis.splittedWords.forEach((word) => {\n\t\t\tif (word.word.trim().length > 0) {\n\t\t\t\tif (word.shouldEmphasize) {\n\t\t\t\t\tconst wordEl =\n\t\t\t\t\t\treusableElements.pop() ?? document.createElement(\"span\");\n\t\t\t\t\twordEl.className = \"emphasize\";\n\t\t\t\t\tword.elements = [wordEl];\n\t\t\t\t\tfor (const c of word.word) {\n\t\t\t\t\t\tconst charEl =\n\t\t\t\t\t\t\treusableElements.pop() ?? document.createElement(\"span\");\n\t\t\t\t\t\tcharEl.className = \"\";\n\t\t\t\t\t\tcharEl.innerText = c;\n\t\t\t\t\t\twordEl.appendChild(charEl);\n\t\t\t\t\t\tword.elements.push(charEl);\n\t\t\t\t\t}\n\t\t\t\t\tword.elementAnimations = this.initEmphasizeAnimation(word);\n\t\t\t\t\tconsole.log(word.word, CJKEXP.test(word.word));\n\t\t\t\t\tif (lastWordEl && !CJKEXP.test(word.word)) {\n\t\t\t\t\t\tif (lastWordEl.childElementCount > 0) {\n\t\t\t\t\t\t\tlastWordEl.appendChild(wordEl);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tconst wholeWordEl =\n\t\t\t\t\t\t\t\treusableElements.pop() ?? document.createElement(\"span\");\n\t\t\t\t\t\t\twholeWordEl.className = \"\";\n\t\t\t\t\t\t\tlastWordEl.remove();\n\t\t\t\t\t\t\twholeWordEl.appendChild(lastWordEl);\n\t\t\t\t\t\t\twholeWordEl.appendChild(wordEl);\n\t\t\t\t\t\t\tmain.appendChild(wholeWordEl);\n\t\t\t\t\t\t\tlastWordEl = wholeWordEl;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tlastWordEl = CJKEXP.test(word.word) ? null : wordEl;\n\t\t\t\t\t\tmain.appendChild(wordEl);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tconst wordEl =\n\t\t\t\t\t\treusableElements.pop() ?? document.createElement(\"span\");\n\t\t\t\t\twordEl.className = \"\";\n\t\t\t\t\twordEl.innerText = word.word;\n\t\t\t\t\tword.elements = [wordEl];\n\t\t\t\t\tword.elementAnimations.push(this.initFloatAnimation(word, wordEl));\n\t\t\t\t\tif (lastWordEl) {\n\t\t\t\t\t\tif (lastWordEl.childElementCount > 0) {\n\t\t\t\t\t\t\tlastWordEl.appendChild(wordEl);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tconst wholeWordEl =\n\t\t\t\t\t\t\t\treusableElements.pop() ?? document.createElement(\"span\");\n\t\t\t\t\t\t\twholeWordEl.className = \"\";\n\t\t\t\t\t\t\tlastWordEl.remove();\n\t\t\t\t\t\t\twholeWordEl.appendChild(lastWordEl);\n\t\t\t\t\t\t\twholeWordEl.appendChild(wordEl);\n\t\t\t\t\t\t\tmain.appendChild(wholeWordEl);\n\t\t\t\t\t\t\tlastWordEl = wholeWordEl;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tlastWordEl = wordEl;\n\t\t\t\t\t\tmain.appendChild(wordEl);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (word.word.length > 0) {\n\t\t\t\tconst wordEl = reusableTextNodes.pop() ?? document.createTextNode(\" \");\n\t\t\t\tmain.appendChild(wordEl);\n\t\t\t\tlastWordEl = null;\n\t\t\t} else {\n\t\t\t\tlastWordEl = null;\n\t\t\t}\n\t\t});\n\t\ttrans.innerText = this.lyricLine.translatedLyric;\n\t\troman.innerText = this.lyricLine.romanLyric;\n\t}\n\tprivate initFloatAnimation(word: LyricWord, wordEl: HTMLSpanElement) {\n\t\tconst delay = word.startTime - this.lyricLine.startTime;\n\t\tconst duration = Math.max(1000, word.endTime - word.startTime);\n\t\tconst a = wordEl.animate(\n\t\t\t[\n\t\t\t\t{\n\t\t\t\t\ttransform: \"translateY(0px)\",\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\ttransform: \"translateY(-3%)\",\n\t\t\t\t},\n\t\t\t],\n\t\t\t{\n\t\t\t\tduration: isFinite(duration) ? duration : 0,\n\t\t\t\tdelay: isFinite(delay) ? delay : 0,\n\t\t\t\tid: \"float-word\",\n\t\t\t\tcomposite: \"add\",\n\t\t\t\tfill: \"both\",\n\t\t\t},\n\t\t);\n\t\ta.pause();\n\t\treturn a;\n\t}\n\tprivate initEmphasizeAnimation(word: RealWord): Animation[] {\n\t\tconst delay = word.startTime - this.lyricLine.startTime;\n\t\tconst duration = word.endTime - word.startTime;\n\t\treturn word.elements.map((el, i, arr) => {\n\t\t\tif (i === 0) {\n\t\t\t\treturn this.initFloatAnimation(word, el);\n\t\t\t} else {\n\t\t\t\tconst a = el.animate(\n\t\t\t\t\t[\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\toffset: 0,\n\t\t\t\t\t\t\ttransform: \"translate3d(0, 0px, 0px)\",\n\t\t\t\t\t\t\tfilter: \"drop-shadow(0 0 0 var(--amll-lyric-line-color))\",\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\toffset: 0.5,\n\t\t\t\t\t\t\ttransform: \"translate3d(0, -2%, 20px)\",\n\t\t\t\t\t\t\tfilter: \"drop-shadow(0 0 0.2rem var(--amll-lyric-line-color))\",\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\toffset: 1,\n\t\t\t\t\t\t\ttransform: \"translate3d(0, 0px, 0)\",\n\t\t\t\t\t\t\tfilter: \"drop-shadow(0 0 0 var(--amll-lyric-line-color))\",\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t\t{\n\t\t\t\t\t\tduration: Math.max(1000, word.endTime - word.startTime),\n\t\t\t\t\t\tdelay: delay + (duration / (arr.length - 1)) * (i - 1),\n\t\t\t\t\t\tid: \"glow-word\",\n\t\t\t\t\t\titerations: 1,\n\t\t\t\t\t\tcomposite: \"replace\",\n\t\t\t\t\t\tfill: \"both\",\n\t\t\t\t\t},\n\t\t\t\t);\n\t\t\t\ta.pause();\n\t\t\t\treturn a;\n\t\t\t}\n\t\t});\n\t}\n\tupdateMaskImage() {\n\t\tif (this._hide) {\n\t\t\tthis.element.style.display = \"\";\n\t\t\tthis.element.style.visibility = \"hidden\";\n\t\t}\n\t\tthis.splittedWords.forEach((word) => {\n\t\t\tconst wordEl = word.elements[0];\n\t\t\tif (wordEl) {\n\t\t\t\tword.width = wordEl.clientWidth;\n\t\t\t\tword.height = wordEl.clientHeight;\n\t\t\t\tconst [maskImage, _widthInTotal, totalAspect] = generateFadeGradient(\n\t\t\t\t\t16 / word.width,\n\t\t\t\t\t\"rgba(0,0,0,0.75)\",\n\t\t\t\t\t\"rgba(0,0,0,0.25)\",\n\t\t\t\t);\n\t\t\t\tconst totalAspectStr = `${totalAspect * 100}% 100%`;\n\t\t\t\tif (this.lyricPlayer.supportMaskImage) {\n\t\t\t\t\twordEl.style.maskImage = maskImage;\n\t\t\t\t\twordEl.style.maskOrigin = \"left\";\n\t\t\t\t\twordEl.style.maskSize = totalAspectStr;\n\t\t\t\t} else {\n\t\t\t\t\twordEl.style.webkitMaskImage = maskImage;\n\t\t\t\t\twordEl.style.webkitMaskOrigin = \"left\";\n\t\t\t\t\twordEl.style.webkitMaskSize = totalAspectStr;\n\t\t\t\t}\n\t\t\t\tconst w = word.width + 16;\n\t\t\t\tconst maskPos = `clamp(${-w}px,calc(${-w}px + (var(--amll-player-time) - ${\n\t\t\t\t\tword.startTime\n\t\t\t\t})*${\n\t\t\t\t\tw / Math.abs(word.endTime - word.startTime)\n\t\t\t\t}px),0px) 0px, left top`;\n\t\t\t\t// const maskPos = `clamp(0px,${w}px,${w}px) 0px, left top`;\n\t\t\t\twordEl.style.maskPosition = maskPos;\n\t\t\t\twordEl.style.webkitMaskPosition = maskPos;\n\t\t\t}\n\t\t});\n\t\tif (this._hide) {\n\t\t\tthis.element.style.display = \"none\";\n\t\t\tthis.element.style.visibility = \"\";\n\t\t}\n\t}\n\tgetElement() {\n\t\treturn this.element;\n\t}\n\tsetTransform(\n\t\tleft: number = this.left,\n\t\ttop: number = this.top,\n\t\tscale: number = this.scale,\n\t\topacity = 1,\n\t\tblur = 0,\n\t\tforce = false,\n\t\tdelay = 0,\n\t) {\n\t\tthis.left = left;\n\t\tthis.top = top;\n\t\tthis.scale = scale;\n\t\tthis.delay = (delay * 1000) | 0;\n\t\tconst main = this.element.children[0] as HTMLDivElement;\n\t\tmain.style.opacity = `${opacity}`;\n\t\tif (force || !this.lyricPlayer.getEnableSpring()) {\n\t\t\tthis.blur = Math.min(32, blur);\n\t\t\tif (force)\n\t\t\t\tthis.element.classList.add(\n\t\t\t\t\tthis.lyricPlayer.style.classes.tmpDisableTransition,\n\t\t\t\t);\n\t\t\tthis.lineTransforms.posX.setPosition(left);\n\t\t\tthis.lineTransforms.posY.setPosition(top);\n\t\t\tthis.lineTransforms.scale.setPosition(scale);\n\t\t\tif (!this.lyricPlayer.getEnableSpring()) this.show();\n\t\t\telse this.rebuildStyle();\n\t\t\tif (force)\n\t\t\t\trequestAnimationFrame(() => {\n\t\t\t\t\tthis.element.classList.remove(\n\t\t\t\t\t\tthis.lyricPlayer.style.classes.tmpDisableTransition,\n\t\t\t\t\t);\n\t\t\t\t});\n\t\t} else {\n\t\t\tthis.lineTransforms.posX.setTargetPosition(left, delay);\n\t\t\tthis.lineTransforms.posY.setTargetPosition(top, delay);\n\t\t\tthis.lineTransforms.scale.setTargetPosition(scale);\n\t\t\tif (this.blur !== Math.min(32, blur)) {\n\t\t\t\tthis.blur = Math.min(32, blur);\n\t\t\t\tthis.element.style.filter = `blur(${Math.min(32, blur)}px)`;\n\t\t\t}\n\t\t}\n\t}\n\tupdate(delta = 0) {\n\t\tif (!this.lyricPlayer.getEnableSpring()) return;\n\t\tthis.lineTransforms.posX.update(delta);\n\t\tthis.lineTransforms.posY.update(delta);\n\t\tthis.lineTransforms.scale.update(delta);\n\t\tif (this.isInSight) {\n\t\t\tthis.show();\n\t\t} else {\n\t\t\tthis.hide();\n\t\t}\n\t}\n\tget isInSight() {\n\t\tconst l = this.lineTransforms.posX.getCurrentPosition();\n\t\tconst t = this.lineTransforms.posY.getCurrentPosition();\n\t\tconst r = l + this.lineSize[0];\n\t\tconst b = t + this.lineSize[1];\n\t\tconst pl = this.lyricPlayer.pos[0];\n\t\tconst pt = this.lyricPlayer.pos[1];\n\t\tconst pr = this.lyricPlayer.pos[0] + this.lyricPlayer.size[0];\n\t\tconst pb = this.lyricPlayer.pos[1] + this.lyricPlayer.size[1];\n\t\treturn !(l > pr || t > pb || r < pl || b < pt);\n\t}\n\tdispose(): void {\n\t\tthis.element.remove();\n\t}\n}\n","/**\n * @fileoverview\n * 一个播放歌词的组件\n * @author SteveXMH\n */\n\nimport type { Disposable, HasElement, LyricLine } from \"../interfaces\";\nimport { eqSet } from \"../utils/eq-set\";\nimport { SpringParams } from \"../utils/spring\";\nimport { InterludeDots } from \"./interlude-dots\";\nimport { LyricLineEl, shouldEmphasize } from \"./lyric-line\";\nimport { create } from \"jss\";\nimport preset from \"jss-preset-default\";\n\nconst jss = create(preset());\n\n/**\n * 歌词播放组件,本框架的核心组件\n *\n * 尽可能贴切 Apple Music for iPad 的歌词效果设计,且做了力所能及的优化措施\n */\nexport class LyricPlayer extends EventTarget implements HasElement, Disposable {\n\tprivate element: HTMLElement = document.createElement(\"div\");\n\tprivate currentTime = 0;\n\tprivate lyricLines: LyricLine[] = [];\n\tprivate processedLines: LyricLine[] = [];\n\tprivate lyricLinesEl: LyricLineEl[] = [];\n\tprivate lyricLinesSize: Map<LyricLineEl, [number, number]> = new Map();\n\tprivate hotLines: Set<number> = new Set();\n\tprivate bufferedLines: Set<number> = new Set();\n\tprivate scrollToIndex = 0;\n\tprivate resizeObserver: ResizeObserver = new ResizeObserver((e) => {\n\t\tconst rect = e[0].contentRect;\n\t\tthis.size[0] = rect.width;\n\t\tthis.size[1] = rect.height;\n\t\tthis.pos[0] = rect.left;\n\t\tthis.pos[1] = rect.top;\n\t\tthis.rebuildStyle();\n\t\tthis.calcLayout(true);\n\t\tthis.lyricLinesEl.forEach((el) => el.updateMaskImage());\n\t});\n\tprivate posXSpringParams: Partial<SpringParams> = {\n\t\tmass: 1,\n\t\tdamping: 10,\n\t\tstiffness: 100,\n\t};\n\tprivate posYSpringParams: Partial<SpringParams> = {\n\t\tmass: 1,\n\t\tdamping: 15,\n\t\tstiffness: 100,\n\t};\n\tprivate scaleSpringParams: Partial<SpringParams> = {\n\t\tmass: 1,\n\t\tdamping: 20,\n\t\tstiffness: 100,\n\t};\n\tprivate enableBlur = true;\n\tprivate interludeDots: InterludeDots;\n\tprivate interludeDotsSize: [number, number] = [0, 0];\n\treadonly supportPlusLighter = CSS.supports(\"mix-blend-mode\", \"plus-lighter\");\n\treadonly supportMaskImage = CSS.supports(\"mask-image\", \"none\");\n\tprivate disableSpring = false;\n\tprivate alignAnchor: \"top\" | \"bottom\" | number = 0.5;\n\treadonly size: [number, number] = [0, 0];\n\treadonly pos: [number, number] = [0, 0];\n\t/**\n\t * 设置是否使用物理弹簧算法实现歌词动画效果,默认启用\n\t *\n\t * 如果启用,则会通过弹簧算法实时处理歌词位置,但是需要性能足够强劲的电脑方可流畅运行\n\t *\n\t * 如果不启用,则会回退到基于 `transition` 的过渡效果,对低性能的机器比较友好,但是效果会比较单一\n\t */\n\tsetEnableSpring(enable = true) {\n\t\tthis.disableSpring = !enable;\n\t\tif (enable) {\n\t\t\tthis.element.classList.remove(this.style.classes.disableSpring);\n\t\t} else {\n\t\t\tthis.element.classList.add(this.style.classes.disableSpring);\n\t\t}\n\t\tthis.calcLayout(true);\n\t}\n\t/**\n\t * 获取当前是否启用了物理弹簧\n\t * @returns 是否启用物理弹簧\n\t */\n\tgetEnableSpring() {\n\t\treturn !this.disableSpring;\n\t}\n\tpublic readonly style = jss.createStyleSheet({\n\t\tlyricPlayer: {\n\t\t\tuserSelect: \"none\",\n\t\t\tpadding: \"1rem\",\n\t\t\tboxSizing: \"border-box\",\n\t\t\tfontSize: \"max(5vh, 12px)\",\n\t\t\tfontWeight: \"bold\",\n\t\t\twidth: \"100%\",\n\t\t\theight: \"100%\",\n\t\t\toverflow: \"hidden\",\n\t\t\tmaxWidth: \"100%\",\n\t\t\tmaxHeight: \"100%\",\n\t\t\tzIndex: 1,\n\t\t\tcolor: \"var(--amll-lyric-line-color)\",\n\t\t\tmixBlendMode: \"plus-lighter\",\n\t\t\tcontain: \"strict\",\n\t\t},\n\t\tlyricLine: {\n\t\t\tposition: \"absolute\",\n\t\t\ttransformOrigin: \"left\",\n\t\t\tmaxWidth: \"65%\",\n\t\t\tpadding: \"max(2vh, 1rem) 1rem\",\n\t\t\tcontain: \"content\",\n\t\t\ttransition: \"filter 0.25s\",\n\t\t\tmargin: \"max(2vh, 1rem) -1rem\",\n\t\t},\n\t\t\"@media (max-width: 1024px)\": {\n\t\t\tlyricLine: {\n\t\t\t\tmaxWidth: \"75%\",\n\t\t\t\tpadding: \"max(1vh, 1rem) 1rem\",\n\t\t\t\tmargin: \"0 -1rem\",\n\t\t\t},\n\t\t},\n\t\tlyricDuetLine: {\n\t\t\ttextAlign: \"right\",\n\t\t\ttransformOrigin: \"right\",\n\t\t},\n\t\tlyricBgLine: {\n\t\t\topacity: 0,\n\t\t\tfontSize: \"max(50%, 10px)\",\n\t\t\ttransition: \"opacity 0.25s\",\n\t\t\t\"&.active\": {\n\t\t\t\ttransition: \"opacity 0.25s 0.25s\",\n\t\t\t\topacity: 1,\n\t\t\t},\n\t\t},\n\t\tlyricMainLine: {\n\t\t\ttransition: \"opacity 0.3s 0.25s\",\n\t\t\tmargin: \"-1rem\",\n\t\t\tpadding: \"1rem\",\n\t\t\t\"& span\": {\n\t\t\t\tdisplay: \"inline-block\",\n\t\t\t\tmargin: \"-1rem\",\n\t\t\t\tpadding: \"1rem\",\n\t\t\t},\n\t\t\t\"& > span\": {\n\t\t\t\twhiteSpace: \"pre-wrap\",\n\t\t\t\twordBreak: \"keep-all\",\n\t\t\t\tmaxLines: \"1\",\n\t\t\t\t\"&.emphasize\": {\n\t\t\t\t\tmargin: \"-1rem\",\n\t\t\t\t\tpadding: \"1rem\",\n\t\t\t\t\ttransformStyle: \"preserve-3d\",\n\t\t\t\t\tperspective: \"50vw\",\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tlyricSubLine: {\n\t\t\tfontSize: \"max(50%, 10px)\",\n\t\t\topacity: 0.5,\n\t\t},\n\t\tdisableSpring: {\n\t\t\t\"& > *\": {\n\t\t\t\ttransition: \"filter 0.25s, transform 0.5s\",\n\t\t\t},\n\t\t},\n\t\tinterludeDots: {\n\t\t\theight: \"min(1rem,2.5vh)\",\n\t\t\ttransformOrigin: \"center\",\n\t\t\twidth: \"fit-content\",\n\t\t\tpadding: \"2.5% 0\",\n\t\t\tposition: \"absolute\",\n\t\t\tdisplay: \"flex\",\n\t\t\tgap: \"0.5rem\",\n\t\t\t\"& > *\": {\n\t\t\t\twidth: \"100%\",\n\t\t\t\tdisplay: \"inline-block\",\n\t\t\t\tborderRadius: \"50%\",\n\t\t\t\taspectRatio: \"1 / 1\",\n\t\t\t\tbackgroundColor: \"var(--amll-lyric-line-color)\",\n\t\t\t\tmarginRight: \"4px\",\n\t\t\t},\n\t\t\t\"&.duet\": {\n\t\t\t\tright: \"1rem\",\n\t\t\t\ttransformOrigin: \"center\",\n\t\t\t},\n\t\t},\n\t\t\"@supports (mix-blend-mode: plus-lighter)\": {\n\t\t\tlyricSubLine: {\n\t\t\t\topacity: 0.3,\n\t\t\t},\n\t\t},\n\t\ttmpDisableTransition: {\n\t\t\ttransition: \"none !important\",\n\t\t},\n\t});\n\tprivate onPageShow = () => {\n\t\tthis.calcLayout(true);\n\t};\n\tconstructor() {\n\t\tsuper();\n\t\tthis.interludeDots = new InterludeDots(this);\n\t\tthis.element.setAttribute(\"class\", this.style.classes.lyricPlayer);\n\t\tif (this.disableSpring) {\n\t\t\tthis.element.classList.add(this.style.classes.disableSpring);\n\t\t}\n\t\tthis.rebuildStyle();\n\t\tthis.resizeObserver.observe(this.element);\n\t\tthis.element.appendChild(this.interludeDots.getElement());\n\t\tthis.style.attach();\n\t\tthis.interludeDots.setTransform(0, 200);\n\t\twindow.addEventListener(\"pageshow\", this.onPageShow);\n\t}\n\t/**\n\t * 获取当前播放时间里是否处于间奏区间\n\t * 如果是则会返回单位为毫秒的始末时间\n\t * 否则返回 undefined\n\t *\n\t * 这个只允许内部调用\n\t * @returns [开始时间,结束时间] 或 undefined 如果不处于间奏区间\n\t */\n\tgetCurrentInterlude(): [number, number, number] | undefined {\n\t\tif (this.bufferedLines.size > 0) return undefined;\n\t\tconst currentTime = this.currentTime + 20;\n\t\tconst i = this.scrollToIndex;\n\t\tif (i === 0) {\n\t\t\tif (this.processedLines[0]?.startTime) {\n\t\t\t\tif (this.processedLines[0].startTime > currentTime) {\n\t\t\t\t\treturn [0, this.processedLines[0].startTime, -2];\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (\n\t\t\tthis.processedLines[i]?.endTime &&\n\t\t\tthis.processedLines[i + 1]?.startTime\n\t\t) {\n\t\t\tif (\n\t\t\t\tthis.processedLines[i + 1].startTime > currentTime &&\n\t\t\t\tthis.processedLines[i].endTime < currentTime\n\t\t\t) {\n\t\t\t\treturn [\n\t\t\t\t\tthis.processedLines[i].endTime,\n\t\t\t\t\tthis.processedLines[i + 1].startTime,\n\t\t\t\t\ti,\n\t\t\t\t];\n\t\t\t}\n\t\t}\n\t\treturn undefined;\n\t}\n\t/**\n\t * 重建样式\n\t *\n\t * 这个只允许内部调用\n\t */\n\trebuildStyle() {\n\t\tlet style = \"\";\n\t\tstyle += \"--amll-lyric-player-width:\";\n\t\tstyle += this.element.clientWidth;\n\t\tstyle += \"px;\";\n\t\tstyle += \"--amll-lyric-player-height:\";\n\t\tstyle += this.element.clientHeight;\n\t\tstyle += \"px;\";\n\t\tstyle += \"--amll-lyric-line-color:\";\n\t\tstyle += \"#FFFFFF;\";\n\t\tstyle += \"--amll-player-time:\";\n\t\tstyle += this.currentTime;\n\t\tstyle += \";\";\n\t\tthis.element.setAttribute(\"style\", style);\n\t}\n\t/**\n\t * 设置是否启用歌词行的模糊效果\n\t * @param enable 是否启用\n\t */\n\tsetEnableBlur(enable: boolean) {\n\t\tif (this.enableBlur === enable) return;\n\t\tthis.enableBlur = enable;\n\t\tthis.calcLayout();\n\t}\n\t/**\n\t * 设置当前播放歌词,要注意传入后这个数组内的信息不得修改,否则会发生错误\n\t * @param lines 歌词数组\n\t */\n\tsetLyricLines(lines: LyricLine[]) {\n\t\tthis.lyricLines = lines;\n\t\tconst timeOffset = 750;\n\t\tthis.processedLines = lines\n\t\t\t.filter(\n\t\t\t\t(line) =>\n\t\t\t\t\tline.words.reduce((pv, cv) => pv + cv.word.trim().length, 0) > 0,\n\t\t\t)\n\t\t\t.map((line, i, lines) => {\n\t\t\t\tif (line.isBG)\n\t\t\t\t\treturn {\n\t\t\t\t\t\t...line,\n\t\t\t\t\t};\n\t\t\t\telse {\n\t\t\t\t\tconst lastLine = lines[i - 1];\n\t\t\t\t\tconst pastLine = lines[i - 2];\n\t\t\t\t\tif (lastLine?.isBG && pastLine) {\n\t\t\t\t\t\tif (pastLine.endTime < line.startTime) {\n\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t...line,\n\t\t\t\t\t\t\t\tstartTime:\n\t\t\t\t\t\t\t\t\tMath.max(pastLine.endTime, line.startTime - timeOffset) ||\n\t\t\t\t\t\t\t\t\tline.startTime,\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (lastLine?.endTime) {\n\t\t\t\t\t\tif (lastLine.endTime < line.startTime) {\n\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t...line,\n\t\t\t\t\t\t\t\tstartTime:\n\t\t\t\t\t\t\t\t\tMath.max(lastLine?.endTime, line.startTime - timeOffset) ||\n\t\t\t\t\t\t\t\t\tline.startTime,\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn {\n\t\t\t\t\t\t...line,\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t});\n\t\tthis.processedLines.forEach((line, i, lines) => {\n\t\t\tconst nextLine = lines[i + 1];\n\t\t\tconst lastWord = line.words[line.words.length - 1];\n\t\t\tif (lastWord && shouldEmphasize(lastWord)) {\n\t\t\t\tif (nextLine) {\n\t\t\t\t\tif (nextLine.startTime > line.endTime) {\n\t\t\t\t\t\tline.endTime = Math.min(line.endTime + 1500, nextLine.startTime);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tline.endTime = line.endTime + 1500;\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\tthis.processedLines.forEach((line, i, lines) => {\n\t\t\tif (line.isBG) return;\n\t\t\tconst nextLine = lines[i + 1];\n\t\t\tif (nextLine?.isBG) {\n\t\t\t\tnextLine.startTime = Math.min(nextLine.startTime, line.startTime);\n\t\t\t}\n\t\t});\n\t\tthis.lyricLinesEl.forEach((el) => el.dispose());\n\t\tthis.lyricLinesEl = this.processedLines.map(\n\t\t\t(line) => new LyricLineEl(this, line),\n\t\t);\n\t\tthis.lyricLinesEl.forEach((el) => {\n\t\t\tthis.element.appendChild(el.getElement());\n\t\t\tel.updateMaskImage();\n\t\t});\n\t\tthis.setLinePosXSpringParams({});\n\t\tthis.setLinePosYSpringParams({});\n\t\tthis.setLineScaleSpringParams({});\n\t\tthis.setCurrentTime(0, true);\n\t\tthis.calcLayout(true);\n\t}\n\t/**\n\t * 重新布局定位歌词行的位置,调用完成后再逐帧调用 `update`\n\t * 函数即可让歌词通过动画移动到目标位置。\n\t *\n\t * 此函数还有一个 `reflow` 参数,用于指定是否需要重新计算布局\n\t *\n\t * 因为计算布局必定会导致浏览器重排布局,所以会大幅度影响流畅度和性能,故请只在以下情况下将其​设置为 true:\n\t *\n\t * 1. 歌词页面大小发生改变时(这个组件会自行处理)\n\t * 2. 加载了新的歌词时(不论前后歌词是否完全一样)\n\t * 3. 用户自行跳转了歌曲播放位置(不论距离远近)\n\t *\n\t * @param reflow 是否进行重新布局(重新计算每行歌词大小)\n\t */\n\tcalcLayout(reflow = false) {\n\t\tif (reflow) {\n\t\t\tthis.lyricLinesEl.forEach((el) => {\n\t\t\t\tconst size: [number, number] = el.measureSize();\n\t\t\t\tthis.lyricLinesSize.set(el, size);\n\t\t\t\tel.lineSize = size;\n\t\t\t});\n\t\t\tthis.interludeDotsSize[0] = this.interludeDots.getElement().clientWidth;\n\t\t\tthis.interludeDotsSize[1] = this.interludeDots.getElement().clientHeight;\n\t\t}\n\t\tconst SCALE_ASPECT = 0.95;\n\t\tconst scrollOffset = this.lyricLinesEl\n\t\t\t.slice(0, this.scrollToIndex)\n\t\t\t.reduce(\n\t\t\t\t(acc, el) =>\n\t\t\t\t\tacc + (el.getLine().isBG ? 0 : this.lyricLinesSize.get(el)?.[1] ?? 0),\n\t\t\t\t0,\n\t\t\t);\n\t\tlet curPos = -scrollOffset;\n\t\tif (this.alignAnchor === \"bottom\") {\n\t\t\tcurPos += this.element.clientHeight / 2;\n\t\t\tconst curLine = this.lyricLinesEl[this.scrollToIndex];\n\t\t\tif (curLine) {\n\t\t\t\tconst lineHeight = this.lyricLinesSize.get(curLine)?.[1] ?? 0;\n\t\t\t\tcurPos -= lineHeight / 2;\n\t\t\t}\n\t\t} else if (typeof this.alignAnchor === \"number\") {\n\t\t\tcurPos += this.element.clientHeight * this.alignAnchor;\n\t\t\tconst curLine = this.lyricLinesEl[this.scrollToIndex];\n\t\t\tif (curLine) {\n\t\t\t\tconst lineHeight = this.lyricLinesSize.get(curLine)?.[1] ?? 0;\n\t\t\t\tcurPos -= lineHeight / 2;\n\t\t\t}\n\t\t}\n\t\tconst interlude = this.getCurrentInterlude();\n\t\tlet interludeDuration = 0;\n\t\tif (interlude) {\n\t\t\tinterludeDuration = interlude[1] - interlude[0];\n\t\t\tif (interludeDuration >= 5000) {\n\t\t\t\tconst nextLine = this.lyricLinesEl[interlude[2] + 1];\n\t\t\t\tif (nextLine) {\n\t\t\t\t\tcurPos -= this.lyricLinesSize.get(nextLine)?.[1] ?? 0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tconst latestIndex = Math.max(...this.bufferedLines);\n\t\tlet delay = 0;\n\t\tlet setDots = false;\n\t\tthis.lyricLinesEl.forEach((el, i) => {\n\t\t\tconst hasBuffered = this.bufferedLines.has(i);\n\t\t\tconst isActive =\n\t\t\t\thasBuffered || (i >= this.scrollToIndex && i < latestIndex);\n\t\t\tconst line = el.getLine();\n\t\t\tlet left = 0;\n\t\t\tif (line.isDuet) {\n\t\t\t\tleft = this.size[0] - (this.lyricLinesSize.get(el)?.[0] ?? 0);\n\t\t\t}\n\t\t\tif (\n\t\t\t\t!setDots &&\n\t\t\t\tinterludeDuration >= 5000 &&\n\t\t\t\t((i === this.scrollToIndex && interlude?.[2] === -2) ||\n\t\t\t\t\ti === this.scrollToIndex + 1)\n\t\t\t) {\n\t\t\t\tsetDots = true;\n\t\t\t\tthis.interludeDots.setTransform(0, curPos);\n\t\t\t\tif (interlude) {\n\t\t\t\t\tthis.interludeDots.setInterlude([interlude[0], interlude[1]]);\n\t\t\t\t}\n\t\t\t\tcurPos += this.interludeDotsSize[1];\n\t\t\t}\n\t\t\tel.setTransform(\n\t\t\t\tleft,\n\t\t\t\tcurPos,\n\t\t\t\tisActive ? 1 : SCALE_ASPECT,\n\t\t\t\thasBuffered ? 1 : 1 / 3,\n\t\t\t\tthis.enableBlur\n\t\t\t\t\t? 3 *\n\t\t\t\t\t (isActive\n\t\t\t\t\t\t\t? 0\n\t\t\t\t\t\t\t: 1 +\n\t\t\t\t\t\t\t (i < this.scrollToIndex\n\t\t\t\t\t\t\t\t\t? Math.abs(this.scrollToIndex - i)\n\t\t\t\t\t\t\t\t\t: Math.abs(i - Math.max(this.scrollToIndex, latestIndex))))\n\t\t\t\t\t: 0,\n\t\t\t\treflow,\n\t\t\t\tdelay,\n\t\t\t);\n\t\t\tif (line.isBG && isActive) {\n\t\t\t\tcurPos += this.lyricLinesSize.get(el)?.[1] ?? 0;\n\t\t\t} else if (!line.isBG) {\n\t\t\t\tcurPos += this.lyricLinesSize.get(el)?.[1] ?? 0;\n\t\t\t}\n\t\t\tif (curPos >= 0) {\n\t\t\t\tdelay += 0.05;\n\t\t\t}\n\t\t});\n\t}\n\t/**\n\t * 获取当前歌词的播放位置\n\t *\n\t * 一般和最后调用 `setCurrentTime` 给予的参数一样\n\t * @returns 当前播放位置\n\t */\n\tgetCurrentTime() {\n\t\treturn this.currentTime;\n\t}\n\t/**\n\t * 获取当前歌词数组\n\t *\n\t * 一般和最后调用 `setLyricLines` 给予的参数一样\n\t * @returns 当前歌词数组\n\t */\n\tgetLyricLines() {\n\t\treturn this.lyricLines;\n\t}\n\tgetElement(): HTMLElement {\n\t\treturn this.element;\n\t}\n\t/**\n\t * 设置歌词行的对齐方式,默认为 `top`\n\t *\n\t * - 设置成 `top` 的话歌词将会向组件顶部对齐\n\t * - 设置成 `bottom` 的话歌词将会向组件底部对齐\n\t * - 设置成 [0.0-1.0] 之间任意数字的话则会根据当前组件高度从顶部向下位移为对齐位置垂直居中对齐\n\t * @param alignAnchor 歌词行对齐方式,详情见函数说明\n\t */\n\tsetAlignAnchor(alignAnchor: \"top\" | \"bottom\" | number) {\n\t\tthis.alignAnchor = alignAnchor;\n\t}\n\t/**\n\t * 设置当前播放进度,单位为毫秒且**必须是整数**,此时将会更新内部的歌词进度信息\n\t * 内部会根据调用间隔和播放进度自动决定如何滚动和显示歌词,所以这个的调用频率越快越准确越好\n\t *\n\t * 调用完成后,可以每帧调用 `update` 函数来执行歌词动画效果\n\t * @param time 当前播放进度,单位为毫秒\n\t */\n\tsetCurrentTime(time: number, isSeek = false) {\n\t\t// 我在这里定义了歌词的选择状态:\n\t\t// 普通行:当前不处于时间范围内的歌词行\n\t\t// 热行:当前绝对处于播放时间内的歌词行,且一般会被立刻加入到缓冲行中\n\t\t// 缓冲行:一般处于播放时间后的歌词行,会因为当前播放状态的缘故推迟解除状态\n\n\t\t// 然后我们需要让歌词行为如下:\n\t\t// 如果当前仍有缓冲行的情况下加入新热行,则不会解除当前缓冲行,且也不会修改当前滚动位置\n\t\t// 如果当前所有缓冲行都将被删除且没有新热行加入,则删除所有缓冲行,且也不会修改当前滚动位置\n\t\t// 如果当前所有缓冲行都将被删除且有新热行加入,则删除所有缓冲行并加入新热行作为缓冲行,然后修改当前滚动位置\n\t\tthis.currentTime = time;\n\t\tthis.element.style.setProperty(\"--amll-player-time\", `${time}`);\n\t\tconst removedHotIds = new Set<number>();\n\t\tconst removedIds = new Set<number>();\n\t\tconst addedIds = new Set<number>();\n\n\t\t// 先检索当前已经超出时间范围的缓冲行,列入待删除集内\n\t\tthis.hotLines.forEach((lastHotId) => {\n\t\t\tconst line = this.processedLines[lastHotId];\n\t\t\tif (line.isBG) return;\n\t\t\tif (line) {\n\t\t\t\tconst nextLine = this.processedLines[lastHotId + 1];\n\t\t\t\tif (nextLine?.isBG) {\n\t\t\t\t\tconst startTime = Math.min(line.startTime, nextLine?.startTime);\n\t\t\t\t\tconst endTime = Math.max(line.endTime, nextLine?.endTime);\n\t\t\t\t\tif (startTime > time || endTime <= time) {\n\t\t\t\t\t\tthis.hotLines.delete(lastHotId);\n\t\t\t\t\t\tremovedHotIds.add(lastHotId);\n\t\t\t\t\t\tthis.hotLines.delete(lastHotId + 1);\n\t\t\t\t\t\tremovedHotIds.add(lastHotId + 1);\n\t\t\t\t\t\tif (isSeek) {\n\t\t\t\t\t\t\tthis.lyricLinesEl[lastHotId].disable();\n\t\t\t\t\t\t\tthis.lyricLinesEl[lastHotId + 1].disable();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else if (line.startTime > time || line.endTime <= time) {\n\t\t\t\t\tthis.hotLines.delete(lastHotId);\n\t\t\t\t\tremovedHotIds.add(lastHotId);\n\t\t\t\t\tif (isSeek) this.lyricLinesEl[lastHotId].disable();\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tthis.hotLines.delete(lastHotId);\n\t\t\t\tremovedHotIds.add(lastHotId);\n\t\t\t\tif (isSeek) this.lyricLinesEl[lastHotId].disable();\n\t\t\t}\n\t\t});\n\t\tthis.processedLines.forEach((line, id, arr) => {\n\t\t\tif (!line.isBG && line.startTime <= time && line.endTime > time) {\n\t\t\t\tif (!this.hotLines.has(id)) {\n\t\t\t\t\tthis.hotLines.add(id);\n\t\t\t\t\taddedIds.add(id);\n\t\t\t\t\tif (isSeek) this.lyricLinesEl[id].enable();\n\t\t\t\t\tif (arr[id + 1]?.isBG) {\n\t\t\t\t\t\tthis.hotLines.add(id + 1);\n\t\t\t\t\t\taddedIds.add(id + 1);\n\t\t\t\t\t\tif (isSeek) this.lyricLinesEl[id + 1].enable();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\tthis.bufferedLines.forEach((v) => {\n\t\t\tif (!this.hotLines.has(v)) {\n\t\t\t\tremovedIds.add(v);\n\t\t\t\tif (isSeek) this.lyricLinesEl[v].disable();\n\t\t\t}\n\t\t});\n\t\tif (isSeek) {\n\t\t\tif (this.bufferedLines.size > 0) {\n\t\t\t\tthis.scrollToIndex = Math.min(...this.bufferedLines);\n\t\t\t} else {\n\t\t\t\tthis.scrollToIndex = this.processedLines.findIndex(\n\t\t\t\t\t(line) => line.startTime >= time,\n\t\t\t\t);\n\t\t\t}\n\t\t\tthis.bufferedLines.clear();\n\t\t\tthis.hotLines.forEach((v) => this.bufferedLines.add(v));\n\t\t\tthis.calcLayout(true);\n\t\t} else if (removedIds.size > 0 || addedIds.size > 0) {\n\t\t\tif (removedIds.size === 0 && addedIds.size > 0) {\n\t\t\t\taddedIds.forEach((v) => {\n\t\t\t\t\tthis.bufferedLines.add(v);\n\t\t\t\t\tthis.lyricLinesEl[v].enable();\n\t\t\t\t});\n\t\t\t\tthis.scrollToIndex = Math.min(...this.bufferedLines);\n\t\t\t} else if (addedIds.size === 0 && removedIds.size > 0) {\n\t\t\t\tif (eqSet(removedIds, this.bufferedLines)) {\n\t\t\t\t\tthis.bufferedLines.forEach((v) => {\n\t\t\t\t\t\tif (!this.hotLines.has(v)) {\n\t\t\t\t\t\t\tthis.bufferedLines.delete(v);\n\t\t\t\t\t\t\tthis.lyricLinesEl[v].disable();\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\taddedIds.forEach((v) => {\n\t\t\t\t\tthis.bufferedLines.add(v);\n\t\t\t\t\tthis.lyricLinesEl[v].enable();\n\t\t\t\t});\n\t\t\t\tremovedIds.forEach((v) => {\n\t\t\t\t\tthis.bufferedLines.delete(v);\n\t\t\t\t\tthis.lyricLinesEl[v].disable();\n\t\t\t\t});\n\t\t\t\tif (this.bufferedLines.size > 0)\n\t\t\t\t\tthis.scrollToIndex = Math.min(...this.bufferedLines);\n\t\t\t}\n\t\t\tthis.calcLayout();\n\t\t}\n\t}\n\t/**\n\t * 更新动画,这个函数应该被逐帧调用或者在以下情况下调用一次:\n\t *\n\t * 1. 刚刚调用完设置歌词函数的时候\n\t * @param delta 距离上一次被调用到现在的时长,单位为毫秒(可为浮点数)\n\t */\n\tupdate(delta = 0) {\n\t\tconst deltaS = delta / 1000;\n\t\tthis.interludeDots.update(delta);\n\t\tthis.lyricLinesEl.forEach((line) => line.update(deltaS));\n\t}\n\t/**\n\t * 设置所有歌词行在横坐标上的弹簧属性,包括重量、弹力和阻力。\n\t *\n\t * @param params 需要设置的弹簧属性,提供的属性将会覆盖原来的属性,未提供的属性将会保持原样\n\t */\n\tsetLinePosXSpringParams(params: Partial<SpringParams>) {\n\t\tthis.posXSpringParams = {\n\t\t\t...this.posXSpringParams,\n\t\t\t...params,\n\t\t};\n\t\tthis.lyricLinesEl.forEach((line) =>\n\t\t\tline.lineTransforms.posX.updateParams(this.posXSpringParams),\n\t\t);\n\t}\n\t/**\n\t * 设置所有歌词行在​纵坐标上的弹簧属性,包括重量、弹力和阻力。\n\t *\n\t * @param params 需要设置的弹簧属性,提供的属性将会覆盖原来的属性,未提供的属性将会保持原样\n\t */\n\tsetLinePosYSpringParams(params: Partial<SpringParams>) {\n\t\tthis.posYSpringParams = {\n\t\t\t...this.posYSpringParams,\n\t\t\t...params,\n\t\t};\n\t\tthis.lyricLinesEl.forEach((line) =>\n\t\t\tline.lineTransforms.posY.updateParams(this.posYSpringParams),\n\t\t);\n\t}\n\t/**\n\t * 设置所有歌词行在​缩放大小上的弹簧属性,包括重量、弹力和阻力。\n\t *\n\t * @param params 需要设置的弹簧属性,提供的属性将会覆盖原来的属性,未提供的属性将会保持原样\n\t */\n\tsetLineScaleSpringParams(params: Partial<SpringParams>) {\n\t\tthis.scaleSpringParams = {\n\t\t\t...this.scaleSpringParams,\n\t\t\t...params,\n\t\t};\n\t\tthis.lyricLinesEl.forEach((line) =>\n\t\t\tline.lineTransforms.scale.updateParams(this.scaleSpringParams),\n\t\t);\n\t}\n\tdispose(): void {\n\t\tthis.element.remove();\n\t\tthis.resizeObserver.disconnect();\n\t\tthis.style.detach();\n\t\tthis.lyricLinesEl.forEach((el) => el.dispose());\n\t\twindow.removeEventListener(\"pageshow\", this.onPageShow);\n\t}\n}\n"],"names":["timeRegexp","parseTimespan","timeSpan","matches","hour","min","sec","parseTTML","ttmlText","ttmlDoc","mainAgentId","agent","id","result","lineEl","line","curBGLine","wordNode","word","wordEl","role","bgLine","firstWord","lastWord","TimedContainer","Container","PixiRenderer","canvas","bounds","Application","delta","lastContainer","s1","s2","s3","s4","maxSize","speed","scale","minBorder","c0","ColorMatrixFilter","c1","c2","BlurFilter","fps","albumUrl","tex","Texture","container","Sprite","BackgroundRender","eqSet","xs","ys","x","easeInOutBack","clamp","cur","max","InterludeDots","lyricPlayer","left","top","interlude","curStyle","interludeDuration","currentDuration","breatheDuration","globalOpacity","dot0Opacity","dot1Opacity","dot2Opacity","Spring","currentPosition","curV","solveSpring","getVelocity","targetPosition","params","delay","from","velocity","to","soft","stiffness","damping","mass","angular_frequency","leftover","t","damping_frequency","dfm","dm","derivative","f","CJKEXP","generateFadeGradient","width","bright","dark","totalAspect","widthInTotal","leftPos","shouldEmphasize","LyricLineEl","lyricLine","main","trans","roman","a","size","style","splited","trimmedLength","pv","cv","pos","sub","i","reusableElements","reusableTextNodes","collectNodes","curNode","lastWordEl","c","charEl","wholeWordEl","duration","el","arr","maskImage","_widthInTotal","totalAspectStr","w","maskPos","opacity","blur","force","l","r","b","pl","pt","pr","pb","jss","create","preset","LyricPlayer","rect","enable","currentTime","lines","timeOffset","lastLine","pastLine","nextLine","reflow","SCALE_ASPECT","curPos","acc","curLine","lineHeight","latestIndex","setDots","hasBuffered","isActive","alignAnchor","time","isSeek","removedHotIds","removedIds","addedIds","lastHotId","startTime","endTime","v","deltaS"],"mappings":";;;;;;;;AAEA,MAAMA,IACL;AACD,SAASC,EAAcC,GAA0B;AAC1C,QAAAC,IAAUH,EAAW,KAAKE,CAAQ;AACxC,MAAIC,GAAS;AACZ,UAAMC,IAAO,OAAOD,EAAQ,QAAQ,QAAQ,GAAG,GACzCE,IAAM,OAAOF,EAAQ,QAAQ,OAAO,GAAG,GACvCG,IAAM,OAAOH,EAAQ,QAAQ,IAAI,QAAQ,KAAK,GAAG,KAAK,GAAG;AAC/D,WAAO,KAAK,OAAOC,IAAO,OAAOC,IAAM,KAAKC,KAAO,GAAI;AAAA,EAAA;AAEjD,UAAA,IAAI,UAAU,YAAY;AAElC;AAEO,SAASC,EAAUC,GAA+B;AAExD,QAAMC,IADY,IAAI,YACiB;AAAA,IACtCD;AAAA,IACA;AAAA,EAAA;AAGD,MAAIE,IAAc;AAElB,aAAWC,KAASF,EAAQ,iBAAiB,aAAa;AACzD,QAAIE,EAAM,aAAa,MAAM,MAAM,UAAU;AACtC,YAAAC,IAAKD,EAAM,aAAa,QAAQ;AACtC,MAAIC,MACWF,IAAAE;AAAA,IAEhB;AAGD,QAAMC,IAAsB,CAAA;AAE5B,aAAWC,KAAUL,EAAQ,iBAAiB,oBAAoB,GAAG;AACpE,UAAMM,IAAkB;AAAA,MACvB,OAAO,CAAC;AAAA,MACR,WAAWd,EAAca,EAAO,aAAa,OAAO,KAAK,KAAK;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GAEJ,KAAK,aAAa;AAAA,MAAQ,CAAChE,MAC1BA,EAAK,eAAe,KAAK,aAAa,KAAK,gBAAgB;AAAA,IAAA;AAAA,EAE7D;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,yBAAyBgE,GAA+B;AACvD,SAAK,oBAAoB;AAAA,MACxB,GAAG,KAAK;AAAA,MACR,GAAGA;AAAA,IAAA,GAEJ,KAAK,aAAa;AAAA,MAAQ,CAAChE,MAC1BA,EAAK,eAAe,MAAM,aAAa,KAAK,iBAAiB;AAAA,IAAA;AAAA,EAE/D;AAAA,EACA,UAAgB;AACf,SAAK,QAAQ,UACb,KAAK,eAAe,cACpB,KAAK,MAAM,UACX,KAAK,aAAa,QAAQ,CAACkH,MAAOA,EAAG,SAAS,GACvC,OAAA,oBAAoB,YAAY,KAAK,UAAU;AAAA,EACvD;AACD;"}
1
+ {"version":3,"file":"amll-core.mjs","sources":["../src/lyric/ttml.ts","../src/bg-render/pixi-renderer.ts","../src/bg-render/index.ts","../src/utils/eq-set.ts","../src/utils/spring.ts","../src/lyric-player/bottom-line.ts","../src/lyric-player/interlude-dots.ts","../src/lyric-player/lyric-line.ts","../src/lyric-player/index.ts"],"sourcesContent":["import { LyricLine, LyricWord } from \"../interfaces\";\n\nconst timeRegexp =\n\t/^(((?<hour>[0-9]+):)?(?<min>[0-9]+):)?(?<sec>[0-9]+([\\.:]([0-9]+))?)/;\nfunction parseTimespan(timeSpan: string): number {\n\tconst matches = timeRegexp.exec(timeSpan);\n\tif (matches) {\n\t\tconst hour = Number(matches.groups?.hour || \"0\");\n\t\tconst min = Number(matches.groups?.min || \"0\");\n\t\tconst sec = Number(matches.groups?.sec.replace(/:/, \".\") || \"0\");\n\t\treturn Math.floor((hour * 3600 + min * 60 + sec) * 1000);\n\t} else {\n\t\tthrow new TypeError(\"时间戳字符串解析失败\");\n\t}\n}\n\nexport function parseTTML(ttmlText: string): LyricLine[] {\n\tconst domParser = new DOMParser();\n\tconst ttmlDoc: XMLDocument = domParser.parseFromString(\n\t\tttmlText,\n\t\t\"application/xml\",\n\t);\n\n\tlet mainAgentId = \"v1\";\n\n\tfor (const agent of ttmlDoc.querySelectorAll(\"ttm\\\\:agent\")) {\n\t\tif (agent.getAttribute(\"type\") === \"person\") {\n\t\t\tconst id = agent.getAttribute(\"xml:id\");\n\t\t\tif (id) {\n\t\t\t\tmainAgentId = id;\n\t\t\t}\n\t\t}\n\t}\n\n\tconst result: LyricLine[] = [];\n\n\tfor (const lineEl of ttmlDoc.querySelectorAll(\"body p[begin][end]\")) {\n\t\tconst line: LyricLine = {\n\t\t\twords: [],\n\t\t\tstartTime: parseTimespan(lineEl.getAttribute(\"begin\") ?? \"0:0\"),\n\t\t\tendTime: parseTimespan(lineEl.getAttribute(\"end\") ?? \"0:0\"),\n\t\t\ttranslatedLyric: \"\",\n\t\t\tromanLyric: \"\",\n\t\t\tisBG: false,\n\t\t\tisDuet: lineEl.getAttribute(\"ttm:agent\") !== mainAgentId,\n\t\t};\n\t\tlet curBGLine: LyricLine | null = null;\n\n\t\tfor (const wordNode of lineEl.childNodes) {\n\t\t\tif (wordNode.nodeType === Node.TEXT_NODE) {\n\t\t\t\tconst word = wordNode.textContent ?? \"\";\n\t\t\t\tif (/^(\\s+)$/.test(word)) {\n\t\t\t\t\tline.words.push({\n\t\t\t\t\t\tword: \" \",\n\t\t\t\t\t\tstartTime: 0,\n\t\t\t\t\t\tendTime: 0,\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tline.words.push({\n\t\t\t\t\t\tword: word,\n\t\t\t\t\t\tstartTime: 0,\n\t\t\t\t\t\tendTime: 0,\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t} else if (wordNode.nodeType === Node.ELEMENT_NODE) {\n\t\t\t\tconst wordEl = wordNode as Element;\n\t\t\t\tconst role = wordEl.getAttribute(\"ttm:role\");\n\n\t\t\t\tif (wordEl.nodeName === \"span\" && role) {\n\t\t\t\t\tif (role === \"x-bg\") {\n\t\t\t\t\t\tconst bgLine: LyricLine = {\n\t\t\t\t\t\t\twords: [],\n\t\t\t\t\t\t\tstartTime: line.startTime,\n\t\t\t\t\t\t\tendTime: line.endTime,\n\t\t\t\t\t\t\ttranslatedLyric: \"\",\n\t\t\t\t\t\t\tromanLyric: \"\",\n\t\t\t\t\t\t\tisBG: true,\n\t\t\t\t\t\t\tisDuet: line.isDuet,\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\tfor (const wordNode of wordEl.childNodes) {\n\t\t\t\t\t\t\tif (wordNode.nodeType === Node.TEXT_NODE) {\n\t\t\t\t\t\t\t\tconst word = wordNode.textContent ?? \"\";\n\t\t\t\t\t\t\t\tif (/^(\\s+)$/.test(word)) {\n\t\t\t\t\t\t\t\t\tbgLine.words.push({\n\t\t\t\t\t\t\t\t\t\tword: \" \",\n\t\t\t\t\t\t\t\t\t\tstartTime: 0,\n\t\t\t\t\t\t\t\t\t\tendTime: 0,\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tbgLine.words.push({\n\t\t\t\t\t\t\t\t\t\tword: word,\n\t\t\t\t\t\t\t\t\t\tstartTime: 0,\n\t\t\t\t\t\t\t\t\t\tendTime: 0,\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else if (wordNode.nodeType === Node.ELEMENT_NODE) {\n\t\t\t\t\t\t\t\tconst wordEl = wordNode as Element;\n\t\t\t\t\t\t\t\tconst role = wordEl.getAttribute(\"ttm:role\");\n\t\t\t\t\t\t\t\tif (wordEl.nodeName === \"span\" && role) {\n\t\t\t\t\t\t\t\t\tif (role === \"x-translation\") {\n\t\t\t\t\t\t\t\t\t\tbgLine.translatedLyric = wordEl.innerHTML.trim();\n\t\t\t\t\t\t\t\t\t} else if (role === \"x-roman\") {\n\t\t\t\t\t\t\t\t\t\tbgLine.romanLyric = wordEl.innerHTML.trim();\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} else if (\n\t\t\t\t\t\t\t\t\twordEl.hasAttribute(\"begin\") &&\n\t\t\t\t\t\t\t\t\twordEl.hasAttribute(\"end\")\n\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\tconst word = {\n\t\t\t\t\t\t\t\t\t\tword: wordNode.textContent,\n\t\t\t\t\t\t\t\t\t\tstartTime: parseTimespan(wordEl.getAttribute(\"begin\")!!),\n\t\t\t\t\t\t\t\t\t\tendTime: parseTimespan(wordEl.getAttribute(\"end\")!!),\n\t\t\t\t\t\t\t\t\t} as LyricWord;\n\t\t\t\t\t\t\t\t\tbgLine.words.push(word);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconst firstWord = bgLine.words[0];\n\t\t\t\t\t\tbgLine.startTime = firstWord.startTime;\n\t\t\t\t\t\tif (firstWord?.word.startsWith(\"(\")) {\n\t\t\t\t\t\t\tfirstWord.word = firstWord.word.substring(1);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconst lastWord = bgLine.words[bgLine.words.length - 1];\n\t\t\t\t\t\tbgLine.endTime = lastWord.endTime;\n\t\t\t\t\t\tif (lastWord?.word.endsWith(\")\")) {\n\t\t\t\t\t\t\tlastWord.word = lastWord.word.substring(\n\t\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\t\tlastWord.word.length - 1,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tcurBGLine = bgLine;\n\t\t\t\t\t} else if (role === \"x-translation\") {\n\t\t\t\t\t\tline.translatedLyric = wordEl.innerHTML;\n\t\t\t\t\t} else if (role === \"x-roman\") {\n\t\t\t\t\t\tline.romanLyric = wordEl.innerHTML;\n\t\t\t\t\t}\n\t\t\t\t} else if (wordEl.hasAttribute(\"begin\") && wordEl.hasAttribute(\"end\")) {\n\t\t\t\t\tconst word: LyricWord = {\n\t\t\t\t\t\tword: wordNode.textContent ?? \"\",\n\t\t\t\t\t\tstartTime: parseTimespan(wordEl.getAttribute(\"begin\")!!),\n\t\t\t\t\t\tendTime: parseTimespan(wordEl.getAttribute(\"end\")!!),\n\t\t\t\t\t};\n\t\t\t\t\tline.words.push(word);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tresult.push(line);\n\t\tif (curBGLine) {\n\t\t\t// line.startTime = Math.min(line.startTime, curBGLine.startTime);\n\t\t\t// line.endTime = Math.max(line.endTime, curBGLine.endTime);\n\t\t\t// curBGLine.startTime = line.startTime;\n\t\t\t// curBGLine.endTime = line.endTime;\n\t\t\tresult.push(curBGLine);\n\t\t}\n\t}\n\n\treturn result;\n}\n","import { Container } from \"@pixi/display\";\nimport { Application } from \"@pixi/app\";\nimport { BlurFilter } from \"@pixi/filter-blur\";\nimport { ColorMatrixFilter } from \"@pixi/filter-color-matrix\";\nimport { Texture } from \"@pixi/core\";\nimport { Sprite } from \"@pixi/sprite\";\nimport { Disposable } from \"../interfaces\";\n\nclass TimedContainer extends Container {\n\tpublic time = 0;\n}\n\nexport class PixiRenderer implements Disposable {\n\tprivate observer: ResizeObserver;\n\tprivate app: Application;\n\tprivate curContainer?: TimedContainer;\n\tprivate staticMode = false;\n\tprivate lastContainer: Set<TimedContainer> = new Set();\n\tprivate onTick = (delta: number): void => {\n\t\tfor (const lastContainer of this.lastContainer) {\n\t\t\tlastContainer.alpha = Math.max(0, lastContainer.alpha - delta / 60);\n\t\t\tif (lastContainer.alpha <= 0) {\n\t\t\t\tthis.app.stage.removeChild(lastContainer);\n\t\t\t\tthis.lastContainer.delete(lastContainer);\n\t\t\t}\n\t\t}\n\n\t\tif (this.curContainer) {\n\t\t\tthis.curContainer.alpha = Math.min(\n\t\t\t\t1,\n\t\t\t\tthis.curContainer.alpha + delta / 60,\n\t\t\t);\n\t\t\tconst [s1, s2, s3, s4] = this.curContainer.children as Sprite[];\n\t\t\tconst maxSize = Math.max(this.app.screen.width, this.app.screen.height);\n\t\t\ts1.position.set(this.app.screen.width / 2, this.app.screen.height / 2);\n\t\t\ts2.position.set(\n\t\t\t\tthis.app.screen.width / 2.5,\n\t\t\t\tthis.app.screen.height / 2.5,\n\t\t\t);\n\t\t\ts3.position.set(this.app.screen.width / 2, this.app.screen.height / 2);\n\t\t\ts4.position.set(this.app.screen.width / 2, this.app.screen.height / 2);\n\t\t\ts1.width = maxSize * Math.sqrt(2);\n\t\t\ts1.height = s1.width;\n\t\t\ts2.width = maxSize * 0.8;\n\t\t\ts2.height = s2.width;\n\t\t\ts3.width = maxSize * 0.5;\n\t\t\ts3.height = s3.width;\n\t\t\ts4.width = maxSize * 0.25;\n\t\t\ts4.height = s4.width;\n\n\t\t\tthis.curContainer.time += delta * this.flowSpeed;\n\n\t\t\ts1.rotation += (delta / 1000) * this.flowSpeed;\n\t\t\ts2.rotation -= (delta / 500) * this.flowSpeed;\n\t\t\ts3.rotation += (delta / 1000) * this.flowSpeed;\n\t\t\ts4.rotation -= (delta / 750) * this.flowSpeed;\n\n\t\t\ts3.x =\n\t\t\t\tthis.app.screen.width / 2 +\n\t\t\t\t(this.app.screen.width / 4) *\n\t\t\t\t\tMath.cos((this.curContainer.time / 1000) * 0.75);\n\t\t\ts3.y =\n\t\t\t\tthis.app.screen.height / 2 +\n\t\t\t\t(this.app.screen.width / 4) *\n\t\t\t\t\tMath.cos((this.curContainer.time / 1000) * 0.75);\n\n\t\t\ts4.x =\n\t\t\t\tthis.app.screen.width / 2 +\n\t\t\t\t(this.app.screen.width / 4) * 0.1 +\n\t\t\t\tMath.cos(this.curContainer.time * 0.006 * 0.75);\n\t\t\ts4.y =\n\t\t\t\tthis.app.screen.height / 2 +\n\t\t\t\t(this.app.screen.width / 4) * 0.1 +\n\t\t\t\tMath.cos(this.curContainer.time * 0.006 * 0.75);\n\n\t\t\tif (\n\t\t\t\tthis.curContainer.alpha >= 1 &&\n\t\t\t\tthis.lastContainer.size === 0 &&\n\t\t\t\tthis.staticMode\n\t\t\t) {\n\t\t\t\tthis.app.ticker.stop();\n\t\t\t}\n\t\t}\n\t};\n\tprivate flowSpeed = 2;\n\tprivate currerntRenderScale = 0.75;\n\tconstructor(private canvas: HTMLCanvasElement) {\n\t\tconst bounds = canvas.getBoundingClientRect();\n\t\tthis.canvas.width = bounds.width * this.currerntRenderScale;\n\t\tthis.canvas.height = bounds.height * this.currerntRenderScale;\n\t\tthis.observer = new ResizeObserver(() => {\n\t\t\tconst bounds = canvas.getBoundingClientRect();\n\t\t\tthis.canvas.width = Math.max(1, bounds.width);\n\t\t\tthis.canvas.height = Math.max(1, bounds.height);\n\t\t\tthis.app.renderer.resize(\n\t\t\t\tthis.canvas.width * this.currerntRenderScale,\n\t\t\t\tthis.canvas.height * this.currerntRenderScale,\n\t\t\t);\n\t\t\tthis.app.ticker.start();\n\t\t\tthis.rebuildFilters();\n\t\t});\n\t\tthis.observer.observe(canvas);\n\t\tthis.app = new Application({\n\t\t\tview: canvas,\n\t\t\tresizeTo: this.canvas,\n\t\t\tpowerPreference: \"low-power\",\n\t\t\tbackgroundAlpha: 0,\n\t\t});\n\t\tthis.rebuildFilters();\n\t\tthis.app.ticker.add(this.onTick);\n\t\tthis.app.ticker.start();\n\t}\n\t/**\n\t * 修改背景的流动速度,数字越大越快,默认为 2\n\t * @param speed 背景的流动速度,默认为 2\n\t */\n\tsetFlowSpeed(speed: number) {\n\t\tthis.flowSpeed = speed;\n\t}\n\t/**\n\t * 修改背景的渲染比例,默认是 0.5\n\t *\n\t * 一般情况下这个程度既没有明显瑕疵也不会特别吃性能\n\t * @param scale 背景的渲染比例\n\t */\n\tsetRenderScale(scale: number) {\n\t\tthis.currerntRenderScale = scale;\n\t\tconst bounds = this.canvas.getBoundingClientRect();\n\t\tthis.canvas.width = Math.max(1, bounds.width);\n\t\tthis.canvas.height = Math.max(1, bounds.height);\n\t\tthis.app.renderer.resize(\n\t\t\tthis.canvas.width * this.currerntRenderScale,\n\t\t\tthis.canvas.height * this.currerntRenderScale,\n\t\t);\n\t\tthis.rebuildFilters();\n\t}\n\tprivate rebuildFilters() {\n\t\tconst minBorder = Math.min(this.canvas.width, this.canvas.height);\n\t\tconst c0 = new ColorMatrixFilter();\n\t\tc0.saturate(1.2, false);\n\t\tconst c1 = new ColorMatrixFilter();\n\t\tc1.brightness(0.6, false);\n\t\tconst c2 = new ColorMatrixFilter();\n\t\tc2.contrast(0.3, true);\n\t\tthis.app.stage.filters = [];\n\t\tthis.app.stage.filters.push(new BlurFilter(5, 1));\n\t\tthis.app.stage.filters.push(new BlurFilter(10, 1));\n\t\tthis.app.stage.filters.push(new BlurFilter(20, 2));\n\t\tthis.app.stage.filters.push(new BlurFilter(40, 2));\n\t\tif (minBorder > 512) this.app.stage.filters.push(new BlurFilter(80, 2));\n\t\tif (minBorder > 768) this.app.stage.filters.push(new BlurFilter(160, 4));\n\t\tif (minBorder > 768 * 2)\n\t\t\tthis.app.stage.filters.push(new BlurFilter(320, 4));\n\n\t\tthis.app.stage.filters.push(c0, c1, c2);\n\t\tthis.app.stage.filters.push(new BlurFilter(5, 1));\n\t}\n\t/**\n\t * 是否启用静态模式,即图片在更换后就会保持静止状态并禁用更新,以节省性能\n\t * @param enable 是否启用静态模式\n\t */\n\tsetStaticMode(enable = false) {\n\t\tthis.staticMode = enable;\n\t\tthis.app.ticker.start();\n\t}\n\t/**\n\t * 修改背景动画帧率,默认是 30 FPS\n\t *\n\t * 如果设置成 0 则会停止动画\n\t * @param fps 目标帧率,默认 30 FPS\n\t */\n\tsetFPS(fps: number) {\n\t\tthis.app.ticker.maxFPS = fps;\n\t}\n\t/**\n\t * 暂停背景动画,画面即便是更新了图片也不会发生变化\n\t */\n\tpause() {\n\t\tthis.app.ticker.stop();\n\t\tthis.app.render();\n\t}\n\t/**\n\t * 恢复播放背景动画\n\t */\n\tresume() {\n\t\tthis.app.ticker.start();\n\t}\n\t/**\n\t * 设置背景专辑图片,图片材质加载并设置完成后会返回\n\t * @param albumUrl 图片的目标链接\n\t */\n\tasync setAlbumImage(albumUrl: string) {\n\t\tconst tex = await Texture.fromURL(albumUrl);\n\t\tconst container = new TimedContainer();\n\t\tconst s1 = new Sprite(tex);\n\t\tconst s2 = new Sprite(tex);\n\t\tconst s3 = new Sprite(tex);\n\t\tconst s4 = new Sprite(tex);\n\t\ts1.anchor.set(0.5, 0.5);\n\t\ts2.anchor.set(0.5, 0.5);\n\t\ts3.anchor.set(0.5, 0.5);\n\t\ts4.anchor.set(0.5, 0.5);\n\t\ts1.rotation = Math.random() * Math.PI * 2;\n\t\ts2.rotation = Math.random() * Math.PI * 2;\n\t\ts3.rotation = Math.random() * Math.PI * 2;\n\t\ts4.rotation = Math.random() * Math.PI * 2;\n\t\tcontainer.addChild(s1, s2, s3, s4);\n\t\tif (this.curContainer) this.lastContainer.add(this.curContainer);\n\t\tthis.curContainer = container;\n\t\tthis.app.stage.addChild(this.curContainer);\n\t\tthis.curContainer.alpha = 0;\n\t\tthis.app.ticker.start();\n\t}\n\n\tdispose() {\n\t\tthis.observer.disconnect();\n\t\tthis.app.ticker.remove(this.onTick);\n\t}\n}\n","/**\n * @fileoverview\n * 一个播放歌词的组件\n * @author SteveXMH\n */\n\nimport type { HasElement, Disposable } from \"../interfaces\";\nimport { PixiRenderer } from \"./pixi-renderer\";\n\nexport class BackgroundRender\n\textends PixiRenderer\n\timplements HasElement, Disposable\n{\n\tprivate element: HTMLCanvasElement;\n\tconstructor() {\n\t\tconst canvas = document.createElement(\"canvas\");\n\t\tsuper(canvas);\n\t\tthis.element = canvas;\n\t\tcanvas.style.pointerEvents = \"none\";\n\t\tcanvas.style.zIndex = \"-1\";\n\t}\n\tgetElement() {\n\t\treturn this.element;\n\t}\n\tdispose() {\n\t\tsuper.dispose();\n\t\tthis.element.remove();\n\t}\n}\n","export const eqSet: <T>(xs: Set<T>, ys: Set<T>) => boolean = (\n\txs,\n\tys,\n): boolean => xs.size === ys.size && [...xs].every((x) => ys.has(x));\n","/** MIT License github.com/pushkine/ */\nexport interface SpringParams {\n\tmass: number; // = 1.0\n\tdamping: number; // = 10.0\n\tstiffness: number; // = 100.0\n\tsoft: boolean; // = false\n}\n\ntype seconds = number;\n\nexport class Spring {\n\tprivate currentPosition = 0;\n\tprivate targetPosition = 0;\n\tprivate currentTime = 0;\n\tprivate params: Partial<SpringParams> = {};\n\tprivate currentSolver: (t: seconds) => number;\n\tprivate getV: (t: seconds) => number;\n\tprivate queueParams:\n\t\t| (Partial<SpringParams> & {\n\t\t\t\ttime: number;\n\t\t })\n\t\t| undefined;\n\tprivate queuePosition:\n\t\t| {\n\t\t\t\ttime: number;\n\t\t\t\tposition: number;\n\t\t }\n\t\t| undefined;\n\tconstructor(currentPosition = 0) {\n\t\tthis.targetPosition = currentPosition;\n\t\tthis.currentPosition = this.targetPosition;\n\t\tthis.currentSolver = () => this.targetPosition;\n\t\tthis.getV = () => 0;\n\t}\n\tprivate resetSolver() {\n\t\tconst curV = this.getV(this.currentTime);\n\t\tthis.currentTime = 0;\n\t\tthis.currentSolver = solveSpring(\n\t\t\tthis.currentPosition,\n\t\t\tcurV,\n\t\t\tthis.targetPosition,\n\t\t\t0,\n\t\t\tthis.params,\n\t\t);\n\t\tthis.getV = getVelocity(this.currentSolver);\n\t}\n\tarrived() {\n\t\treturn (\n\t\t\tMath.abs(this.targetPosition - this.currentPosition) < 0.01 &&\n\t\t\tthis.getV(this.currentTime) < 0.01 &&\n\t\t\tthis.queueParams === undefined &&\n\t\t\tthis.queuePosition === undefined\n\t\t);\n\t}\n\tsetPosition(targetPosition: number) {\n\t\tthis.targetPosition = targetPosition;\n\t\tthis.currentPosition = targetPosition;\n\t\tthis.currentSolver = () => this.targetPosition;\n\t\tthis.getV = () => 0;\n\t}\n\tupdate(delta = 0) {\n\t\tthis.currentTime += delta;\n\t\tthis.currentPosition = this.currentSolver(this.currentTime);\n\t\tif (this.queueParams) {\n\t\t\tthis.queueParams.time -= delta;\n\t\t\tif (this.queueParams.time <= 0) {\n\t\t\t\tthis.updateParams({\n\t\t\t\t\t...this.queueParams,\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\tif (this.queuePosition) {\n\t\t\tthis.queuePosition.time -= delta;\n\t\t\tif (this.queuePosition.time <= 0) {\n\t\t\t\tthis.setTargetPosition(this.queuePosition.position);\n\t\t\t}\n\t\t}\n\t\tif (this.arrived()) {\n\t\t\tthis.setPosition(this.targetPosition);\n\t\t}\n\t}\n\tupdateParams(params: Partial<SpringParams>, delay = 0) {\n\t\tif (delay > 0) {\n\t\t\tthis.queueParams = {\n\t\t\t\t...params,\n\t\t\t\ttime: delay,\n\t\t\t};\n\t\t} else {\n\t\t\tthis.params = {\n\t\t\t\t...this.params,\n\t\t\t\t...params,\n\t\t\t};\n\t\t\tthis.resetSolver();\n\t\t}\n\t}\n\tsetTargetPosition(targetPosition: number, delay = 0) {\n\t\tif (delay > 0) {\n\t\t\tthis.queuePosition = {\n\t\t\t\tposition: targetPosition,\n\t\t\t\ttime: delay,\n\t\t\t};\n\t\t} else {\n\t\t\tthis.queuePosition = undefined;\n\t\t\tthis.targetPosition = targetPosition;\n\t\t\tthis.resetSolver();\n\t\t}\n\t}\n\tgetCurrentPosition() {\n\t\treturn this.currentPosition;\n\t}\n}\n\nfunction solveSpring(\n\tfrom: number,\n\tvelocity: number,\n\tto: number,\n\tdelay: seconds = 0,\n\tparams?: Partial<SpringParams>,\n): (t: seconds) => number {\n\tconst soft = params?.soft ?? false;\n\tconst stiffness = params?.stiffness ?? 100;\n\tconst damping = params?.damping ?? 10;\n\tconst mass = params?.mass ?? 1;\n\tconst delta = to - from;\n\tif (soft || 1.0 <= damping / (2.0 * Math.sqrt(stiffness * mass))) {\n\t\tconst angular_frequency = -Math.sqrt(stiffness / mass);\n\t\tconst leftover = -angular_frequency * delta - velocity;\n\t\treturn (t: seconds) => {\n\t\t\tt -= delay;\n\t\t\tif (t < 0) return from;\n\t\t\treturn to - (delta + t * leftover) * Math.E ** (t * angular_frequency);\n\t\t};\n\t} else {\n\t\tconst damping_frequency = Math.sqrt(\n\t\t\t4.0 * mass * stiffness - damping ** 2.0,\n\t\t);\n\t\tconst leftover =\n\t\t\t(damping * delta - 2.0 * mass * velocity) / damping_frequency;\n\t\tconst dfm = (0.5 * damping_frequency) / mass;\n\t\tconst dm = -(0.5 * damping) / mass;\n\t\treturn (t: seconds) => {\n\t\t\tt -= delay;\n\t\t\tif (t < 0) return from;\n\t\t\treturn (\n\t\t\t\tto -\n\t\t\t\t(Math.cos(t * dfm) * delta + Math.sin(t * dfm) * leftover) *\n\t\t\t\t\tMath.E ** (t * dm)\n\t\t\t);\n\t\t};\n\t}\n}\n\nfunction derivative(f: (x: number) => number) {\n\tconst h = 0.001;\n\treturn (x: number) => (f(x + h) - f(x - h)) / (2 * h);\n}\n\nfunction getVelocity(f: (t: seconds) => number): (t: seconds) => number {\n\treturn derivative(f);\n}\n","import { LyricPlayer } from \".\";\nimport { Disposable, HasElement } from \"../interfaces\";\nimport { Spring } from \"../utils/spring\";\n\nexport class BottomLineEl implements HasElement, Disposable {\n\tprivate element: HTMLElement = document.createElement(\"div\");\n\tprivate left = 0;\n\tprivate top = 0;\n\tprivate delay = 0;\n\t// 由 LyricPlayer 来设置\n\tlineSize: number[] = [0, 0];\n\treadonly lineTransforms = {\n\t\tposX: new Spring(0),\n\t\tposY: new Spring(0),\n\t};\n\tconstructor(private lyricPlayer: LyricPlayer) {\n\t\tthis.element.setAttribute(\n\t\t\t\"class\",\n\t\t\tthis.lyricPlayer.style.classes.lyricLine,\n\t\t);\n\t\tthis.rebuildStyle();\n\t}\n\tmeasureSize(): [number, number] {\n\t\tconst size: [number, number] = [\n\t\t\tthis.element.clientWidth,\n\t\t\tthis.element.clientHeight,\n\t\t];\n\t\treturn size;\n\t}\n\tprivate lastStyle = \"\";\n\tshow() {\n\t\tthis.rebuildStyle();\n\t}\n\thide() {\n\t\tthis.rebuildStyle();\n\t}\n\trebuildStyle() {\n\t\tlet style = `transform:translate(${this.lineTransforms.posX.getCurrentPosition()}px,${this.lineTransforms.posY.getCurrentPosition()}px);`;\n\t\tif (!this.lyricPlayer.getEnableSpring() && this.isInSight) {\n\t\t\tstyle += `transition-delay:${this.delay}ms;`;\n\t\t}\n\t\tif (style !== this.lastStyle) {\n\t\t\tthis.lastStyle = style;\n\t\t\tthis.element.setAttribute(\"style\", style);\n\t\t}\n\t}\n\tgetElement() {\n\t\treturn this.element;\n\t}\n\tsetTransform(\n\t\tleft: number = this.left,\n\t\ttop: number = this.top,\n\t\tforce = false,\n\t\tdelay = 0,\n\t) {\n\t\tthis.left = left;\n\t\tthis.top = top;\n\t\tthis.delay = (delay * 1000) | 0;\n\t\tif (force || !this.lyricPlayer.getEnableSpring()) {\n\t\t\tif (force)\n\t\t\t\tthis.element.classList.add(\n\t\t\t\t\tthis.lyricPlayer.style.classes.tmpDisableTransition,\n\t\t\t\t);\n\t\t\tthis.lineTransforms.posX.setPosition(left);\n\t\t\tthis.lineTransforms.posY.setPosition(top);\n\t\t\tif (!this.lyricPlayer.getEnableSpring()) this.show();\n\t\t\telse this.rebuildStyle();\n\t\t\tif (force)\n\t\t\t\trequestAnimationFrame(() => {\n\t\t\t\t\tthis.element.classList.remove(\n\t\t\t\t\t\tthis.lyricPlayer.style.classes.tmpDisableTransition,\n\t\t\t\t\t);\n\t\t\t\t});\n\t\t} else {\n\t\t\tthis.lineTransforms.posX.setTargetPosition(left, delay);\n\t\t\tthis.lineTransforms.posY.setTargetPosition(top, delay);\n\t\t}\n\t}\n\tupdate(delta = 0) {\n\t\tif (!this.lyricPlayer.getEnableSpring()) return;\n\t\tthis.lineTransforms.posX.update(delta);\n\t\tthis.lineTransforms.posY.update(delta);\n\t\tif (this.isInSight) {\n\t\t\tthis.show();\n\t\t} else {\n\t\t\tthis.hide();\n\t\t}\n\t}\n\tget isInSight() {\n\t\tconst l = this.lineTransforms.posX.getCurrentPosition();\n\t\tconst t = this.lineTransforms.posY.getCurrentPosition();\n\t\tconst r = l + this.lineSize[0];\n\t\tconst b = t + this.lineSize[1];\n\t\tconst pl = this.lyricPlayer.pos[0];\n\t\tconst pt = this.lyricPlayer.pos[1];\n\t\tconst pr = this.lyricPlayer.pos[0] + this.lyricPlayer.size[0];\n\t\tconst pb = this.lyricPlayer.pos[1] + this.lyricPlayer.size[1];\n\t\treturn !(l > pr || t > pb || r < pl || b < pt);\n\t}\n\tdispose(): void {\n\t\tthis.element.remove();\n\t}\n}\n","import { LyricPlayer } from \".\";\nimport type { Disposable, HasElement } from \"../interfaces\";\n\nfunction easeInOutBack(x: number): number {\n\tconst c1 = 1.70158;\n\tconst c2 = c1 * 1.525;\n\n\treturn x < 0.5\n\t\t? (Math.pow(2 * x, 2) * ((c2 + 1) * 2 * x - c2)) / 2\n\t\t: (Math.pow(2 * x - 2, 2) * ((c2 + 1) * (x * 2 - 2) + c2) + 2) / 2;\n}\n\nconst clamp = (min: number, cur: number, max: number) =>\n\tMath.max(min, Math.min(cur, max));\n\nexport class InterludeDots implements HasElement, Disposable {\n\tprivate element: HTMLElement = document.createElement(\"div\");\n\tprivate dot0: HTMLElement = document.createElement(\"span\");\n\tprivate dot1: HTMLElement = document.createElement(\"span\");\n\tprivate dot2: HTMLElement = document.createElement(\"span\");\n\tprivate left = 0;\n\tprivate top = 0;\n\tprivate scale = 1;\n\tprivate lastStyle = \"\";\n\tprivate currentInterlude?: [number, number];\n\tprivate currentTime = 0;\n\tprivate targetBreatheDuration = 1500;\n\tconstructor(private readonly lyricPlayer: LyricPlayer) {\n\t\tthis.element.className = this.lyricPlayer.style.classes.interludeDots;\n\t\tthis.element.appendChild(this.dot0);\n\t\tthis.element.appendChild(this.dot1);\n\t\tthis.element.appendChild(this.dot2);\n\t}\n\tgetElement() {\n\t\treturn this.element;\n\t}\n\tsetTransform(left: number = this.left, top: number = this.top) {\n\t\tthis.left = left;\n\t\tthis.top = top;\n\t\tthis.update();\n\t}\n\tsetInterlude(interlude?: [number, number]) {\n\t\tthis.currentInterlude = interlude;\n\t\tthis.currentTime = interlude?.[0] ?? 0;\n\t}\n\tupdate(delta = 0) {\n\t\tthis.currentTime += delta;\n\t\tlet curStyle = \"\";\n\n\t\tcurStyle += `transform:translate(${this.left}px, ${this.top}px)`;\n\n\t\t// 计算缩放大小\n\n\t\tif (this.currentInterlude) {\n\t\t\tconst interludeDuration =\n\t\t\t\tthis.currentInterlude[1] - this.currentInterlude[0];\n\t\t\tconst currentDuration = this.currentTime - this.currentInterlude[0];\n\t\t\tif (currentDuration <= interludeDuration) {\n\t\t\t\tconst breatheDuration =\n\t\t\t\t\tinterludeDuration /\n\t\t\t\t\tMath.ceil(interludeDuration / this.targetBreatheDuration);\n\t\t\t\tlet scale = 1;\n\t\t\t\tlet globalOpacity = 1;\n\n\t\t\t\tscale *=\n\t\t\t\t\tMath.sin(1.5 * Math.PI - (currentDuration / breatheDuration) * 2) /\n\t\t\t\t\t\t10 +\n\t\t\t\t\t1;\n\n\t\t\t\tif (currentDuration < 1000) {\n\t\t\t\t\tscale *= 1 - Math.pow((1000 - currentDuration) / 1000, 2);\n\t\t\t\t}\n\n\t\t\t\tif (currentDuration < 500) {\n\t\t\t\t\tglobalOpacity = 0;\n\t\t\t\t} else if (currentDuration < 1000) {\n\t\t\t\t\tglobalOpacity *= (currentDuration - 500) / 500;\n\t\t\t\t}\n\n\t\t\t\tif (interludeDuration - currentDuration < 750) {\n\t\t\t\t\tscale *=\n\t\t\t\t\t\t1 -\n\t\t\t\t\t\teaseInOutBack(\n\t\t\t\t\t\t\t(750 - (interludeDuration - currentDuration)) / 750 / 2,\n\t\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tif (interludeDuration - currentDuration < 375) {\n\t\t\t\t\tglobalOpacity *= clamp(\n\t\t\t\t\t\t0,\n\t\t\t\t\t\t(interludeDuration - currentDuration) / 375,\n\t\t\t\t\t\t1,\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tscale = Math.max(0, scale);\n\n\t\t\t\tcurStyle += ` scale(${scale})`;\n\n\t\t\t\tconst dot0Opacity = clamp(\n\t\t\t\t\t0.25,\n\t\t\t\t\t((currentDuration * 3) / interludeDuration) * 0.75,\n\t\t\t\t\t1,\n\t\t\t\t);\n\t\t\t\tconst dot1Opacity = clamp(\n\t\t\t\t\t0.25,\n\t\t\t\t\t(((currentDuration - interludeDuration / 3) * 3) /\n\t\t\t\t\t\tinterludeDuration) *\n\t\t\t\t\t\t0.75,\n\t\t\t\t\t1,\n\t\t\t\t);\n\t\t\t\tconst dot2Opacity = clamp(\n\t\t\t\t\t0.25,\n\t\t\t\t\t(((currentDuration - (interludeDuration / 3) * 2) * 3) /\n\t\t\t\t\t\tinterludeDuration) *\n\t\t\t\t\t\t0.75,\n\t\t\t\t\t1,\n\t\t\t\t);\n\n\t\t\t\tthis.dot0.style.opacity = `${clamp(\n\t\t\t\t\t0,\n\t\t\t\t\tMath.max(0, globalOpacity * dot0Opacity),\n\t\t\t\t\t1,\n\t\t\t\t)}`;\n\t\t\t\tthis.dot1.style.opacity = `${clamp(\n\t\t\t\t\t0,\n\t\t\t\t\tMath.max(0, globalOpacity * dot1Opacity),\n\t\t\t\t\t1,\n\t\t\t\t)}`;\n\t\t\t\tthis.dot2.style.opacity = `${clamp(\n\t\t\t\t\t0,\n\t\t\t\t\tMath.max(0, globalOpacity * dot2Opacity),\n\t\t\t\t\t1,\n\t\t\t\t)}`;\n\t\t\t} else {\n\t\t\t\tcurStyle += \" scale(0)\";\n\t\t\t\tthis.dot0.style.opacity = \"0\";\n\t\t\t\tthis.dot1.style.opacity = \"0\";\n\t\t\t\tthis.dot2.style.opacity = \"0\";\n\t\t\t}\n\t\t} else {\n\t\t\tcurStyle += \" scale(0)\";\n\t\t\tthis.dot0.style.opacity = \"0\";\n\t\t\tthis.dot1.style.opacity = \"0\";\n\t\t\tthis.dot2.style.opacity = \"0\";\n\t\t}\n\n\t\tcurStyle += \";\";\n\n\t\tif (this.lastStyle !== curStyle) {\n\t\t\tthis.element.setAttribute(\"style\", curStyle);\n\t\t\tthis.lastStyle = curStyle;\n\t\t}\n\t}\n\tdispose() {\n\t\tthis.element.remove();\n\t}\n}\n","import { LyricPlayer } from \".\";\nimport { Disposable, HasElement, LyricLine, LyricWord } from \"../interfaces\";\nimport { Spring } from \"../utils/spring\";\n\nconst CJKEXP = /^[\\p{Unified_Ideograph}\\u0800-\\u9FFC]+$/u;\n\ninterface RealWord extends LyricWord {\n\telements: HTMLSpanElement[];\n\telementAnimations: Animation[];\n\twidth: number;\n\theight: number;\n\tshouldEmphasize: boolean;\n}\n\nfunction generateFadeGradient(\n\twidth: number,\n\tbright = \"rgba(0,0,0,1)\",\n\tdark = \"rgba(0,0,0,0.5)\",\n): [string, number, number] {\n\tconst totalAspect = 2 + width;\n\tconst widthInTotal = width / totalAspect;\n\tconst leftPos = (1 - widthInTotal) / 2;\n\treturn [\n\t\t`linear-gradient(to right,${bright} ${leftPos * 100}%,${dark} ${\n\t\t\t(leftPos + widthInTotal) * 100\n\t\t}%)`,\n\t\twidthInTotal,\n\t\ttotalAspect,\n\t];\n}\n\n// 果子在对辉光效果的解释是一种强调(emphasized)效果\n// 条件是一个单词时长大于等于 1s 且长度小于等于 7\nexport function shouldEmphasize(word: LyricWord): boolean {\n\treturn word.endTime - word.startTime >= 1000 && word.word.length <= 7;\n}\n\nexport class LyricLineEl implements HasElement, Disposable {\n\tprivate element: HTMLElement = document.createElement(\"div\");\n\tprivate left = 0;\n\tprivate top = 0;\n\tprivate scale = 1;\n\tprivate blur = 0;\n\tprivate delay = 0;\n\tprivate splittedWords: RealWord[] = [];\n\t// 由 LyricPlayer 来设置\n\tlineSize: number[] = [0, 0];\n\treadonly lineTransforms = {\n\t\tposX: new Spring(0),\n\t\tposY: new Spring(0),\n\t\tscale: new Spring(1),\n\t};\n\tconstructor(\n\t\tprivate lyricPlayer: LyricPlayer,\n\t\tprivate lyricLine: LyricLine = {\n\t\t\twords: [],\n\t\t\ttranslatedLyric: \"\",\n\t\t\tromanLyric: \"\",\n\t\t\tstartTime: 0,\n\t\t\tendTime: 0,\n\t\t\tisBG: false,\n\t\t\tisDuet: false,\n\t\t},\n\t) {\n\t\tthis.element.setAttribute(\n\t\t\t\"class\",\n\t\t\tthis.lyricPlayer.style.classes.lyricLine,\n\t\t);\n\t\tif (this.lyricLine.isBG) {\n\t\t\tthis.element.classList.add(this.lyricPlayer.style.classes.lyricBgLine);\n\t\t}\n\t\tif (this.lyricLine.isDuet) {\n\t\t\tthis.element.classList.add(this.lyricPlayer.style.classes.lyricDuetLine);\n\t\t}\n\t\tthis.element.appendChild(document.createElement(\"div\")); // 歌词行\n\t\tthis.element.appendChild(document.createElement(\"div\")); // 翻译行\n\t\tthis.element.appendChild(document.createElement(\"div\")); // 音译行\n\t\tconst main = this.element.children[0] as HTMLDivElement;\n\t\tconst trans = this.element.children[1] as HTMLDivElement;\n\t\tconst roman = this.element.children[2] as HTMLDivElement;\n\t\tmain.setAttribute(\"class\", this.lyricPlayer.style.classes.lyricMainLine);\n\t\ttrans.setAttribute(\"class\", this.lyricPlayer.style.classes.lyricSubLine);\n\t\troman.setAttribute(\"class\", this.lyricPlayer.style.classes.lyricSubLine);\n\t\tthis.rebuildElement();\n\t\tthis.rebuildStyle();\n\t}\n\tprivate isEnabled = false;\n\tenable() {\n\t\tthis.isEnabled = true;\n\t\tthis.element.classList.add(\"active\");\n\t\tconst main = this.element.children[0] as HTMLDivElement;\n\t\tthis.splittedWords.forEach((word) => {\n\t\t\tword.elementAnimations.forEach((a) => {\n\t\t\t\ta.currentTime = 0;\n\t\t\t\ta.playbackRate = 1;\n\t\t\t\ta.play();\n\t\t\t});\n\t\t});\n\t\tmain.classList.add(\"active\");\n\t}\n\tmeasureSize(): [number, number] {\n\t\tif (this._hide) {\n\t\t\tthis.element.style.display = \"\";\n\t\t\tthis.element.style.visibility = \"hidden\";\n\t\t}\n\t\tconst size: [number, number] = [\n\t\t\tthis.element.clientWidth,\n\t\t\tthis.element.clientHeight,\n\t\t];\n\t\tif (this._hide) {\n\t\t\tthis.element.style.display = \"none\";\n\t\t\tthis.element.style.visibility = \"\";\n\t\t}\n\t\treturn size;\n\t}\n\tdisable() {\n\t\tthis.isEnabled = false;\n\t\tthis.element.classList.remove(\"active\");\n\t\tconst main = this.element.children[0] as HTMLDivElement;\n\t\tthis.splittedWords.forEach((word) => {\n\t\t\tword.elementAnimations.forEach((a) => {\n\t\t\t\tif (a.id === \"float-word\") {\n\t\t\t\t\ta.playbackRate = -1;\n\t\t\t\t\ta.play();\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t\tmain.classList.remove(\"active\");\n\t}\n\tsetLine(line: LyricLine) {\n\t\tthis.lyricLine = line;\n\t\tif (this.lyricLine.isBG) {\n\t\t\tthis.element.classList.add(this.lyricPlayer.style.classes.lyricBgLine);\n\t\t} else {\n\t\t\tthis.element.classList.remove(this.lyricPlayer.style.classes.lyricBgLine);\n\t\t}\n\t\tif (this.lyricLine.isDuet) {\n\t\t\tthis.element.classList.add(this.lyricPlayer.style.classes.lyricDuetLine);\n\t\t} else {\n\t\t\tthis.element.classList.remove(\n\t\t\t\tthis.lyricPlayer.style.classes.lyricDuetLine,\n\t\t\t);\n\t\t}\n\t\tthis.rebuildElement();\n\t\tthis.rebuildStyle();\n\t}\n\tgetLine() {\n\t\treturn this.lyricLine;\n\t}\n\tprivate _hide = true;\n\tprivate lastStyle = \"\";\n\tshow() {\n\t\tthis._hide = false;\n\t\tthis.rebuildStyle();\n\t}\n\thide() {\n\t\tthis._hide = true;\n\t\tthis.rebuildStyle();\n\t}\n\trebuildStyle() {\n\t\tif (this._hide) {\n\t\t\tif (this.lastStyle !== \"display:none;transform:translate(0,-10000px);\") {\n\t\t\t\tthis.lastStyle = \"display:none;transform:translate(0,-10000px);\";\n\t\t\t\tthis.element.setAttribute(\n\t\t\t\t\t\"style\",\n\t\t\t\t\t\"display:none;transform:translate(0,-10000px);\",\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tlet style = `transform:translate(${this.lineTransforms.posX.getCurrentPosition()}px,${this.lineTransforms.posY.getCurrentPosition()}px) scale(${this.lineTransforms.scale.getCurrentPosition()});`;\n\t\tif (!this.lyricPlayer.getEnableSpring() && this.isInSight) {\n\t\t\tstyle += `transition-delay:${this.delay}ms;`;\n\t\t}\n\t\tstyle += `filter:blur(${Math.min(32, this.blur)}px);`;\n\t\tif (style !== this.lastStyle) {\n\t\t\tthis.lastStyle = style;\n\t\t\tthis.element.setAttribute(\"style\", style);\n\t\t}\n\t}\n\trebuildElement() {\n\t\tconst main = this.element.children[0] as HTMLDivElement;\n\t\tconst trans = this.element.children[1] as HTMLDivElement;\n\t\tconst roman = this.element.children[2] as HTMLDivElement;\n\t\tif (this.lyricPlayer._getIsNonDynamic()) {\n\t\t\twhile (main.firstChild) {\n\t\t\t\tmain.removeChild(main.firstChild);\n\t\t\t\tcollectNodes(main.firstChild);\n\t\t\t}\n\t\t\tmain.innerText = this.lyricLine.words.map((w) => w.word).join(\"\");\n\t\t\ttrans.innerText = this.lyricLine.translatedLyric;\n\t\t\troman.innerText = this.lyricLine.romanLyric;\n\t\t\treturn;\n\t\t}\n\t\tthis.splittedWords = [];\n\t\tthis.lyricLine.words.forEach((word) => {\n\t\t\tconst splited = word.word.split(/\\s+/);\n\t\t\tconst trimmedLength = splited.reduce((pv, cv) => pv + cv.length, 0);\n\t\t\tlet pos = 0;\n\t\t\tsplited.forEach((sub, i) => {\n\t\t\t\tif (i > 0) {\n\t\t\t\t\tthis.splittedWords.push({\n\t\t\t\t\t\tword: \" \",\n\t\t\t\t\t\tstartTime: 0,\n\t\t\t\t\t\tendTime: 0,\n\t\t\t\t\t\twidth: 0,\n\t\t\t\t\t\theight: 0,\n\t\t\t\t\t\telements: [],\n\t\t\t\t\t\telementAnimations: [],\n\t\t\t\t\t\tshouldEmphasize: false,\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tthis.splittedWords.push({\n\t\t\t\t\tword: sub,\n\t\t\t\t\tstartTime:\n\t\t\t\t\t\tword.startTime +\n\t\t\t\t\t\t((word.endTime - word.startTime) / trimmedLength) * pos,\n\t\t\t\t\tendTime:\n\t\t\t\t\t\tword.startTime +\n\t\t\t\t\t\t((word.endTime - word.startTime) / trimmedLength) *\n\t\t\t\t\t\t\t(pos + sub.length),\n\t\t\t\t\twidth: 0,\n\t\t\t\t\theight: 0,\n\t\t\t\t\telements: [],\n\t\t\t\t\telementAnimations: [],\n\t\t\t\t\tshouldEmphasize: shouldEmphasize(word),\n\t\t\t\t});\n\t\t\t\tpos += sub.length;\n\t\t\t});\n\t\t});\n\t\t// 回收元素以复用\n\t\tconst reusableElements: HTMLElement[] = [];\n\t\tconst reusableTextNodes: Text[] = [];\n\t\tfunction collectNodes(curNode: Node) {\n\t\t\twhile (curNode.firstChild) {\n\t\t\t\tif (curNode.firstChild.nodeType === Node.ELEMENT_NODE)\n\t\t\t\t\treusableElements.push(main.firstChild as HTMLElement);\n\t\t\t\telse if (curNode.firstChild.nodeType === Node.TEXT_NODE)\n\t\t\t\t\treusableTextNodes.push(main.firstChild as Text);\n\t\t\t\tcurNode.removeChild(curNode.firstChild);\n\t\t\t\tcollectNodes(curNode.firstChild);\n\t\t\t}\n\t\t}\n\t\tcollectNodes(main);\n\t\tlet lastWordEl: HTMLSpanElement | null = null;\n\t\tthis.splittedWords.forEach((word) => {\n\t\t\tif (word.word.trim().length > 0) {\n\t\t\t\tif (word.shouldEmphasize) {\n\t\t\t\t\tconst wordEl =\n\t\t\t\t\t\treusableElements.pop() ?? document.createElement(\"span\");\n\t\t\t\t\twordEl.className = \"emphasize\";\n\t\t\t\t\tword.elements = [wordEl];\n\t\t\t\t\tfor (const c of word.word) {\n\t\t\t\t\t\tconst charEl =\n\t\t\t\t\t\t\treusableElements.pop() ?? document.createElement(\"span\");\n\t\t\t\t\t\tcharEl.className = \"\";\n\t\t\t\t\t\tcharEl.innerText = c;\n\t\t\t\t\t\twordEl.appendChild(charEl);\n\t\t\t\t\t\tword.elements.push(charEl);\n\t\t\t\t\t}\n\t\t\t\t\tword.elementAnimations = this.initEmphasizeAnimation(word);\n\t\t\t\t\tif (lastWordEl && !CJKEXP.test(word.word)) {\n\t\t\t\t\t\tif (lastWordEl.childElementCount > 0) {\n\t\t\t\t\t\t\tlastWordEl.appendChild(wordEl);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tconst wholeWordEl =\n\t\t\t\t\t\t\t\treusableElements.pop() ?? document.createElement(\"span\");\n\t\t\t\t\t\t\twholeWordEl.className = \"\";\n\t\t\t\t\t\t\tlastWordEl.remove();\n\t\t\t\t\t\t\twholeWordEl.appendChild(lastWordEl);\n\t\t\t\t\t\t\twholeWordEl.appendChild(wordEl);\n\t\t\t\t\t\t\tmain.appendChild(wholeWordEl);\n\t\t\t\t\t\t\tlastWordEl = wholeWordEl;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tlastWordEl = CJKEXP.test(word.word) ? null : wordEl;\n\t\t\t\t\t\tmain.appendChild(wordEl);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tconst wordEl =\n\t\t\t\t\t\treusableElements.pop() ?? document.createElement(\"span\");\n\t\t\t\t\twordEl.className = \"\";\n\t\t\t\t\twordEl.innerText = word.word;\n\t\t\t\t\tword.elements = [wordEl];\n\t\t\t\t\tword.elementAnimations.push(this.initFloatAnimation(word, wordEl));\n\t\t\t\t\tif (lastWordEl) {\n\t\t\t\t\t\tif (lastWordEl.childElementCount > 0) {\n\t\t\t\t\t\t\tlastWordEl.appendChild(wordEl);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tconst wholeWordEl =\n\t\t\t\t\t\t\t\treusableElements.pop() ?? document.createElement(\"span\");\n\t\t\t\t\t\t\twholeWordEl.className = \"\";\n\t\t\t\t\t\t\tlastWordEl.remove();\n\t\t\t\t\t\t\twholeWordEl.appendChild(lastWordEl);\n\t\t\t\t\t\t\twholeWordEl.appendChild(wordEl);\n\t\t\t\t\t\t\tmain.appendChild(wholeWordEl);\n\t\t\t\t\t\t\tlastWordEl = wholeWordEl;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tlastWordEl = wordEl;\n\t\t\t\t\t\tmain.appendChild(wordEl);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (word.word.length > 0) {\n\t\t\t\tconst wordEl = reusableTextNodes.pop() ?? document.createTextNode(\" \");\n\t\t\t\tmain.appendChild(wordEl);\n\t\t\t\tlastWordEl = null;\n\t\t\t} else {\n\t\t\t\tlastWordEl = null;\n\t\t\t}\n\t\t});\n\t\ttrans.innerText = this.lyricLine.translatedLyric;\n\t\troman.innerText = this.lyricLine.romanLyric;\n\t}\n\tprivate initFloatAnimation(word: LyricWord, wordEl: HTMLSpanElement) {\n\t\tconst delay = word.startTime - this.lyricLine.startTime;\n\t\tconst duration = Math.max(1000, word.endTime - word.startTime);\n\t\tconst a = wordEl.animate(\n\t\t\t[\n\t\t\t\t{\n\t\t\t\t\ttransform: \"translateY(0px)\",\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\ttransform: \"translateY(-3%)\",\n\t\t\t\t},\n\t\t\t],\n\t\t\t{\n\t\t\t\tduration: isFinite(duration) ? duration : 0,\n\t\t\t\tdelay: isFinite(delay) ? delay : 0,\n\t\t\t\tid: \"float-word\",\n\t\t\t\tcomposite: \"add\",\n\t\t\t\tfill: \"both\",\n\t\t\t},\n\t\t);\n\t\ta.pause();\n\t\treturn a;\n\t}\n\tprivate initEmphasizeAnimation(word: RealWord): Animation[] {\n\t\tconst delay = word.startTime - this.lyricLine.startTime;\n\t\tconst duration = word.endTime - word.startTime;\n\t\treturn word.elements.map((el, i, arr) => {\n\t\t\tif (i === 0) {\n\t\t\t\treturn this.initFloatAnimation(word, el);\n\t\t\t} else {\n\t\t\t\tconst du = Math.max(1000, word.endTime - word.startTime);\n\t\t\t\tconst de = delay + (duration / (arr.length - 1)) * (i - 1);\n\t\t\t\tconst a = el.animate(\n\t\t\t\t\t[\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\toffset: 0,\n\t\t\t\t\t\t\ttransform: \"translate3d(0, 0px, 0px)\",\n\t\t\t\t\t\t\tfilter: \"drop-shadow(0 0 0 var(--amll-lyric-view-color,white))\",\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\toffset: 0.5,\n\t\t\t\t\t\t\ttransform: \"translate3d(0, -2%, 20px)\",\n\t\t\t\t\t\t\tfilter:\n\t\t\t\t\t\t\t\t\"drop-shadow(0 0 0.05em var(--amll-lyric-view-color,white))\",\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\toffset: 1,\n\t\t\t\t\t\t\ttransform: \"translate3d(0, 0px, 0)\",\n\t\t\t\t\t\t\tfilter: \"drop-shadow(0 0 0 var(--amll-lyric-view-color,white))\",\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t\t{\n\t\t\t\t\t\tduration: isFinite(du) ? du : 0,\n\t\t\t\t\t\tdelay: isFinite(de) ? de : 0,\n\t\t\t\t\t\tid: \"glow-word\",\n\t\t\t\t\t\titerations: 1,\n\t\t\t\t\t\tcomposite: \"replace\",\n\t\t\t\t\t\tfill: \"both\",\n\t\t\t\t\t},\n\t\t\t\t);\n\t\t\t\ta.pause();\n\t\t\t\treturn a;\n\t\t\t}\n\t\t});\n\t}\n\tupdateMaskImage() {\n\t\tif (this._hide) {\n\t\t\tthis.element.style.display = \"\";\n\t\t\tthis.element.style.visibility = \"hidden\";\n\t\t}\n\t\tthis.splittedWords.forEach((word) => {\n\t\t\tconst wordEl = word.elements[0];\n\t\t\tif (wordEl) {\n\t\t\t\tword.width = wordEl.clientWidth;\n\t\t\t\tword.height = wordEl.clientHeight;\n\t\t\t\tconst [maskImage, _widthInTotal, totalAspect] = generateFadeGradient(\n\t\t\t\t\t16 / word.width,\n\t\t\t\t\t\"rgba(0,0,0,0.75)\",\n\t\t\t\t\t\"rgba(0,0,0,0.25)\",\n\t\t\t\t);\n\t\t\t\tconst totalAspectStr = `${totalAspect * 100}% 100%`;\n\t\t\t\tif (this.lyricPlayer.supportMaskImage) {\n\t\t\t\t\twordEl.style.maskImage = maskImage;\n\t\t\t\t\twordEl.style.maskOrigin = \"left\";\n\t\t\t\t\twordEl.style.maskSize = totalAspectStr;\n\t\t\t\t} else {\n\t\t\t\t\twordEl.style.webkitMaskImage = maskImage;\n\t\t\t\t\twordEl.style.webkitMaskOrigin = \"left\";\n\t\t\t\t\twordEl.style.webkitMaskSize = totalAspectStr;\n\t\t\t\t}\n\t\t\t\tconst w = word.width + 16;\n\t\t\t\tconst maskPos = `clamp(${-w}px,calc(${-w}px + (var(--amll-player-time) - ${\n\t\t\t\t\tword.startTime\n\t\t\t\t})*${\n\t\t\t\t\tw / Math.abs(word.endTime - word.startTime)\n\t\t\t\t}px),0px) 0px, left top`;\n\t\t\t\t// const maskPos = `clamp(0px,${w}px,${w}px) 0px, left top`;\n\t\t\t\twordEl.style.maskPosition = maskPos;\n\t\t\t\twordEl.style.webkitMaskPosition = maskPos;\n\t\t\t}\n\t\t});\n\t\tif (this._hide) {\n\t\t\tthis.element.style.display = \"none\";\n\t\t\tthis.element.style.visibility = \"\";\n\t\t}\n\t}\n\tgetElement() {\n\t\treturn this.element;\n\t}\n\tsetTransform(\n\t\tleft: number = this.left,\n\t\ttop: number = this.top,\n\t\tscale: number = this.scale,\n\t\topacity = 1,\n\t\tblur = 0,\n\t\tforce = false,\n\t\tdelay = 0,\n\t) {\n\t\tthis.left = left;\n\t\tthis.top = top;\n\t\tthis.scale = scale;\n\t\tthis.delay = (delay * 1000) | 0;\n\t\tconst main = this.element.children[0] as HTMLDivElement;\n\t\tmain.style.opacity = `${opacity}`;\n\t\tif (force || !this.lyricPlayer.getEnableSpring()) {\n\t\t\tthis.blur = Math.min(32, blur);\n\t\t\tif (force)\n\t\t\t\tthis.element.classList.add(\n\t\t\t\t\tthis.lyricPlayer.style.classes.tmpDisableTransition,\n\t\t\t\t);\n\t\t\tthis.lineTransforms.posX.setPosition(left);\n\t\t\tthis.lineTransforms.posY.setPosition(top);\n\t\t\tthis.lineTransforms.scale.setPosition(scale);\n\t\t\tif (!this.lyricPlayer.getEnableSpring()) this.show();\n\t\t\telse this.rebuildStyle();\n\t\t\tif (force)\n\t\t\t\trequestAnimationFrame(() => {\n\t\t\t\t\tthis.element.classList.remove(\n\t\t\t\t\t\tthis.lyricPlayer.style.classes.tmpDisableTransition,\n\t\t\t\t\t);\n\t\t\t\t});\n\t\t} else {\n\t\t\tthis.lineTransforms.posX.setTargetPosition(left, delay);\n\t\t\tthis.lineTransforms.posY.setTargetPosition(top, delay);\n\t\t\tthis.lineTransforms.scale.setTargetPosition(scale);\n\t\t\tif (this.blur !== Math.min(32, blur)) {\n\t\t\t\tthis.blur = Math.min(32, blur);\n\t\t\t\tthis.element.style.filter = `blur(${Math.min(32, blur)}px)`;\n\t\t\t}\n\t\t}\n\t}\n\tupdate(delta = 0) {\n\t\tif (!this.lyricPlayer.getEnableSpring()) return;\n\t\tthis.lineTransforms.posX.update(delta);\n\t\tthis.lineTransforms.posY.update(delta);\n\t\tthis.lineTransforms.scale.update(delta);\n\t\tif (this.isInSight) {\n\t\t\tthis.show();\n\t\t} else {\n\t\t\tthis.hide();\n\t\t}\n\t}\n\tget isInSight() {\n\t\tconst l = this.lineTransforms.posX.getCurrentPosition();\n\t\tconst t = this.lineTransforms.posY.getCurrentPosition();\n\t\tconst r = l + this.lineSize[0];\n\t\tconst b = t + this.lineSize[1];\n\t\tconst pl = this.lyricPlayer.pos[0];\n\t\tconst pt = this.lyricPlayer.pos[1];\n\t\tconst pr = this.lyricPlayer.pos[0] + this.lyricPlayer.size[0];\n\t\tconst pb = this.lyricPlayer.pos[1] + this.lyricPlayer.size[1];\n\t\treturn !(l > pr || t > pb || r < pl || b < pt);\n\t}\n\tdispose(): void {\n\t\tthis.element.remove();\n\t}\n}\n","/**\n * @fileoverview\n * 一个播放歌词的组件\n * @author SteveXMH\n */\n\nimport type { Disposable, HasElement, LyricLine } from \"../interfaces\";\nimport { eqSet } from \"../utils/eq-set\";\nimport { SpringParams } from \"../utils/spring\";\nimport { BottomLineEl } from \"./bottom-line\";\nimport { InterludeDots } from \"./interlude-dots\";\nimport { LyricLineEl, shouldEmphasize } from \"./lyric-line\";\nimport { create } from \"jss\";\nimport preset from \"jss-preset-default\";\n\nconst jss = create(preset());\n\nexport class LyricLineClickedEvent extends MouseEvent {}\n\n/**\n * 歌词播放组件,本框架的核心组件\n *\n * 尽可能贴切 Apple Music for iPad 的歌词效果设计,且做了力所能及的优化措施\n */\nexport class LyricPlayer extends EventTarget implements HasElement, Disposable {\n\tprivate element: HTMLElement = document.createElement(\"div\");\n\tprivate currentTime = 0;\n\tprivate lyricLines: LyricLine[] = [];\n\tprivate processedLines: LyricLine[] = [];\n\tprivate lyricLinesEl: LyricLineEl[] = [];\n\tprivate lyricLinesSize: Map<LyricLineEl, [number, number]> = new Map();\n\tprivate hotLines: Set<number> = new Set();\n\tprivate bufferedLines: Set<number> = new Set();\n\tprivate scrollToIndex = 0;\n\tprivate allowScroll = true;\n\tprivate scrolledHandler = 0;\n\tprivate isScrolled = false;\n\tprivate invokedByScrollEvent = false;\n\tprivate scrollOffset = 0;\n\tprivate resizeObserver: ResizeObserver = new ResizeObserver((e) => {\n\t\tconst rect = e[0].contentRect;\n\t\tthis.size[0] = rect.width;\n\t\tthis.size[1] = rect.height;\n\t\tthis.pos[0] = rect.left;\n\t\tthis.pos[1] = rect.top;\n\t\tconst styles = getComputedStyle(e[0].target);\n\t\tconst innerWidth =\n\t\t\tthis.element.clientWidth -\n\t\t\tparseFloat(styles.paddingLeft) -\n\t\t\tparseFloat(styles.paddingRight);\n\t\tconst innerHeight =\n\t\t\tthis.element.clientHeight -\n\t\t\tparseFloat(styles.paddingTop) -\n\t\t\tparseFloat(styles.paddingBottom);\n\t\tthis.innerSize[0] = innerWidth;\n\t\tthis.innerSize[1] = innerHeight;\n\t\tthis.rebuildStyle();\n\t\tthis.calcLayout(true, true);\n\t\tthis.lyricLinesEl.forEach((el) => el.updateMaskImage());\n\t});\n\tprivate posXSpringParams: Partial<SpringParams> = {\n\t\tmass: 1,\n\t\tdamping: 10,\n\t\tstiffness: 100,\n\t};\n\tprivate posYSpringParams: Partial<SpringParams> = {\n\t\tmass: 1,\n\t\tdamping: 15,\n\t\tstiffness: 100,\n\t};\n\tprivate scaleSpringParams: Partial<SpringParams> = {\n\t\tmass: 1,\n\t\tdamping: 20,\n\t\tstiffness: 100,\n\t};\n\tprivate enableBlur = true;\n\tprivate interludeDots: InterludeDots;\n\tprivate interludeDotsSize: [number, number] = [0, 0];\n\tprivate bottomLine: BottomLineEl;\n\treadonly supportPlusLighter = CSS.supports(\"mix-blend-mode\", \"plus-lighter\");\n\treadonly supportMaskImage = CSS.supports(\"mask-image\", \"none\");\n\tprivate disableSpring = false;\n\tprivate alignAnchor: \"top\" | \"bottom\" | \"center\" = \"center\";\n\tprivate alignPosition = 0.5;\n\tprivate isNonDynamic = false;\n\treadonly size: [number, number] = [0, 0];\n\treadonly innerSize: [number, number] = [0, 0];\n\treadonly pos: [number, number] = [0, 0];\n\t_getIsNonDynamic() {\n\t\treturn this.isNonDynamic;\n\t}\n\t/**\n\t * 设置是否使用物理弹簧算法实现歌词动画效果,默认启用\n\t *\n\t * 如果启用,则会通过弹簧算法实时处理歌词位置,但是需要性能足够强劲的电脑方可流畅运行\n\t *\n\t * 如果不启用,则会回退到基于 `transition` 的过渡效果,对低性能的机器比较友好,但是效果会比较单一\n\t */\n\tsetEnableSpring(enable = true) {\n\t\tthis.disableSpring = !enable;\n\t\tif (enable) {\n\t\t\tthis.element.classList.remove(this.style.classes.disableSpring);\n\t\t} else {\n\t\t\tthis.element.classList.add(this.style.classes.disableSpring);\n\t\t}\n\t\tthis.calcLayout(true);\n\t}\n\t/**\n\t * 获取当前是否启用了物理弹簧\n\t * @returns 是否启用物理弹簧\n\t */\n\tgetEnableSpring() {\n\t\treturn !this.disableSpring;\n\t}\n\tpublic readonly style = jss.createStyleSheet({\n\t\tlyricPlayer: {\n\t\t\tuserSelect: \"none\",\n\t\t\tfontSize: \"var(--amll-lyric-player-font-size,max(5vh, 12px))\",\n\t\t\tpadding: \"1em\",\n\t\t\tmargin: \"-1em\",\n\t\t\twidth: \"100%\",\n\t\t\theight: \"100%\",\n\t\t\toverflow: \"hidden\",\n\t\t\tmaxWidth: \"100%\",\n\t\t\tmaxHeight: \"100%\",\n\t\t\tzIndex: 1,\n\t\t\tcolor: \"var(--amll-lyric-view-color,white)\",\n\t\t\tmixBlendMode: \"plus-lighter\",\n\t\t\tcontain: \"strict\",\n\t\t},\n\t\tlyricLine: {\n\t\t\tposition: \"absolute\",\n\t\t\ttransformOrigin: \"left\",\n\t\t\tmaxWidth: \"var(--amll-lyric-player-width,100%)\",\n\t\t\tminWidth: \"var(--amll-lyric-player-width,100%)\",\n\t\t\twidth: \"var(--amll-lyric-player-width,100%)\",\n\t\t\tpadding: \"2vh 0.05em\",\n\t\t\tcontain: \"content\",\n\t\t\twillChange: \"filter,transform,opacity\",\n\t\t\ttransition: \"filter 0.25s\",\n\t\t\tboxSizing: \"border-box\",\n\t\t},\n\t\t\"@media (max-width: 1024px)\": {\n\t\t\tlyricLine: {\n\t\t\t\tpadding: \"1vh 0\",\n\t\t\t},\n\t\t},\n\t\tlyricDuetLine: {\n\t\t\ttextAlign: \"right\",\n\t\t\ttransformOrigin: \"right\",\n\t\t},\n\t\tlyricBgLine: {\n\t\t\topacity: 0,\n\t\t\tfontSize: \"max(50%, 10px)\",\n\t\t\ttransition: \"opacity 0.25s\",\n\t\t\t\"&.active\": {\n\t\t\t\ttransition: \"opacity 0.25s 0.25s\",\n\t\t\t\topacity: 0.75,\n\t\t\t},\n\t\t},\n\t\tlyricMainLine: {\n\t\t\ttransition: \"opacity 0.3s 0.25s\",\n\t\t\twillChange: \"opacity\",\n\t\t\tmargin: \"-1em\",\n\t\t\tpadding: \"1em\",\n\t\t\t\"& span\": {\n\t\t\t\tdisplay: \"inline-block\",\n\t\t\t},\n\t\t\t\"& > span\": {\n\t\t\t\twhiteSpace: \"pre-wrap\",\n\t\t\t\twordBreak: \"keep-all\",\n\t\t\t\tmaxLines: \"1\",\n\t\t\t\t// willChange: \"transform,display,mask-image\",\n\t\t\t\t\"&.emphasize\": {\n\t\t\t\t\ttransformStyle: \"preserve-3d\",\n\t\t\t\t\tperspective: \"50vw\",\n\t\t\t\t\tpadding: \"1em\",\n\t\t\t\t\tmargin: \"-1em\",\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tlyricSubLine: {\n\t\t\tfontSize: \"max(50%, 10px)\",\n\t\t\topacity: 0.5,\n\t\t},\n\t\tdisableSpring: {\n\t\t\t\"& > *\": {\n\t\t\t\ttransition: \"filter 0.25s, transform 0.5s\",\n\t\t\t},\n\t\t},\n\t\tinterludeDots: {\n\t\t\theight: \"clamp(0.5em,1vh,3em)\",\n\t\t\ttransformOrigin: \"center\",\n\t\t\twidth: \"fit-content\",\n\t\t\tpadding: \"2.5% 0\",\n\t\t\tposition: \"absolute\",\n\t\t\tdisplay: \"flex\",\n\t\t\tgap: \"0.25em\",\n\t\t\tleft: \"1em\",\n\t\t\t\"& > *\": {\n\t\t\t\theight: \"100%\",\n\t\t\t\tdisplay: \"inline-block\",\n\t\t\t\tborderRadius: \"50%\",\n\t\t\t\taspectRatio: \"1 / 1\",\n\t\t\t\tbackgroundColor: \"var(--amll-lyric-view-color,white)\",\n\t\t\t\tmarginRight: \"4px\",\n\t\t\t},\n\t\t\t\"&.duet\": {\n\t\t\t\tright: \"1em\",\n\t\t\t\ttransformOrigin: \"center\",\n\t\t\t},\n\t\t},\n\t\t\"@supports (mix-blend-mode: plus-lighter)\": {\n\t\t\tlyricSubLine: {\n\t\t\t\topacity: 0.3,\n\t\t\t},\n\t\t},\n\t\ttmpDisableTransition: {\n\t\t\ttransition: \"none !important\",\n\t\t},\n\t});\n\tprivate onPageShow = () => {\n\t\tthis.calcLayout(true, true);\n\t};\n\tconstructor() {\n\t\tsuper();\n\t\tthis.interludeDots = new InterludeDots(this);\n\t\tthis.bottomLine = new BottomLineEl(this);\n\t\tthis.element.setAttribute(\"class\", this.style.classes.lyricPlayer);\n\t\tif (this.disableSpring) {\n\t\t\tthis.element.classList.add(this.style.classes.disableSpring);\n\t\t}\n\t\tthis.rebuildStyle();\n\t\tthis.resizeObserver.observe(this.element);\n\t\tthis.element.appendChild(this.interludeDots.getElement());\n\t\tthis.element.appendChild(this.bottomLine.getElement());\n\t\tthis.style.attach();\n\t\tthis.interludeDots.setTransform(0, 200);\n\t\twindow.addEventListener(\"pageshow\", this.onPageShow);\n\t\tthis.element.addEventListener(\"wheel\", (evt) => {\n\t\t\tif (this.allowScroll) {\n\t\t\t\tthis.isScrolled = true;\n\t\t\t\tclearTimeout(this.scrolledHandler);\n\t\t\t\tthis.scrolledHandler = setTimeout(() => {\n\t\t\t\t\tthis.isScrolled = false;\n\t\t\t\t\tthis.scrollOffset = 0;\n\t\t\t\t}, 5000);\n\t\t\t\tthis.invokedByScrollEvent = true;\n\t\t\t\tif (evt.deltaMode === evt.DOM_DELTA_PIXEL) {\n\t\t\t\t\tthis.scrollOffset += evt.deltaY;\n\t\t\t\t\tthis.calcLayout(true);\n\t\t\t\t} else {\n\t\t\t\t\tthis.scrollOffset += evt.deltaY * 50;\n\t\t\t\t\tthis.calcLayout(false);\n\t\t\t\t}\n\t\t\t\tthis.invokedByScrollEvent = false;\n\t\t\t}\n\t\t});\n\t}\n\t/**\n\t * 获取当前播放时间里是否处于间奏区间\n\t * 如果是则会返回单位为毫秒的始末时间\n\t * 否则返回 undefined\n\t *\n\t * 这个只允许内部调用\n\t * @returns [开始时间,结束时间,大概处于的歌词行ID,下一句是否为对唱歌词] 或 undefined 如果不处于间奏区间\n\t */\n\tgetCurrentInterlude(): [number, number, number, boolean] | undefined {\n\t\tif (this.bufferedLines.size > 0) return undefined;\n\t\tconst currentTime = this.currentTime + 20;\n\t\tconst i = this.scrollToIndex;\n\t\tif (i === 0) {\n\t\t\tif (this.processedLines[0]?.startTime) {\n\t\t\t\tif (this.processedLines[0].startTime > currentTime) {\n\t\t\t\t\treturn [\n\t\t\t\t\t\tcurrentTime,\n\t\t\t\t\t\tthis.processedLines[0].startTime,\n\t\t\t\t\t\t-2,\n\t\t\t\t\t\tthis.processedLines[0].isDuet,\n\t\t\t\t\t];\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (\n\t\t\tthis.processedLines[i]?.endTime &&\n\t\t\tthis.processedLines[i + 1]?.startTime\n\t\t) {\n\t\t\tif (\n\t\t\t\tthis.processedLines[i + 1].startTime > currentTime &&\n\t\t\t\tthis.processedLines[i].endTime < currentTime\n\t\t\t) {\n\t\t\t\treturn [\n\t\t\t\t\tMath.max(this.processedLines[i].endTime, currentTime),\n\t\t\t\t\tthis.processedLines[i + 1].startTime,\n\t\t\t\t\ti,\n\t\t\t\t\tthis.processedLines[i + 1].isDuet,\n\t\t\t\t];\n\t\t\t}\n\t\t}\n\t\treturn undefined;\n\t}\n\t/**\n\t * 重建样式\n\t *\n\t * 这个只允许内部调用\n\t */\n\trebuildStyle() {\n\t\tlet style = \"\";\n\t\tstyle += \"--amll-lyric-player-width:\";\n\t\tstyle += this.innerSize[0];\n\t\tstyle += \"px;\";\n\t\tstyle += \"--amll-lyric-player-height:\";\n\t\tstyle += this.innerSize[1];\n\t\tstyle += \"px;\";\n\t\tstyle += \"--amll-player-time:\";\n\t\tstyle += this.currentTime;\n\t\tstyle += \";\";\n\t\tthis.element.setAttribute(\"style\", style);\n\t}\n\t/**\n\t * 设置是否启用歌词行的模糊效果\n\t * @param enable 是否启用\n\t */\n\tsetEnableBlur(enable: boolean) {\n\t\tif (this.enableBlur === enable) return;\n\t\tthis.enableBlur = enable;\n\t\tthis.calcLayout();\n\t}\n\t/**\n\t * 设置当前播放歌词,要注意传入后这个数组内的信息不得修改,否则会发生错误\n\t * @param lines 歌词数组\n\t */\n\tsetLyricLines(lines: LyricLine[]) {\n\t\tthis.lyricLines = lines;\n\t\tconst timeOffset = 750;\n\t\tthis.processedLines = lines\n\t\t\t.filter(\n\t\t\t\t(line) =>\n\t\t\t\t\tline.words.reduce((pv, cv) => pv + cv.word.trim().length, 0) > 0,\n\t\t\t)\n\t\t\t.map((line, i, lines) => {\n\t\t\t\tif (line.isBG)\n\t\t\t\t\treturn {\n\t\t\t\t\t\t...line,\n\t\t\t\t\t};\n\t\t\t\telse {\n\t\t\t\t\tconst lastLine = lines[i - 1];\n\t\t\t\t\tconst pastLine = lines[i - 2];\n\t\t\t\t\tif (lastLine?.isBG && pastLine) {\n\t\t\t\t\t\tif (pastLine.endTime < line.startTime) {\n\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t...line,\n\t\t\t\t\t\t\t\tstartTime:\n\t\t\t\t\t\t\t\t\tMath.max(pastLine.endTime, line.startTime - timeOffset) ||\n\t\t\t\t\t\t\t\t\tline.startTime,\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (lastLine?.endTime) {\n\t\t\t\t\t\tif (lastLine.endTime < line.startTime) {\n\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t...line,\n\t\t\t\t\t\t\t\tstartTime:\n\t\t\t\t\t\t\t\t\tMath.max(lastLine?.endTime, line.startTime - timeOffset) ||\n\t\t\t\t\t\t\t\t\tline.startTime,\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn {\n\t\t\t\t\t\t...line,\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t});\n\t\tthis.isNonDynamic = true;\n\t\tfor (const line of this.processedLines) {\n\t\t\tif (line.words.length > 1) {\n\t\t\t\tthis.isNonDynamic = false;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tthis.processedLines.forEach((line, i, lines) => {\n\t\t\tconst nextLine = lines[i + 1];\n\t\t\tconst lastWord = line.words[line.words.length - 1];\n\t\t\tif (lastWord && shouldEmphasize(lastWord)) {\n\t\t\t\tif (nextLine) {\n\t\t\t\t\tif (nextLine.startTime > line.endTime) {\n\t\t\t\t\t\tline.endTime = Math.min(line.endTime + 1500, nextLine.startTime);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tline.endTime = line.endTime + 1500;\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\tthis.processedLines.forEach((line, i, lines) => {\n\t\t\tif (line.isBG) return;\n\t\t\tconst nextLine = lines[i + 1];\n\t\t\tif (nextLine?.isBG) {\n\t\t\t\tnextLine.startTime = Math.min(nextLine.startTime, line.startTime);\n\t\t\t}\n\t\t});\n\t\tconst prevLinesEl = this.lyricLinesEl;\n\t\tthis.lyricLinesEl = this.processedLines.map((line, i) => {\n\t\t\treturn this.lyricLinesEl[i] ?? new LyricLineEl(this, line);\n\t\t});\n\t\twhile (prevLinesEl.length > this.processedLines.length) {\n\t\t\tprevLinesEl.pop()?.dispose();\n\t\t}\n\t\tthis.lyricLinesEl.forEach((el) => {\n\t\t\tthis.element.appendChild(el.getElement());\n\t\t\tel.updateMaskImage();\n\t\t});\n\t\tthis.interludeDots.setInterlude(undefined);\n\t\tthis.hotLines.clear();\n\t\tthis.bufferedLines.clear();\n\t\tthis.setLinePosXSpringParams({});\n\t\tthis.setLinePosYSpringParams({});\n\t\tthis.setLineScaleSpringParams({});\n\t\tthis.setCurrentTime(0, true);\n\t\tthis.calcLayout(true, true);\n\t}\n\t/**\n\t * 重新布局定位歌词行的位置,调用完成后再逐帧调用 `update`\n\t * 函数即可让歌词通过动画移动到目标位置。\n\t *\n\t * 函数有一个 `force` 参数,用于指定是否强制修改布局,也就是不经过动画直接调整元素位置和大小。\n\t *\n\t * 此函数还有一个 `reflow` 参数,用于指定是否需要重新计算布局\n\t *\n\t * 因为计算布局必定会导致浏览器重排布局,所以会大幅度影响流畅度和性能,故请只在以下情况下将其​设置为 true:\n\t *\n\t * 1. 歌词页面大小发生改变时(这个组件会自行处理)\n\t * 2. 加载了新的歌词时(不论前后歌词是否完全一样)\n\t * 3. 用户自行跳转了歌曲播放位置(不论距离远近)\n\t *\n\t * @param force 是否不经过动画直接修改布局定位\n\t * @param reflow 是否进行重新布局(重新计算每行歌词大小)\n\t */\n\tcalcLayout(force = false, reflow = false) {\n\t\tif (reflow) {\n\t\t\tthis.lyricLinesEl.forEach((el) => {\n\t\t\t\tconst size: [number, number] = el.measureSize();\n\t\t\t\tthis.lyricLinesSize.set(el, size);\n\t\t\t\tel.lineSize = size;\n\t\t\t});\n\t\t\tthis.interludeDotsSize[0] = this.interludeDots.getElement().clientWidth;\n\t\t\tthis.interludeDotsSize[1] = this.interludeDots.getElement().clientHeight;\n\n\t\t\tthis.bottomLine.lineSize = this.bottomLine.measureSize();\n\t\t}\n\t\tconst interlude = this.getCurrentInterlude();\n\t\tlet curPos = -this.scrollOffset;\n\t\tlet targetAlignIndex = this.scrollToIndex;\n\t\tlet interludeDuration = 0;\n\t\tif (interlude) {\n\t\t\tinterludeDuration = interlude[1] - interlude[0];\n\t\t\tif (interludeDuration >= 5000) {\n\t\t\t\tconst nextLine = this.lyricLinesEl[interlude[2] + 1];\n\t\t\t\tif (nextLine) {\n\t\t\t\t\ttargetAlignIndex = interlude[2] + 1;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tthis.interludeDots.setInterlude(undefined);\n\t\t}\n\t\tconst SCALE_ASPECT = 0.95;\n\t\tconst scrollOffset = this.lyricLinesEl\n\t\t\t.slice(0, targetAlignIndex)\n\t\t\t.reduce(\n\t\t\t\t(acc, el) =>\n\t\t\t\t\tacc + (el.getLine().isBG ? 0 : this.lyricLinesSize.get(el)?.[1] ?? 0),\n\t\t\t\t0,\n\t\t\t);\n\t\tcurPos -= scrollOffset;\n\t\tcurPos += this.size[1] * this.alignPosition;\n\t\tconst curLine = this.lyricLinesEl[targetAlignIndex];\n\t\tif (curLine) {\n\t\t\tconst lineHeight = this.lyricLinesSize.get(curLine)?.[1] ?? 0;\n\t\t\tswitch (this.alignAnchor) {\n\t\t\t\tcase \"bottom\":\n\t\t\t\t\tcurPos -= lineHeight;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"center\":\n\t\t\t\t\tcurPos -= lineHeight / 2;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"top\":\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tconst latestIndex = Math.max(...this.bufferedLines);\n\t\tlet delay = 0;\n\t\tlet baseDelay = 0.05;\n\t\tlet setDots = false;\n\t\tthis.lyricLinesEl.forEach((el, i) => {\n\t\t\tconst hasBuffered = this.bufferedLines.has(i);\n\t\t\tconst isActive =\n\t\t\t\thasBuffered || (i >= this.scrollToIndex && i < latestIndex);\n\t\t\tconst line = el.getLine();\n\t\t\tlet left = 0;\n\t\t\tif (line.isDuet) {\n\t\t\t\tleft = this.size[0] - (this.lyricLinesSize.get(el)?.[0] ?? 0);\n\t\t\t}\n\t\t\tif (\n\t\t\t\t!setDots &&\n\t\t\t\tinterludeDuration >= 5000 &&\n\t\t\t\t((i === this.scrollToIndex && interlude?.[2] === -2) ||\n\t\t\t\t\ti === this.scrollToIndex + 1)\n\t\t\t) {\n\t\t\t\tsetDots = true;\n\t\t\t\tthis.interludeDots.setTransform(32, curPos);\n\t\t\t\tif (interlude) {\n\t\t\t\t\tthis.interludeDots.setInterlude([interlude[0], interlude[1]]);\n\t\t\t\t}\n\t\t\t\tcurPos += this.interludeDotsSize[1];\n\t\t\t}\n\t\t\tel.setTransform(\n\t\t\t\t0,\n\t\t\t\tcurPos,\n\t\t\t\tisActive ? 1 : SCALE_ASPECT,\n\t\t\t\thasBuffered ? 1 : 1 / 3,\n\t\t\t\t!this.invokedByScrollEvent && this.enableBlur\n\t\t\t\t\t? isActive\n\t\t\t\t\t\t? 0\n\t\t\t\t\t\t: 1 +\n\t\t\t\t\t\t (i < this.scrollToIndex\n\t\t\t\t\t\t\t\t? Math.abs(this.scrollToIndex - i)\n\t\t\t\t\t\t\t\t: Math.abs(i - Math.max(this.scrollToIndex, latestIndex)))\n\t\t\t\t\t: 0,\n\t\t\t\tforce,\n\t\t\t\tdelay,\n\t\t\t);\n\t\t\tif (line.isBG && isActive) {\n\t\t\t\tcurPos += this.lyricLinesSize.get(el)?.[1] ?? 0;\n\t\t\t} else if (!line.isBG) {\n\t\t\t\tcurPos += this.lyricLinesSize.get(el)?.[1] ?? 0;\n\t\t\t}\n\t\t\tif (curPos >= 0) {\n\t\t\t\tdelay += baseDelay;\n\t\t\t\tbaseDelay /= 1.2;\n\t\t\t}\n\t\t});\n\t\tthis.bottomLine.setTransform(0, curPos, force, delay);\n\t}\n\t/**\n\t * 获取当前歌词的播放位置\n\t *\n\t * 一般和最后调用 `setCurrentTime` 给予的参数一样\n\t * @returns 当前播放位置\n\t */\n\tgetCurrentTime() {\n\t\treturn this.currentTime;\n\t}\n\t/**\n\t * 获取当前歌词数组\n\t *\n\t * 一般和最后调用 `setLyricLines` 给予的参数一样\n\t * @returns 当前歌词数组\n\t */\n\tgetLyricLines() {\n\t\treturn this.lyricLines;\n\t}\n\tgetElement(): HTMLElement {\n\t\treturn this.element;\n\t}\n\t/**\n\t * 获取一个特殊的底栏元素,默认是空白的,可以往内部添加任意元素\n\t *\n\t * 这个元素始终在歌词的底部,可以用于显示歌曲创作者等信息\n\t *\n\t * 但是请勿删除该元素,只能在内部存放元素\n\t *\n\t * @returns 一个元素,可以往内部添加任意元素\n\t */\n\tgetBottomLineElement(): HTMLElement {\n\t\treturn this.bottomLine.getElement();\n\t}\n\t/**\n\t * 设置目标歌词行的对齐方式,默认为 `center`\n\t *\n\t * - 设置成 `top` 的话将会向目标歌词行的顶部对齐\n\t * - 设置成 `bottom` 的话将会向目标歌词行的底部对齐\n\t * - 设置成 `center` 的话将会向目标歌词行的垂直中心对齐\n\t * @param alignAnchor 歌词行对齐方式,详情见函数说明\n\t */\n\tsetAlignAnchor(alignAnchor: \"top\" | \"bottom\" | \"center\") {\n\t\tthis.alignAnchor = alignAnchor;\n\t}\n\t/**\n\t * 设置默认的歌词行对齐位置,相对于整个歌词播放组件的大小位置,默认为 `0.5`\n\t * @param alignPosition 一个 `[0.0-1.0]` 之间的任意数字,代表组件高度由上到下的比例位置\n\t */\n\tsetAlignPosition(alignPosition: number) {\n\t\tthis.alignPosition = alignPosition;\n\t}\n\t/**\n\t * 设置当前播放进度,单位为毫秒且**必须是整数**,此时将会更新内部的歌词进度信息\n\t * 内部会根据调用间隔和播放进度自动决定如何滚动和显示歌词,所以这个的调用频率越快越准确越好\n\t *\n\t * 调用完成后,可以每帧调用 `update` 函数来执行歌词动画效果\n\t * @param time 当前播放进度,单位为毫秒\n\t */\n\tsetCurrentTime(time: number, isSeek = false) {\n\t\t// 我在这里定义了歌词的选择状态:\n\t\t// 普通行:当前不处于时间范围内的歌词行\n\t\t// 热行:当前绝对处于播放时间内的歌词行,且一般会被立刻加入到缓冲行中\n\t\t// 缓冲行:一般处于播放时间后的歌词行,会因为当前播放状态的缘故推迟解除状态\n\n\t\t// 然后我们需要让歌词行为如下:\n\t\t// 如果当前仍有缓冲行的情况下加入新热行,则不会解除当前缓冲行,且也不会修改当前滚动位置\n\t\t// 如果当前所有缓冲行都将被删除且没有新热行加入,则删除所有缓冲行,且也不会修改当前滚动位置\n\t\t// 如果当前所有缓冲行都将被删除且有新热行加入,则删除所有缓冲行并加入新热行作为缓冲行,然后修改当前滚动位置\n\t\tthis.currentTime = time;\n\t\tthis.element.style.setProperty(\"--amll-player-time\", `${time}`);\n\t\tif (this.isScrolled) return;\n\t\tconst removedHotIds = new Set<number>();\n\t\tconst removedIds = new Set<number>();\n\t\tconst addedIds = new Set<number>();\n\n\t\t// 先检索当前已经超出时间范围的缓冲行,列入待删除集内\n\t\tthis.hotLines.forEach((lastHotId) => {\n\t\t\tconst line = this.processedLines[lastHotId];\n\t\t\tif (line) {\n\t\t\t\tif (line.isBG) return;\n\t\t\t\tconst nextLine = this.processedLines[lastHotId + 1];\n\t\t\t\tif (nextLine?.isBG) {\n\t\t\t\t\tconst startTime = Math.min(line.startTime, nextLine?.startTime);\n\t\t\t\t\tconst endTime = Math.max(line.endTime, nextLine?.endTime);\n\t\t\t\t\tif (startTime > time || endTime <= time) {\n\t\t\t\t\t\tthis.hotLines.delete(lastHotId);\n\t\t\t\t\t\tremovedHotIds.add(lastHotId);\n\t\t\t\t\t\tthis.hotLines.delete(lastHotId + 1);\n\t\t\t\t\t\tremovedHotIds.add(lastHotId + 1);\n\t\t\t\t\t\tif (isSeek) {\n\t\t\t\t\t\t\tthis.lyricLinesEl[lastHotId].disable();\n\t\t\t\t\t\t\tthis.lyricLinesEl[lastHotId + 1].disable();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else if (line.startTime > time || line.endTime <= time) {\n\t\t\t\t\tthis.hotLines.delete(lastHotId);\n\t\t\t\t\tremovedHotIds.add(lastHotId);\n\t\t\t\t\tif (isSeek) this.lyricLinesEl[lastHotId].disable();\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tthis.hotLines.delete(lastHotId);\n\t\t\t\tremovedHotIds.add(lastHotId);\n\t\t\t\tif (isSeek) this.lyricLinesEl[lastHotId].disable();\n\t\t\t}\n\t\t});\n\t\tthis.processedLines.forEach((line, id, arr) => {\n\t\t\tif (!line.isBG && line.startTime <= time && line.endTime > time) {\n\t\t\t\tif (!this.hotLines.has(id)) {\n\t\t\t\t\tthis.hotLines.add(id);\n\t\t\t\t\taddedIds.add(id);\n\t\t\t\t\tif (isSeek) this.lyricLinesEl[id].enable();\n\t\t\t\t\tif (arr[id + 1]?.isBG) {\n\t\t\t\t\t\tthis.hotLines.add(id + 1);\n\t\t\t\t\t\taddedIds.add(id + 1);\n\t\t\t\t\t\tif (isSeek) this.lyricLinesEl[id + 1].enable();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\tthis.bufferedLines.forEach((v) => {\n\t\t\tif (!this.hotLines.has(v)) {\n\t\t\t\tremovedIds.add(v);\n\t\t\t\tif (isSeek) this.lyricLinesEl[v].disable();\n\t\t\t}\n\t\t});\n\t\tif (isSeek) {\n\t\t\tif (this.bufferedLines.size > 0) {\n\t\t\t\tthis.scrollToIndex = Math.min(...this.bufferedLines);\n\t\t\t} else {\n\t\t\t\tthis.scrollToIndex = this.processedLines.findIndex(\n\t\t\t\t\t(line) => line.startTime >= time,\n\t\t\t\t);\n\t\t\t}\n\t\t\tthis.bufferedLines.clear();\n\t\t\tthis.hotLines.forEach((v) => this.bufferedLines.add(v));\n\t\t\tthis.calcLayout(true);\n\t\t} else if (removedIds.size > 0 || addedIds.size > 0) {\n\t\t\tif (removedIds.size === 0 && addedIds.size > 0) {\n\t\t\t\taddedIds.forEach((v) => {\n\t\t\t\t\tthis.bufferedLines.add(v);\n\t\t\t\t\tthis.lyricLinesEl[v].enable();\n\t\t\t\t});\n\t\t\t\tthis.scrollToIndex = Math.min(...this.bufferedLines);\n\t\t\t} else if (addedIds.size === 0 && removedIds.size > 0) {\n\t\t\t\tif (eqSet(removedIds, this.bufferedLines)) {\n\t\t\t\t\tthis.bufferedLines.forEach((v) => {\n\t\t\t\t\t\tif (!this.hotLines.has(v)) {\n\t\t\t\t\t\t\tthis.bufferedLines.delete(v);\n\t\t\t\t\t\t\tthis.lyricLinesEl[v].disable();\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\taddedIds.forEach((v) => {\n\t\t\t\t\tthis.bufferedLines.add(v);\n\t\t\t\t\tthis.lyricLinesEl[v].enable();\n\t\t\t\t});\n\t\t\t\tremovedIds.forEach((v) => {\n\t\t\t\t\tthis.bufferedLines.delete(v);\n\t\t\t\t\tthis.lyricLinesEl[v].disable();\n\t\t\t\t});\n\t\t\t\tif (this.bufferedLines.size > 0)\n\t\t\t\t\tthis.scrollToIndex = Math.min(...this.bufferedLines);\n\t\t\t}\n\t\t\tthis.calcLayout();\n\t\t}\n\t}\n\t/**\n\t * 更新动画,这个函数应该被逐帧调用或者在以下情况下调用一次:\n\t *\n\t * 1. 刚刚调用完设置歌词函数的时候\n\t * @param delta 距离上一次被调用到现在的时长,单位为毫秒(可为浮点数)\n\t */\n\tupdate(delta = 0) {\n\t\tconst deltaS = delta / 1000;\n\t\tthis.interludeDots.update(delta);\n\t\tthis.bottomLine.update(deltaS);\n\t\tthis.lyricLinesEl.forEach((line) => line.update(deltaS));\n\t}\n\t/**\n\t * 设置所有歌词行在横坐标上的弹簧属性,包括重量、弹力和阻力。\n\t *\n\t * @param params 需要设置的弹簧属性,提供的属性将会覆盖原来的属性,未提供的属性将会保持原样\n\t */\n\tsetLinePosXSpringParams(params: Partial<SpringParams>) {\n\t\tthis.posXSpringParams = {\n\t\t\t...this.posXSpringParams,\n\t\t\t...params,\n\t\t};\n\t\tthis.bottomLine.lineTransforms.posX.updateParams(this.posXSpringParams);\n\t\tthis.lyricLinesEl.forEach((line) =>\n\t\t\tline.lineTransforms.posX.updateParams(this.posXSpringParams),\n\t\t);\n\t}\n\t/**\n\t * 设置所有歌词行在​纵坐标上的弹簧属性,包括重量、弹力和阻力。\n\t *\n\t * @param params 需要设置的弹簧属性,提供的属性将会覆盖原来的属性,未提供的属性将会保持原样\n\t */\n\tsetLinePosYSpringParams(params: Partial<SpringParams>) {\n\t\tthis.posYSpringParams = {\n\t\t\t...this.posYSpringParams,\n\t\t\t...params,\n\t\t};\n\t\tthis.bottomLine.lineTransforms.posY.updateParams(this.posYSpringParams);\n\t\tthis.lyricLinesEl.forEach((line) =>\n\t\t\tline.lineTransforms.posY.updateParams(this.posYSpringParams),\n\t\t);\n\t}\n\t/**\n\t * 设置所有歌词行在​缩放大小上的弹簧属性,包括重量、弹力和阻力。\n\t *\n\t * @param params 需要设置的弹簧属性,提供的属性将会覆盖原来的属性,未提供的属性将会保持原样\n\t */\n\tsetLineScaleSpringParams(params: Partial<SpringParams>) {\n\t\tthis.scaleSpringParams = {\n\t\t\t...this.scaleSpringParams,\n\t\t\t...params,\n\t\t};\n\t\tthis.lyricLinesEl.forEach((line) =>\n\t\t\tline.lineTransforms.scale.updateParams(this.scaleSpringParams),\n\t\t);\n\t}\n\tdispose(): void {\n\t\tthis.element.remove();\n\t\tthis.resizeObserver.disconnect();\n\t\tthis.style.detach();\n\t\tthis.lyricLinesEl.forEach((el) => el.dispose());\n\t\twindow.removeEventListener(\"pageshow\", this.onPageShow);\n\t\tthis.bottomLine.dispose();\n\t\tthis.interludeDots.dispose();\n\t}\n}\n"],"names":["timeRegexp","parseTimespan","timeSpan","matches","hour","min","sec","parseTTML","ttmlText","ttmlDoc","mainAgentId","agent","id","result","lineEl","line","curBGLine","wordNode","word","wordEl","role","bgLine","firstWord","lastWord","TimedContainer","Container","PixiRenderer","canvas","bounds","Application","delta","lastContainer","s1","s2","s3","s4","maxSize","speed","scale","minBorder","c0","ColorMatrixFilter","c1","c2","BlurFilter","enable","fps","albumUrl","tex","Texture","container","Sprite","BackgroundRender","eqSet","xs","ys","x","Spring","currentPosition","curV","solveSpring","getVelocity","targetPosition","params","delay","from","velocity","to","soft","stiffness","damping","mass","angular_frequency","leftover","t","damping_frequency","dfm","dm","derivative","f","BottomLineEl","lyricPlayer","style","left","top","force","l","r","b","pl","pt","pr","pb","easeInOutBack","clamp","cur","max","InterludeDots","interlude","curStyle","interludeDuration","currentDuration","breatheDuration","globalOpacity","dot0Opacity","dot1Opacity","dot2Opacity","CJKEXP","generateFadeGradient","width","bright","dark","totalAspect","widthInTotal","leftPos","shouldEmphasize","LyricLineEl","lyricLine","main","trans","roman","a","size","collectNodes","w","splited","trimmedLength","pv","cv","pos","sub","i","reusableElements","reusableTextNodes","curNode","lastWordEl","charEl","wholeWordEl","duration","el","arr","du","de","maskImage","_widthInTotal","totalAspectStr","maskPos","opacity","blur","jss","create","preset","LyricPlayer","rect","styles","innerWidth","innerHeight","evt","currentTime","lines","timeOffset","lastLine","pastLine","nextLine","prevLinesEl","reflow","curPos","targetAlignIndex","SCALE_ASPECT","scrollOffset","acc","curLine","lineHeight","latestIndex","baseDelay","setDots","hasBuffered","isActive","alignAnchor","alignPosition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AAK,aAAa,QAAQ,CAAC9K,MAASA,EAAK,OAAO8K,CAAM,CAAC;AAAA,EACxD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,wBAAwB9H,GAA+B;AACtD,SAAK,mBAAmB;AAAA,MACvB,GAAG,KAAK;AAAA,MACR,GAAGA;AAAA,IAAA,GAEJ,KAAK,WAAW,eAAe,KAAK,aAAa,KAAK,gBAAgB,GACtE,KAAK,aAAa;AAAA,MAAQ,CAAChD,MAC1BA,EAAK,eAAe,KAAK,aAAa,KAAK,gBAAgB;AAAA,IAAA;AAAA,EAE7D;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,wBAAwBgD,GAA+B;AACtD,SAAK,mBAAmB;AAAA,MACvB,GAAG,KAAK;AAAA,MACR,GAAGA;AAAA,IAAA,GAEJ,KAAK,WAAW,eAAe,KAAK,aAAa,KAAK,gBAAgB,GACtE,KAAK,aAAa;AAAA,MAAQ,CAAChD,MAC1BA,EAAK,eAAe,KAAK,aAAa,KAAK,gBAAgB;AAAA,IAAA;AAAA,EAE7D;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,yBAAyBgD,GAA+B;AACvD,SAAK,oBAAoB;AAAA,MACxB,GAAG,KAAK;AAAA,MACR,GAAGA;AAAA,IAAA,GAEJ,KAAK,aAAa;AAAA,MAAQ,CAAChD,MAC1BA,EAAK,eAAe,MAAM,aAAa,KAAK,iBAAiB;AAAA,IAAA;AAAA,EAE/D;AAAA,EACA,UAAgB;AACf,SAAK,QAAQ,UACb,KAAK,eAAe,cACpB,KAAK,MAAM,UACX,KAAK,aAAa,QAAQ,CAAC4H,MAAOA,EAAG,SAAS,GACvC,OAAA,oBAAoB,YAAY,KAAK,UAAU,GACtD,KAAK,WAAW,WAChB,KAAK,cAAc;EACpB;AACD;"}
@@ -4,6 +4,7 @@ export declare class PixiRenderer implements Disposable {
4
4
  private observer;
5
5
  private app;
6
6
  private curContainer?;
7
+ private staticMode;
7
8
  private lastContainer;
8
9
  private onTick;
9
10
  private flowSpeed;
@@ -22,6 +23,11 @@ export declare class PixiRenderer implements Disposable {
22
23
  */
23
24
  setRenderScale(scale: number): void;
24
25
  private rebuildFilters;
26
+ /**
27
+ * 是否启用静态模式,即图片在更换后就会保持静止状态并禁用更新,以节省性能
28
+ * @param enable 是否启用静态模式
29
+ */
30
+ setStaticMode(enable?: boolean): void;
25
31
  /**
26
32
  * 修改背景动画帧率,默认是 30 FPS
27
33
  *
@@ -0,0 +1,26 @@
1
+ import { LyricPlayer } from ".";
2
+ import { Disposable, HasElement } from "../interfaces";
3
+ import { Spring } from "../utils/spring";
4
+ export declare class BottomLineEl implements HasElement, Disposable {
5
+ private lyricPlayer;
6
+ private element;
7
+ private left;
8
+ private top;
9
+ private delay;
10
+ lineSize: number[];
11
+ readonly lineTransforms: {
12
+ posX: Spring;
13
+ posY: Spring;
14
+ };
15
+ constructor(lyricPlayer: LyricPlayer);
16
+ measureSize(): [number, number];
17
+ private lastStyle;
18
+ show(): void;
19
+ hide(): void;
20
+ rebuildStyle(): void;
21
+ getElement(): HTMLElement;
22
+ setTransform(left?: number, top?: number, force?: boolean, delay?: number): void;
23
+ update(delta?: number): void;
24
+ get isInSight(): boolean;
25
+ dispose(): void;
26
+ }