@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.
- package/README.md +23 -21
- package/dist/amll-core.css +1 -0
- package/dist/amll-core.js +2272 -2193
- package/dist/amll-core.js.map +1 -1
- package/dist/bg-render/base.d.ts +1 -0
- package/dist/bg-render/base.d.ts.map +1 -0
- package/dist/bg-render/img.d.ts +1 -0
- package/dist/bg-render/img.d.ts.map +1 -0
- package/dist/bg-render/index.d.ts +1 -0
- package/dist/bg-render/index.d.ts.map +1 -0
- package/dist/bg-render/mesh-renderer/cp-generate.d.ts +7 -0
- package/dist/bg-render/mesh-renderer/cp-generate.d.ts.map +1 -0
- package/dist/bg-render/mesh-renderer/cp-presets.d.ts +10 -4
- package/dist/bg-render/mesh-renderer/cp-presets.d.ts.map +1 -0
- package/dist/bg-render/mesh-renderer/index.d.ts +12 -1
- package/dist/bg-render/mesh-renderer/index.d.ts.map +1 -0
- package/dist/bg-render/pixi-renderer.d.ts +2 -1
- package/dist/bg-render/pixi-renderer.d.ts.map +1 -0
- package/dist/canvas-test.d.ts +1 -0
- package/dist/canvas-test.d.ts.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/interfaces.d.ts +3 -0
- package/dist/interfaces.d.ts.map +1 -0
- package/dist/lyric-player/base.d.ts +58 -5
- package/dist/lyric-player/base.d.ts.map +1 -0
- package/dist/lyric-player/bottom-line.d.ts +2 -1
- package/dist/lyric-player/bottom-line.d.ts.map +1 -0
- package/dist/lyric-player/canvas/index.d.ts +14 -0
- package/dist/lyric-player/canvas/index.d.ts.map +1 -0
- package/dist/lyric-player/canvas/lyric-line.d.ts +3 -0
- package/dist/lyric-player/canvas/lyric-line.d.ts.map +1 -0
- package/dist/lyric-player/canvas/text-layout.d.ts +1 -0
- package/dist/lyric-player/canvas/text-layout.d.ts.map +1 -0
- package/dist/lyric-player/dom/index.d.ts +9 -4
- package/dist/lyric-player/dom/index.d.ts.map +1 -0
- package/dist/lyric-player/dom/interlude-dots.d.ts +1 -0
- package/dist/lyric-player/dom/interlude-dots.d.ts.map +1 -0
- package/dist/lyric-player/dom/lyric-line.d.ts +13 -12
- package/dist/lyric-player/dom/lyric-line.d.ts.map +1 -0
- package/dist/lyric-player/dom-slim/index.d.ts +7 -1
- package/dist/lyric-player/dom-slim/index.d.ts.map +1 -0
- package/dist/lyric-player/dom-slim/interlude-dots.d.ts +1 -0
- package/dist/lyric-player/dom-slim/interlude-dots.d.ts.map +1 -0
- package/dist/lyric-player/dom-slim/lyric-line.d.ts +1 -1
- package/dist/lyric-player/dom-slim/lyric-line.d.ts.map +1 -0
- package/dist/lyric-player/index.d.ts +3 -1
- package/dist/lyric-player/index.d.ts.map +1 -0
- package/dist/mg-test.d.ts +1 -0
- package/dist/mg-test.d.ts.map +1 -0
- package/dist/utils/debounce.d.ts +1 -0
- package/dist/utils/debounce.d.ts.map +1 -0
- package/dist/utils/derivative.d.ts +1 -0
- package/dist/utils/derivative.d.ts.map +1 -0
- package/dist/utils/eq-set.d.ts +1 -0
- package/dist/utils/eq-set.d.ts.map +1 -0
- package/dist/utils/flagsets.d.ts +18 -0
- package/dist/utils/flagsets.d.ts.map +1 -0
- package/dist/utils/is-cjk.d.ts +1 -0
- package/dist/utils/is-cjk.d.ts.map +1 -0
- package/dist/utils/linear.d.ts +1 -0
- package/dist/utils/linear.d.ts.map +1 -0
- package/dist/utils/lyric-split-words.d.ts +1 -0
- package/dist/utils/lyric-split-words.d.ts.map +1 -0
- package/dist/utils/matrix.d.ts +1 -0
- package/dist/utils/matrix.d.ts.map +1 -0
- package/dist/utils/mutex.d.ts +1 -0
- package/dist/utils/mutex.d.ts.map +1 -0
- package/dist/utils/resource.d.ts +1 -0
- package/dist/utils/resource.d.ts.map +1 -0
- package/dist/utils/schedule.d.ts +1 -0
- package/dist/utils/schedule.d.ts.map +1 -0
- package/dist/utils/spring.d.ts +1 -0
- package/dist/utils/spring.d.ts.map +1 -0
- package/dist/utils/wa-spring.d.ts +1 -0
- package/dist/utils/wa-spring.d.ts.map +1 -0
- package/package.json +19 -14
- 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
|

|
|
6
8
|
[](https://www.npmjs.com/package/@applemusic-like-lyrics/core)
|
|
7
9
|
[](https://www.npmjs.com/package/@applemusic-like-lyrics/core)
|
|
8
10
|
|
|
9
|
-
AMLL
|
|
11
|
+
AMLL's pure JS core component framework, including lyric display components and background components and other reusable components.
|
|
10
12
|
|
|
11
|
-
|
|
13
|
+
Everything here is UI framework-independent, so it can be indirectly referenced under various dynamic page frameworks.
|
|
12
14
|
|
|
13
|
-
|
|
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 #
|
|
20
|
-
yarn add @pixi/app @pixi/core @pixi/display @pixi/filter-blur @pixi/filter-bulge-pinch @pixi/filter-color-matrix @pixi/sprite #
|
|
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 #
|
|
26
|
-
yarn add @applemusic-like-lyrics/core #
|
|
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
|
-
|
|
33
|
+
For detailed API documentation, please refer to [./docs/modules.md](./docs/modules.md)
|
|
32
34
|
|
|
33
|
-
|
|
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
|
-
|
|
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}
|