@applemusic-like-lyrics/core 0.0.6 → 0.0.8

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\tif (CJKEXP.test(word.word)) {\n\t\t\t\tthis.splittedWords.push({\n\t\t\t\t\t...word,\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} else {\n\t\t\t\tconst splited = /(\\s*)(\\S*)(\\s*)/.exec(word.word);\n\t\t\t\tif (splited) {\n\t\t\t\t\tif (splited[1].length > 0) {\n\t\t\t\t\t\tthis.splittedWords.push({\n\t\t\t\t\t\t\tword: \" \",\n\t\t\t\t\t\t\tstartTime: 0,\n\t\t\t\t\t\t\tendTime: 0,\n\t\t\t\t\t\t\twidth: 0,\n\t\t\t\t\t\t\theight: 0,\n\t\t\t\t\t\t\telements: [],\n\t\t\t\t\t\t\telementAnimations: [],\n\t\t\t\t\t\t\tshouldEmphasize: false,\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t\tthis.splittedWords.push({\n\t\t\t\t\t\tword: splited[2],\n\t\t\t\t\t\tstartTime: word.startTime,\n\t\t\t\t\t\tendTime: word.endTime,\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: shouldEmphasize(word),\n\t\t\t\t\t});\n\t\t\t\t\tif (splited[3].length > 0) {\n\t\t\t\t\t\tthis.splittedWords.push({\n\t\t\t\t\t\t\tword: \" \",\n\t\t\t\t\t\t\tstartTime: 0,\n\t\t\t\t\t\t\tendTime: 0,\n\t\t\t\t\t\t\twidth: 0,\n\t\t\t\t\t\t\theight: 0,\n\t\t\t\t\t\t\telements: [],\n\t\t\t\t\t\t\telementAnimations: [],\n\t\t\t\t\t\t\tshouldEmphasize: false,\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\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 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: Math.max(1000, word.endTime - word.startTime),\n\t\t\t\tdelay: word.startTime - this.lyricLine.startTime,\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] | 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];\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];\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.map((line, i, lines) => {\n\t\t\tif (line.isBG)\n\t\t\t\treturn {\n\t\t\t\t\t...line,\n\t\t\t\t};\n\t\t\telse {\n\t\t\t\tconst lastLine = lines[i - 1];\n\t\t\t\tconst pastLine = lines[i - 2];\n\t\t\t\tif (lastLine?.isBG && pastLine) {\n\t\t\t\t\tif (pastLine.endTime < line.startTime) {\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t...line,\n\t\t\t\t\t\t\tstartTime:\n\t\t\t\t\t\t\t\tMath.max(pastLine.endTime, line.startTime - timeOffset) ||\n\t\t\t\t\t\t\t\tline.startTime,\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\t\t\t\t} else if (lastLine?.endTime) {\n\t\t\t\t\tif (lastLine.endTime < line.startTime) {\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t...line,\n\t\t\t\t\t\t\tstartTime:\n\t\t\t\t\t\t\t\tMath.max(lastLine?.endTime, line.startTime - timeOffset) ||\n\t\t\t\t\t\t\t\tline.startTime,\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn {\n\t\t\t\t\t...line,\n\t\t\t\t};\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\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 =\n\t\t\tthis.currentTime === 0 ? undefined : 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 =\n\t\t\t\t\tthis.currentTime === 0\n\t\t\t\t\t\t? this.lyricLinesEl[0]\n\t\t\t\t\t\t: this.lyricLinesEl[this.scrollToIndex + 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\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 (i === this.scrollToIndex + 1 && interludeDuration >= 5000) {\n\t\t\t\tthis.interludeDots.setTransform(0, curPos);\n\t\t\t\tthis.interludeDots.setInterlude(this.getCurrentInterlude());\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","_a","min","_b","sec","_c","parseTTML","ttmlText","ttmlDoc","mainAgentId","agent","id","result","lineEl","line","curBGLine","wordNode","word","wordEl","role","bgLine","firstWord","lastWord","TimedContainer","Container","__publicField","PixiRenderer","canvas","delta","lastContainer","s1","s2","s3","s4","maxSize","bounds","Application","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","reusableElements","reusableTextNodes","collectNodes","curNode","lastWordEl","c","charEl","wholeWordEl","duration","el","i","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","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,SAAOC,IAAAF,EAAQ,WAAR,gBAAAE,EAAgB,SAAQ,GAAG,GACzCC,IAAM,SAAOC,IAAAJ,EAAQ,WAAR,gBAAAI,EAAgB,QAAO,GAAG,GACvCC,IAAM,SAAOC,IAAAN,EAAQ,WAAR,gBAAAM,EAAgB,IAAI,QAAQ,KAAK,SAAQ,GAAG;AAC/D,WAAO,KAAK,OAAOL,IAAO,OAAOE,IAAM,KAAKE,KAAO,GAAI;AAAA,EAAA;AAEjD,UAAA,IAAI,UAAU,YAAY;AAElC;AAEO,SAASE,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;AACp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A;AAAA,EAMA,yBAAyBiE,GAA+B;AACvD,SAAK,oBAAoB;AAAA,MACxB,GAAG,KAAK;AAAA,MACR,GAAGA;AAAA,IAAA,GAEJ,KAAK,aAAa;AAAA,MAAQ,CAACjE,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,CAAC6G,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/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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ACR,GAAGA;AAAA,IAAA,GAEJ,KAAK,aAAa;AAAA,MAAQ,CAAChE,MAC1BA,EAAK,eAAe,KAAK,aAAa,KAAK,gBAAgB;AAAA,IAAA;AAAA,EAE7D;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,wBAAwBgE,GAA+B;AACtD,SAAK,mBAAmB;AAAA,MACvB,GAAG,KAAK;AAAA,MACR,GAAGA;AAAA,IAAA,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;"}
@@ -57,7 +57,7 @@ export declare class LyricPlayer extends EventTarget implements HasElement, Disp
57
57
  * 这个只允许内部调用
58
58
  * @returns [开始时间,结束时间] 或 undefined 如果不处于间奏区间
59
59
  */
60
- getCurrentInterlude(): [number, number] | undefined;
60
+ getCurrentInterlude(): [number, number, number] | undefined;
61
61
  /**
62
62
  * 重建样式
63
63
  *
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@applemusic-like-lyrics/core",
3
3
  "packageManager": "yarn@3.6.1",
4
- "version": "0.0.6",
4
+ "version": "0.0.8",
5
5
  "description": "AMLL 的纯 JS 核心组件框架,包括歌词显示组件和背景组件等其它可以复用的组件",
6
6
  "repository": {
7
7
  "url": "https://github.com/Steve-xmh/applemusic-like-lyrics.git",
@@ -28,6 +28,7 @@
28
28
  }
29
29
  },
30
30
  "devDependencies": {
31
+ "@applemusic-like-lyrics/lyric": "^0.0.2",
31
32
  "@types/stats.js": "^0.17.0",
32
33
  "lil-gui": "^0.18.2",
33
34
  "rome": "^12.1.3",
@@ -35,7 +36,9 @@
35
36
  "typedoc": "^0.24.8",
36
37
  "typedoc-plugin-markdown": "^3.15.3",
37
38
  "vite": "^4.4.7",
38
- "vite-plugin-dts": "^3.3.1"
39
+ "vite-plugin-dts": "^3.3.1",
40
+ "vite-plugin-top-level-await": "^1.3.1",
41
+ "vite-plugin-wasm": "^3.2.2"
39
42
  },
40
43
  "peerDependencies": {
41
44
  "@pixi/app": "*",