@applemusic-like-lyrics/core 0.2.0-alpha.4 → 0.2.0-alpha.6

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.
Files changed (78) hide show
  1. package/README.md +23 -21
  2. package/dist/amll-core.css +1 -0
  3. package/dist/amll-core.js +2272 -2193
  4. package/dist/amll-core.js.map +1 -1
  5. package/dist/bg-render/base.d.ts +1 -0
  6. package/dist/bg-render/base.d.ts.map +1 -0
  7. package/dist/bg-render/img.d.ts +1 -0
  8. package/dist/bg-render/img.d.ts.map +1 -0
  9. package/dist/bg-render/index.d.ts +1 -0
  10. package/dist/bg-render/index.d.ts.map +1 -0
  11. package/dist/bg-render/mesh-renderer/cp-generate.d.ts +7 -0
  12. package/dist/bg-render/mesh-renderer/cp-generate.d.ts.map +1 -0
  13. package/dist/bg-render/mesh-renderer/cp-presets.d.ts +10 -4
  14. package/dist/bg-render/mesh-renderer/cp-presets.d.ts.map +1 -0
  15. package/dist/bg-render/mesh-renderer/index.d.ts +12 -1
  16. package/dist/bg-render/mesh-renderer/index.d.ts.map +1 -0
  17. package/dist/bg-render/pixi-renderer.d.ts +2 -1
  18. package/dist/bg-render/pixi-renderer.d.ts.map +1 -0
  19. package/dist/canvas-test.d.ts +1 -0
  20. package/dist/canvas-test.d.ts.map +1 -0
  21. package/dist/index.d.ts +1 -0
  22. package/dist/index.d.ts.map +1 -0
  23. package/dist/interfaces.d.ts +3 -0
  24. package/dist/interfaces.d.ts.map +1 -0
  25. package/dist/lyric-player/base.d.ts +58 -5
  26. package/dist/lyric-player/base.d.ts.map +1 -0
  27. package/dist/lyric-player/bottom-line.d.ts +2 -1
  28. package/dist/lyric-player/bottom-line.d.ts.map +1 -0
  29. package/dist/lyric-player/canvas/index.d.ts +14 -0
  30. package/dist/lyric-player/canvas/index.d.ts.map +1 -0
  31. package/dist/lyric-player/canvas/lyric-line.d.ts +3 -0
  32. package/dist/lyric-player/canvas/lyric-line.d.ts.map +1 -0
  33. package/dist/lyric-player/canvas/text-layout.d.ts +1 -0
  34. package/dist/lyric-player/canvas/text-layout.d.ts.map +1 -0
  35. package/dist/lyric-player/dom/index.d.ts +9 -4
  36. package/dist/lyric-player/dom/index.d.ts.map +1 -0
  37. package/dist/lyric-player/dom/interlude-dots.d.ts +1 -0
  38. package/dist/lyric-player/dom/interlude-dots.d.ts.map +1 -0
  39. package/dist/lyric-player/dom/lyric-line.d.ts +13 -12
  40. package/dist/lyric-player/dom/lyric-line.d.ts.map +1 -0
  41. package/dist/lyric-player/dom-slim/index.d.ts +7 -1
  42. package/dist/lyric-player/dom-slim/index.d.ts.map +1 -0
  43. package/dist/lyric-player/dom-slim/interlude-dots.d.ts +1 -0
  44. package/dist/lyric-player/dom-slim/interlude-dots.d.ts.map +1 -0
  45. package/dist/lyric-player/dom-slim/lyric-line.d.ts +1 -1
  46. package/dist/lyric-player/dom-slim/lyric-line.d.ts.map +1 -0
  47. package/dist/lyric-player/index.d.ts +3 -1
  48. package/dist/lyric-player/index.d.ts.map +1 -0
  49. package/dist/mg-test.d.ts +1 -0
  50. package/dist/mg-test.d.ts.map +1 -0
  51. package/dist/utils/debounce.d.ts +1 -0
  52. package/dist/utils/debounce.d.ts.map +1 -0
  53. package/dist/utils/derivative.d.ts +1 -0
  54. package/dist/utils/derivative.d.ts.map +1 -0
  55. package/dist/utils/eq-set.d.ts +1 -0
  56. package/dist/utils/eq-set.d.ts.map +1 -0
  57. package/dist/utils/flagsets.d.ts +18 -0
  58. package/dist/utils/flagsets.d.ts.map +1 -0
  59. package/dist/utils/is-cjk.d.ts +1 -0
  60. package/dist/utils/is-cjk.d.ts.map +1 -0
  61. package/dist/utils/linear.d.ts +1 -0
  62. package/dist/utils/linear.d.ts.map +1 -0
  63. package/dist/utils/lyric-split-words.d.ts +1 -0
  64. package/dist/utils/lyric-split-words.d.ts.map +1 -0
  65. package/dist/utils/matrix.d.ts +1 -0
  66. package/dist/utils/matrix.d.ts.map +1 -0
  67. package/dist/utils/mutex.d.ts +1 -0
  68. package/dist/utils/mutex.d.ts.map +1 -0
  69. package/dist/utils/resource.d.ts +1 -0
  70. package/dist/utils/resource.d.ts.map +1 -0
  71. package/dist/utils/schedule.d.ts +1 -0
  72. package/dist/utils/schedule.d.ts.map +1 -0
  73. package/dist/utils/spring.d.ts +1 -0
  74. package/dist/utils/spring.d.ts.map +1 -0
  75. package/dist/utils/wa-spring.d.ts +1 -0
  76. package/dist/utils/wa-spring.d.ts.map +1 -0
  77. package/package.json +19 -14
  78. package/dist/style.css +0 -1
package/README.md CHANGED
@@ -1,46 +1,48 @@
1
1
  # AMLL Core
2
2
 
3
- > 警告:此为个人项目,且尚未完成开发,可能仍有大量问题,所以请勿直接用于生产环境!
3
+ English / [简体中文](./README-CN.md)
4
+
5
+ > Warning: This is a personal project and is still under development. There may still be many issues, so please do not use it directly in production environments!
4
6
 
5
7
  ![AMLL-Core](https://img.shields.io/badge/Core-%233178c6?label=Apple%20Music-like%20Lyrics&labelColor=%23FB5C74)
6
8
  [![npm](https://img.shields.io/npm/dt/%40applemusic-like-lyrics/core)](https://www.npmjs.com/package/@applemusic-like-lyrics/core)
7
9
  [![npm](https://img.shields.io/npm/v/%40applemusic-like-lyrics%2Fcore)](https://www.npmjs.com/package/@applemusic-like-lyrics/core)
8
10
 
9
- AMLL 的纯 JS 核心组件框架,包括歌词显示组件和背景组件等其它可以复用的组件。
11
+ AMLL's pure JS core component framework, including lyric display components and background components and other reusable components.
10
12
 
11
- 此处的东西都是 UI 框架无关的,所以可以间接在各种动态页面框架下引用。
13
+ Everything here is UI framework-independent, so it can be indirectly referenced under various dynamic page frameworks.
12
14
 
13
- 或者如果你需要使用组件绑定的话,这里有 [React 绑定版本](../react/README.md) [Vue 绑定版本](../vue/README.md)
15
+ Or if you need to use component bindings, there's a [React binding version](../react/README.md) and a [Vue binding version](../vue/README.md)
14
16
 
15
- ## 安装
17
+ ## Installation
16
18
 
17
- 安装使用的依赖(如果以下列出的依赖包没有安装的话需要自行安装):
19
+ Install the required dependencies (if the dependencies listed below are not installed, you need to install them yourself):
18
20
  ```bash
19
- npm install @pixi/app @pixi/core @pixi/display @pixi/filter-blur @pixi/filter-bulge-pinch @pixi/filter-color-matrix @pixi/sprite # 使用 npm
20
- yarn add @pixi/app @pixi/core @pixi/display @pixi/filter-blur @pixi/filter-bulge-pinch @pixi/filter-color-matrix @pixi/sprite # 使用 yarn
21
+ npm install @pixi/app @pixi/core @pixi/display @pixi/filter-blur @pixi/filter-bulge-pinch @pixi/filter-color-matrix @pixi/sprite # using npm
22
+ yarn add @pixi/app @pixi/core @pixi/display @pixi/filter-blur @pixi/filter-bulge-pinch @pixi/filter-color-matrix @pixi/sprite # using yarn
21
23
  ```
22
24
 
23
- 安装本体框架:
25
+ Install the framework:
24
26
  ```bash
25
- npm install @applemusic-like-lyrics/core # 使用 npm
26
- yarn add @applemusic-like-lyrics/core # 使用 yarn
27
+ npm install @applemusic-like-lyrics/core # using npm
28
+ yarn add @applemusic-like-lyrics/core # using yarn
27
29
  ```
28
30
 
29
- ## 使用方式摘要
31
+ ## Usage Summary
30
32
 
31
- 详细的 API 文档请参考 [./docs/modules.md](./docs/modules.md)
33
+ For detailed API documentation, please refer to [./docs/modules.md](./docs/modules.md)
32
34
 
33
- 一个测试用途的程序可以在 [./src/test.ts](./src/test.ts) 里找到。
35
+ A test program can be found in [./src/test.ts](./src/test.ts).
34
36
 
35
37
  ```typescript
36
38
  import { LyricPlayer } from "@applemusic-like-lyrics/core";
37
- import "@applemusic-like-lyrics/core/style.css"; // 导入需要的样式
39
+ import "@applemusic-like-lyrics/core/style.css"; // Import required styles
38
40
 
39
- const player = new LyricPlayer(); // 创建歌词播放组件
40
- document.body.appendChild(player.getElement()); // 将组件的元素添加到页面
41
- player.setLyricLines([]) // 设置歌词
42
- player.setCurrentTime(0) // 设定当前播放时间(需要逐帧调用)
43
- player.update(0) // 更新歌词组件动画(需要逐帧调用)
41
+ const player = new LyricPlayer(); // Create a lyric player component
42
+ document.body.appendChild(player.getElement()); // Add the component's element to the page
43
+ player.setLyricLines([]) // Set lyrics
44
+ player.setCurrentTime(0) // Set current playback time (needs to be called every frame)
45
+ player.update(0) // Update lyric component animation (needs to be called every frame)
44
46
  ```
45
47
 
46
- 每次通过 `LyricPlayer.setLyricLines` 设置的歌词是一个 `LyricLine[]` 参数,具体可以参考 [./src/interfaces.ts](./src/interfaces.ts) 中的代码。
48
+ The lyrics set through `LyricPlayer.setLyricLines` is a `LyricLine[]` parameter. For details, please refer to the code in [./src/interfaces.ts](./src/interfaces.ts).
@@ -0,0 +1 @@
1
+ .amll-lyric-player{width:100%;max-width:100%;height:100%;color:var(--amll-lp-color,white);contain:strict;mix-blend-mode:plus-lighter;font-size:var(--amll-lp-font-size,max(max(5vh,2.5vw),12px));overflow:hidden}@media screen and (max-width:768px){.amll-lyric-player{font-size:var(--amll-lp-font-size,max(8vw,12px))}}.amll-lyric-player.dom{--amll-lp-line-width-aspect:.8;--amll-lp-line-padding-x:1em;--amll-lp-bg-line-scale:.7;-webkit-user-select:none;user-select:none;box-sizing:content-box;z-index:1;line-height:1.2em}.amll-lyric-player.dom-slim{--amll-lp-line-width-aspect:.8;--amll-lp-line-padding-x:1em;--amll-lp-bg-line-scale:.7;-webkit-user-select:none;user-select:none;box-sizing:content-box;z-index:1;min-width:0;min-height:0;line-height:1.2em;overflow:hidden scroll}.amll-lyric-player.dom-slim::-webkit-scrollbar{opacity:0}.amll-lyric-player.dom-slim:hover::-webkit-scrollbar{opacity:1}.amll-lyric-player.dom-slim>*{content-visibility:auto;contain-intrinsic-size:100% 2em}@media screen and (max-width:768px){.amll-lyric-player{--amll-lp-line-width-aspect:1;--amll-lp-line-padding-x:0}}._lyricLine_ut4sn_6{backface-visibility:hidden;transform-origin:0;width:var(--amll-lp-width,100%);min-width:var(--amll-lp-width,100%);max-width:var(--amll-lp-width,100%);contain:content;will-change:transform;box-sizing:border-box;border-radius:.25em;width:100%;height:fit-content;padding:.5em 1em;transition:opacity .25s,filter .2s,background-color .25s,box-shadow .25s;position:absolute}@media screen and (max-width:500px){._lyricLine_ut4sn_6{padding-left:20px;padding-right:20px}}._lyricLine_ut4sn_6._dirty_ut4sn_34{opacity:0;visibility:hidden}._lyricLine_ut4sn_6:has(>*):hover{background-color:var(--amll-lp-hover-bg-color,#fff1)}._lyricLine_ut4sn_6:has(>*):active{background-color:var(--amll-lp-hover-bg-color,#ffffff05)}._lyricBgLine_ut4sn_50{opacity:.0001;font-size:max(calc(1em*var(--amll-lp-bg-line-scale,.7)),10px);padding:1vh calc(var(--amll-lp-line-padding-x,1em)/var(--amll-lp-bg-line-scale,.7));transition:opacity .25s,scale .5s,filter .2s,background-color .25s,box-shadow .25s}._lyricBgLine_ut4sn_50._active_ut4sn_62{opacity:.4;transition:opacity .5s .25s,scale 1.5s cubic-bezier(0,1,0,1) .25s,filter .2s,background-color .25s,box-shadow .25s}.amll-lyric-player:hover ._lyricLine_ut4sn_6{filter:unset!important}.amll-lyric-player._hasDuetLine_ut4sn_78 ._lyricLine_ut4sn_6:not(._lyricDuetLine_ut4sn_79){padding-right:15%}.amll-lyric-player._hasDuetLine_ut4sn_78 ._lyricDuetLine_ut4sn_79{padding-left:15%}.amll-lyric-player:not(.playing)>._lyricBgLine_ut4sn_50{opacity:.4}._lyricDuetLine_ut4sn_79{text-align:right;transform-origin:100%}._lyricMainLine_ut4sn_98{margin:-1em;padding:1em;transition:opacity .3s .1s}._lyricMainLine_ut4sn_98 span{display:inline-block}._lyricMainLine_ut4sn_98 ._romanWord_ut4sn_107{font-size:.5em;line-height:1em}._lyricMainLine_ut4sn_98>span,._lyricMainLine_ut4sn_98 span._emphasizeWrapper_ut4sn_113{white-space:pre-wrap;will-change:transform;margin:-1em;padding:1em;display:inline-block}:is(._lyricMainLine_ut4sn_98>span,._lyricMainLine_ut4sn_98 span._emphasizeWrapper_ut4sn_113)._emphasize_ut4sn_113,:is(._lyricMainLine_ut4sn_98>span,._lyricMainLine_ut4sn_98 span._emphasizeWrapper_ut4sn_113) span._emphasize_ut4sn_113{backface-visibility:hidden;margin:-1em;padding:1em}:is(:is(._lyricMainLine_ut4sn_98>span,._lyricMainLine_ut4sn_98 span._emphasizeWrapper_ut4sn_113)._emphasize_ut4sn_113,:is(._lyricMainLine_ut4sn_98>span,._lyricMainLine_ut4sn_98 span._emphasizeWrapper_ut4sn_113) span._emphasize_ut4sn_113)>span{will-change:transform;backface-visibility:hidden;margin:-1em;padding:1em}._lyricSubLine_ut4sn_136{opacity:.3;font-size:max(.5em,10px);line-height:1.5em;transition:opacity .2s .25s}._disableSpring_ut4sn_143>*{transition:filter .25s,transform .5s,background-color .25s,box-shadow .25s}._interludeDots_ut4sn_151{transform-origin:50%;opacity:0;gap:.25em;width:fit-content;height:clamp(.5em,1vh,3em);padding:2.5% .75em;transition:opacity .25s;display:flex;position:absolute;left:0}._interludeDots_ut4sn_151._enabled_ut4sn_163{opacity:1}._interludeDots_ut4sn_151>*{aspect-ratio:1;background-color:var(--amll-lp-color,white);border-radius:50%;width:clamp(.5em,1vh,3em);height:clamp(.5em,1vh,3em);margin-right:4px;display:inline-block}._interludeDots_ut4sn_151._duet_ut4sn_177{transform-origin:50%;right:0}@supports (mix-blend-mode:plus-lighter){._lyricSubLine_ut4sn_136{opacity:.3}}._tmpDisableTransition_ut4sn_189{transition:none!important}._lyricLine_1jop6_6{width:var(--amll-lp-width,100%);min-width:var(--amll-lp-width,100%);max-width:var(--amll-lp-width,100%);contain:content;box-sizing:border-box;border-radius:.25em;width:100%;height:fit-content;padding:2vh 1em;transition:opacity .25s,filter .2s,background-color .25s,box-shadow .25s}._lyricLine_1jop6_6:has(>*):hover{background-color:var(--amll-lp-hover-bg-color,#fff1)}._lyricLine_1jop6_6:has(>*):active{background-color:var(--amll-lp-hover-bg-color,#ffffff05)}._lyricBgLine_1jop6_36{opacity:0;font-size:max(calc(1em*var(--amll-lp-bg-line-scale,.7)),10px);padding:1vh calc(var(--amll-lp-line-padding-x,1em)/var(--amll-lp-bg-line-scale,.7));transition:opacity .25s,scale .5s,filter .2s,background-color .25s,box-shadow .25s}._lyricBgLine_1jop6_36._active_1jop6_49{opacity:.4;transition:opacity .5s .25s,scale 1.5s cubic-bezier(0,1,0,1) .25s,filter .2s,background-color .25s,box-shadow .25s}.amll-lyric-player:hover ._lyricLine_1jop6_6{filter:unset!important}.amll-lyric-player._hasDuetLine_1jop6_65 ._lyricLine_1jop6_6:not(._lyricDuetLine_1jop6_66){padding-right:15%}.amll-lyric-player._hasDuetLine_1jop6_65 ._lyricDuetLine_1jop6_66{padding-left:15%}._lyricDuetLine_1jop6_66{text-align:right;transform-origin:100%}._lyricMainLine_1jop6_80{contain:content paint;transition:opacity .3s .1s}._lyricMainLine_1jop6_80 span{white-space:pre;display:inline-block}._lyricSubLine_1jop6_90{opacity:.3;font-size:max(.5em,10px);line-height:1.5em;transition:opacity .2s .25s}._interludeDots_1jop6_97{transform-origin:50%;opacity:0;gap:.25em;width:fit-content;height:clamp(.5em,1vh,3em);padding:2.5% .75em;transition:opacity .25s;display:flex;left:0}._interludeDots_1jop6_97._enabled_1jop6_108{opacity:1}._interludeDots_1jop6_97>*{aspect-ratio:1;background-color:var(--amll-lp-color,white);border-radius:50%;width:clamp(.5em,1vh,3em);height:clamp(.5em,1vh,3em);margin-right:4px;display:inline-block}._interludeDots_1jop6_97._duet_1jop6_122{transform-origin:50%;right:0}@supports (mix-blend-mode:plus-lighter){._lyricSubLine_1jop6_90{opacity:.3}}._tmpDisableTransition_1jop6_134{transition:none!important}