@applemusic-like-lyrics/core 0.3.2 → 0.4.1

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 (49) hide show
  1. package/README.md +3 -3
  2. package/dist/amll-core.cjs +5267 -0
  3. package/dist/amll-core.cjs.map +1 -0
  4. package/dist/amll-core.d.cts +1009 -0
  5. package/dist/amll-core.d.mts +1009 -0
  6. package/dist/{amll-core.js → amll-core.mjs} +391 -5838
  7. package/dist/amll-core.mjs.map +1 -0
  8. package/dist/style.css +396 -0
  9. package/package.json +69 -84
  10. package/LICENSE +0 -661
  11. package/dist/amll-core.css +0 -2
  12. package/dist/amll-core.js.map +0 -1
  13. package/dist/bg-render/base.d.ts +0 -109
  14. package/dist/bg-render/img.d.ts +0 -4
  15. package/dist/bg-render/index.d.ts +0 -28
  16. package/dist/bg-render/mesh-renderer/cp-generate.d.ts +0 -6
  17. package/dist/bg-render/mesh-renderer/cp-presets.d.ts +0 -22
  18. package/dist/bg-render/mesh-renderer/index.d.ts +0 -76
  19. package/dist/bg-render/pixi-renderer.d.ts +0 -22
  20. package/dist/canvas-test.d.ts +0 -1
  21. package/dist/index.d.ts +0 -4
  22. package/dist/interfaces.d.ts +0 -106
  23. package/dist/lyric-player/base.d.ts +0 -327
  24. package/dist/lyric-player/bottom-line.d.ts +0 -29
  25. package/dist/lyric-player/canvas/index.d.ts +0 -24
  26. package/dist/lyric-player/canvas/lyric-line.d.ts +0 -24
  27. package/dist/lyric-player/canvas/text-layout.d.ts +0 -39
  28. package/dist/lyric-player/dom/index.d.ts +0 -59
  29. package/dist/lyric-player/dom/interlude-dots.d.ts +0 -22
  30. package/dist/lyric-player/dom/lyric-line.d.ts +0 -80
  31. package/dist/lyric-player/dom-slim/index.d.ts +0 -38
  32. package/dist/lyric-player/dom-slim/interlude-dots.d.ts +0 -22
  33. package/dist/lyric-player/dom-slim/lyric-line.d.ts +0 -69
  34. package/dist/lyric-player/index.d.ts +0 -29
  35. package/dist/mg-test.d.ts +0 -1
  36. package/dist/utils/debounce.d.ts +0 -2
  37. package/dist/utils/derivative.d.ts +0 -2
  38. package/dist/utils/eq-set.d.ts +0 -1
  39. package/dist/utils/flagsets.d.ts +0 -17
  40. package/dist/utils/is-cjk.d.ts +0 -1
  41. package/dist/utils/linear.d.ts +0 -21
  42. package/dist/utils/lyric-split-words.d.ts +0 -11
  43. package/dist/utils/matrix.d.ts +0 -25
  44. package/dist/utils/mutex.d.ts +0 -2
  45. package/dist/utils/optimize-lyric.d.ts +0 -9
  46. package/dist/utils/resource.d.ts +0 -4
  47. package/dist/utils/schedule.d.ts +0 -6
  48. package/dist/utils/spring.d.ts +0 -26
  49. package/dist/utils/wa-spring.d.ts +0 -27
package/dist/style.css ADDED
@@ -0,0 +1,396 @@
1
+ .amll-lyric-player {
2
+ width: 100%;
3
+ max-width: 100%;
4
+ height: 100%;
5
+ color: var(--amll-lp-color, white);
6
+ contain: strict;
7
+ mix-blend-mode: plus-lighter;
8
+ font-size: var(--amll-lp-font-size, max(max(5vh, 2.5vw), 12px));
9
+ overflow: hidden;
10
+
11
+ @media screen and (width <= 768px) {
12
+ font-size: var(--amll-lp-font-size, max(8vw, 12px));
13
+ }
14
+
15
+ &.dom {
16
+ --amll-lp-line-width-aspect: .8;
17
+ --amll-lp-line-padding-x: 1em;
18
+ --amll-lp-bg-line-scale: .7;
19
+ user-select: none;
20
+ box-sizing: content-box;
21
+ z-index: 1;
22
+ line-height: 1.2em;
23
+ }
24
+
25
+ &.dom-slim {
26
+ --amll-lp-line-width-aspect: .8;
27
+ --amll-lp-line-padding-x: 1em;
28
+ --amll-lp-bg-line-scale: .7;
29
+ user-select: none;
30
+ box-sizing: content-box;
31
+ z-index: 1;
32
+ min-width: 0;
33
+ min-height: 0;
34
+ line-height: 1.2em;
35
+ overflow: hidden scroll;
36
+
37
+ &::-webkit-scrollbar {
38
+ opacity: 0;
39
+ }
40
+
41
+ &:hover::-webkit-scrollbar {
42
+ opacity: 1;
43
+ }
44
+
45
+ & > * {
46
+ content-visibility: auto;
47
+ contain-intrinsic-size: 100% 2em;
48
+ }
49
+ }
50
+ }
51
+
52
+ @media screen and (width <= 768px) {
53
+ .amll-lyric-player {
54
+ --amll-lp-line-width-aspect: 1;
55
+ --amll-lp-line-padding-x: 0;
56
+ }
57
+ }
58
+ .FmKaba_lyricLine {
59
+ backface-visibility: hidden;
60
+ transform-origin: 0;
61
+ width: var(--amll-lp-width, 100%);
62
+ min-width: var(--amll-lp-width, 100%);
63
+ max-width: var(--amll-lp-width, 100%);
64
+ contain: content;
65
+ will-change: transform;
66
+ box-sizing: border-box;
67
+ border-radius: .25em;
68
+ width: 100%;
69
+ height: fit-content;
70
+ padding: .5em 1em;
71
+ transition: opacity .25s, filter .2s, background-color .25s, box-shadow .25s;
72
+ position: absolute;
73
+
74
+ @media screen and (width <= 500px) {
75
+ padding-left: 20px;
76
+ padding-right: 20px;
77
+ }
78
+
79
+ &.FmKaba_dirty {
80
+ opacity: 0;
81
+ visibility: hidden;
82
+ }
83
+
84
+ &:has( > *):hover {
85
+ background-color: var(--amll-lp-hover-bg-color, #fff1);
86
+ }
87
+
88
+ &:has( > *):active {
89
+ background-color: var(--amll-lp-hover-bg-color, #ffffff05);
90
+ }
91
+ }
92
+
93
+ .FmKaba_lyricBgLine {
94
+ opacity: .0001;
95
+ font-size: max(calc(1em * var(--amll-lp-bg-line-scale, .7)), 10px);
96
+ padding: 1vh
97
+ calc(var(--amll-lp-line-padding-x, 1em) / var(--amll-lp-bg-line-scale, .7));
98
+ transition: opacity .25s, scale .5s, filter .2s, background-color .25s, box-shadow .25s;
99
+
100
+ &.FmKaba_active {
101
+ opacity: .4;
102
+ transition: opacity .5s .25s, scale 1.5s cubic-bezier(0, 1, 0, 1) .25s, filter .2s, background-color .25s, box-shadow .25s;
103
+ }
104
+ }
105
+
106
+ .amll-lyric-player {
107
+ &:hover .FmKaba_lyricLine {
108
+ filter: unset !important;
109
+ }
110
+
111
+ &.FmKaba_hasDuetLine {
112
+ & .FmKaba_lyricLine:not(.FmKaba_lyricDuetLine) {
113
+ padding-right: 15%;
114
+ }
115
+
116
+ & .FmKaba_lyricDuetLine {
117
+ padding-left: 15%;
118
+ }
119
+ }
120
+
121
+ &:not(.playing) > .FmKaba_lyricBgLine {
122
+ opacity: .4;
123
+ }
124
+ }
125
+
126
+ .FmKaba_lyricDuetLine {
127
+ text-align: right;
128
+ transform-origin: 100%;
129
+ }
130
+
131
+ .FmKaba_lyricMainLine {
132
+ margin: -1em;
133
+ padding: 1em;
134
+ transition: opacity .3s .1s;
135
+
136
+ & span {
137
+ text-align: start;
138
+ vertical-align: bottom;
139
+ display: inline-block;
140
+ }
141
+
142
+ & .FmKaba_romanWord {
143
+ padding-inline-end: .3em;
144
+ font-size: .5em;
145
+ line-height: 1em;
146
+ display: flex;
147
+ }
148
+
149
+ & .FmKaba_rubyWord {
150
+ justify-content: center;
151
+ min-height: 1em;
152
+ font-size: .5em;
153
+ line-height: 1em;
154
+ display: flex;
155
+ }
156
+
157
+ & .FmKaba_wordWithRuby {
158
+ vertical-align: bottom;
159
+ flex-direction: column;
160
+ align-items: center;
161
+ display: inline-flex;
162
+ }
163
+
164
+ & .FmKaba_wordBody {
165
+ flex-direction: column;
166
+ align-items: center;
167
+ display: flex;
168
+ }
169
+
170
+ & > span, & span.FmKaba_emphasizeWrapper {
171
+ white-space: pre-wrap;
172
+ will-change: transform;
173
+ vertical-align: bottom;
174
+ margin: -1em;
175
+ padding: 1em;
176
+ display: inline-block;
177
+
178
+ &.FmKaba_emphasize, & span.FmKaba_emphasize {
179
+ backface-visibility: hidden;
180
+ margin: -1em;
181
+ padding: 1em;
182
+
183
+ & > span {
184
+ will-change: transform;
185
+ backface-visibility: hidden;
186
+ margin: -1em;
187
+ padding: 1em;
188
+ }
189
+ }
190
+ }
191
+ }
192
+
193
+ .FmKaba_lyricSubLine {
194
+ opacity: .3;
195
+ font-size: max(.5em, 10px);
196
+ line-height: 1.5em;
197
+ transition: opacity .2s .25s;
198
+ }
199
+
200
+ .FmKaba_disableSpring > * {
201
+ transition: filter .25s, transform .5s, background-color .25s, box-shadow .25s;
202
+ }
203
+
204
+ .FmKaba_interludeDots {
205
+ transform-origin: center;
206
+ opacity: 0;
207
+ gap: .25em;
208
+ width: fit-content;
209
+ height: clamp(.5em, 1vh, 3em);
210
+ padding: 2.5% .75em;
211
+ transition: opacity .25s;
212
+ display: flex;
213
+ position: absolute;
214
+ left: 0;
215
+
216
+ &.FmKaba_enabled {
217
+ opacity: 1;
218
+ }
219
+
220
+ & > * {
221
+ aspect-ratio: 1;
222
+ background-color: var(--amll-lp-color, white);
223
+ border-radius: 50%;
224
+ width: clamp(.5em, 1vh, 3em);
225
+ height: clamp(.5em, 1vh, 3em);
226
+ margin-right: 4px;
227
+ display: inline-block;
228
+ }
229
+
230
+ &.FmKaba_duet {
231
+ transform-origin: center;
232
+ right: 0;
233
+ }
234
+ }
235
+
236
+ @supports (mix-blend-mode: plus-lighter) {
237
+ .FmKaba_lyricSubLine {
238
+ opacity: .3;
239
+ }
240
+ }
241
+
242
+ .FmKaba_tmpDisableTransition {
243
+ transition: none !important;
244
+ }
245
+
246
+ .FmKaba_bottomLine {
247
+ cursor: default;
248
+ padding-top: 0;
249
+ padding-bottom: 0;
250
+ line-height: 1.8em;
251
+ }
252
+
253
+ .FmKaba_bottomLine:empty {
254
+ height: 0;
255
+ margin: 0;
256
+ padding: 0;
257
+ display: none;
258
+ }
259
+ .KxF9Iq_lyricLine {
260
+ width: var(--amll-lp-width, 100%);
261
+ min-width: var(--amll-lp-width, 100%);
262
+ max-width: var(--amll-lp-width, 100%);
263
+ contain: content;
264
+ box-sizing: border-box;
265
+ border-radius: .25em;
266
+ width: 100%;
267
+ height: fit-content;
268
+ padding: 2vh 1em;
269
+ transition: opacity .25s, filter .2s, background-color .25s, box-shadow .25s;
270
+
271
+ &:has( > *):hover {
272
+ background-color: var(--amll-lp-hover-bg-color, #fff1);
273
+ }
274
+
275
+ &:has( > *):active {
276
+ background-color: var(--amll-lp-hover-bg-color, #ffffff05);
277
+ }
278
+ }
279
+
280
+ .KxF9Iq_lyricBgLine {
281
+ opacity: 0;
282
+ font-size: max(calc(1em * var(--amll-lp-bg-line-scale, .7)), 10px);
283
+ padding: 1vh
284
+ calc(var(--amll-lp-line-padding-x, 1em) / var(--amll-lp-bg-line-scale, .7));
285
+ transition: opacity .25s, scale .5s, filter .2s, background-color .25s, box-shadow .25s;
286
+
287
+ &.KxF9Iq_active {
288
+ opacity: .4;
289
+ transition: opacity .5s .25s, scale 1.5s cubic-bezier(0, 1, 0, 1) .25s, filter .2s, background-color .25s, box-shadow .25s;
290
+ }
291
+ }
292
+
293
+ .amll-lyric-player {
294
+ &:hover .KxF9Iq_lyricLine {
295
+ filter: unset !important;
296
+ }
297
+
298
+ &.KxF9Iq_hasDuetLine {
299
+ & .KxF9Iq_lyricLine:not(.KxF9Iq_lyricDuetLine) {
300
+ padding-right: 15%;
301
+ }
302
+
303
+ & .KxF9Iq_lyricDuetLine {
304
+ padding-left: 15%;
305
+ }
306
+ }
307
+ }
308
+
309
+ .KxF9Iq_lyricDuetLine {
310
+ text-align: right;
311
+ transform-origin: 100%;
312
+ }
313
+
314
+ .KxF9Iq_lyricMainLine {
315
+ contain: content paint;
316
+ transition: opacity .3s .1s;
317
+
318
+ & span {
319
+ white-space: pre;
320
+ display: inline-block;
321
+ }
322
+
323
+ & .KxF9Iq_romanWord {
324
+ font-size: .5em;
325
+ line-height: 1em;
326
+ display: flex;
327
+ }
328
+
329
+ & .KxF9Iq_rubyWord {
330
+ justify-content: center;
331
+ min-height: 1em;
332
+ font-size: .5em;
333
+ line-height: 1em;
334
+ display: flex;
335
+ }
336
+
337
+ & .KxF9Iq_wordWithRuby {
338
+ flex-direction: column;
339
+ align-items: center;
340
+ display: inline-flex;
341
+ }
342
+
343
+ & .KxF9Iq_wordBody {
344
+ flex-direction: column;
345
+ align-items: center;
346
+ display: flex;
347
+ }
348
+ }
349
+
350
+ .KxF9Iq_lyricSubLine {
351
+ opacity: .3;
352
+ font-size: max(.5em, 10px);
353
+ line-height: 1.5em;
354
+ transition: opacity .2s .25s;
355
+ }
356
+
357
+ .KxF9Iq_interludeDots {
358
+ transform-origin: center;
359
+ opacity: 0;
360
+ gap: .25em;
361
+ width: fit-content;
362
+ height: clamp(.5em, 1vh, 3em);
363
+ padding: 2.5% .75em;
364
+ transition: opacity .25s;
365
+ display: flex;
366
+ left: 0;
367
+
368
+ &.KxF9Iq_enabled {
369
+ opacity: 1;
370
+ }
371
+
372
+ & > * {
373
+ aspect-ratio: 1;
374
+ background-color: var(--amll-lp-color, white);
375
+ border-radius: 50%;
376
+ width: clamp(.5em, 1vh, 3em);
377
+ height: clamp(.5em, 1vh, 3em);
378
+ margin-right: 4px;
379
+ display: inline-block;
380
+ }
381
+
382
+ &.KxF9Iq_duet {
383
+ transform-origin: center;
384
+ right: 0;
385
+ }
386
+ }
387
+
388
+ @supports (mix-blend-mode: plus-lighter) {
389
+ .KxF9Iq_lyricSubLine {
390
+ opacity: .3;
391
+ }
392
+ }
393
+
394
+ .KxF9Iq_tmpDisableTransition {
395
+ transition: none !important;
396
+ }
package/package.json CHANGED
@@ -1,85 +1,70 @@
1
1
  {
2
- "name": "@applemusic-like-lyrics/core",
3
- "version": "0.3.2",
4
- "description": "AMLL 的纯 JS 核心组件框架,包括歌词显示组件和背景组件等其它可以复用的组件",
5
- "repository": {
6
- "url": "https://github.com/amll-dev/applemusic-like-lyrics.git",
7
- "directory": "packages/core",
8
- "type": "git"
9
- },
10
- "license": "GPL-3.0",
11
- "nx": {
12
- "tags": [
13
- "library"
14
- ],
15
- "targets": {
16
- "nx-release-publish": {
17
- "executor": "@nx/js:release-publish",
18
- "dependsOn": []
19
- }
20
- }
21
- },
22
- "files": [
23
- "dist/**/*.js",
24
- "dist/**/*.ts",
25
- "dist/**/*.cjs",
26
- "dist/**/*.css",
27
- "dist/**/*.map"
28
- ],
29
- "type": "module",
30
- "main": "./dist/amll-core.cjs",
31
- "module": "./dist/amll-core.js",
32
- "typings": "./dist/index.d.ts",
33
- "exports": {
34
- ".": {
35
- "types": "./dist/index.d.ts",
36
- "import": "./dist/amll-core.js",
37
- "require": "./dist/amll-core.cjs"
38
- },
39
- "./style.css": {
40
- "import": "./dist/amll-core.css",
41
- "require": "./dist/amll-core.css"
42
- }
43
- },
44
- "devDependencies": {
45
- "@biomejs/biome": "^2.4.8",
46
- "@types/deep-freeze": "^0.1.5",
47
- "@types/stats.js": "^0.17.3",
48
- "@types/ungap__structured-clone": "^1.2.0",
49
- "lil-gui": "^0.21.0",
50
- "stats.js": "^0.17.0",
51
- "typedoc": "^0.28.18",
52
- "typedoc-plugin-markdown": "^4.11.0",
53
- "typescript": "^5.9.3",
54
- "vite": "^8.0.1",
55
- "vite-plugin-dts": "^4.5.4",
56
- "vite-plugin-glsl": "^1.5.6",
57
- "vite-plugin-top-level-await": "^1.6.0",
58
- "vite-plugin-wasm": "^3.6.0",
59
- "@applemusic-like-lyrics/lyric": "^0.4.1",
60
- "@applemusic-like-lyrics/ttml": "^0.2.0"
61
- },
62
- "peerDependencies": {
63
- "@pixi/app": "*",
64
- "@pixi/core": "*",
65
- "@pixi/display": "*",
66
- "@pixi/filter-blur": "*",
67
- "@pixi/filter-bulge-pinch": "*",
68
- "@pixi/filter-color-matrix": "*",
69
- "@pixi/sprite": "*"
70
- },
71
- "dependencies": {
72
- "@ungap/structured-clone": "^1.3.0",
73
- "bezier-easing": "^3.0.0",
74
- "deep-freeze": "^0.0.1",
75
- "gl-matrix": "4.0.0-beta.2"
76
- },
77
- "scripts": {
78
- "build:docs": "typedoc --plugin typedoc-plugin-markdown --out docs src/index.ts",
79
- "build": "vite build",
80
- "build:dev": "vite build",
81
- "fmt": "biome format --write ./src",
82
- "dev": "vite dev",
83
- "preinstall": "npx only-allow pnpm"
84
- }
85
- }
2
+ "name": "@applemusic-like-lyrics/core",
3
+ "version": "0.4.1",
4
+ "description": "AMLL 的纯 JS 核心组件框架,包括歌词显示组件和背景组件等其它可以复用的组件",
5
+ "repository": {
6
+ "url": "https://github.com/amll-dev/applemusic-like-lyrics.git",
7
+ "directory": "packages/core",
8
+ "type": "git"
9
+ },
10
+ "license": "GPL-3.0",
11
+ "files": [
12
+ "dist"
13
+ ],
14
+ "scripts": {
15
+ "build:docs": "typedoc --plugin typedoc-plugin-markdown --out docs src/index.ts",
16
+ "typecheck": "tsgo -b",
17
+ "build-only": "tsdown",
18
+ "build": "run-p typecheck \"build-only {@}\" --",
19
+ "build:dev": "tsdown",
20
+ "fmt": "biome format --write ./src",
21
+ "dev": "nx run @applemusic-like-lyrics/playground-core:dev"
22
+ },
23
+ "type": "module",
24
+ "main": "./dist/amll-core.cjs",
25
+ "module": "./dist/amll-core.mjs",
26
+ "typings": "./dist/amll-core.d.mts",
27
+ "exports": {
28
+ ".": {
29
+ "import": {
30
+ "types": "./dist/amll-core.d.mts",
31
+ "default": "./dist/amll-core.mjs"
32
+ },
33
+ "require": {
34
+ "types": "./dist/amll-core.d.cts",
35
+ "default": "./dist/amll-core.cjs"
36
+ }
37
+ },
38
+ "./style.css": {
39
+ "import": "./dist/style.css",
40
+ "require": "./dist/style.css"
41
+ }
42
+ },
43
+ "devDependencies": {
44
+ "@biomejs/biome": "^2.4.8",
45
+ "@types/deep-freeze": "^0.1.5",
46
+ "@types/stats.js": "^0.17.3",
47
+ "@types/ungap__structured-clone": "^1.2.0",
48
+ "lil-gui": "^0.21.0",
49
+ "stats.js": "^0.17.0",
50
+ "typedoc": "^0.28.18",
51
+ "typedoc-plugin-markdown": "^4.11.0",
52
+ "@tsdown/css": "^0.21.9",
53
+ "tsdown": "^0.21.9"
54
+ },
55
+ "peerDependencies": {
56
+ "@pixi/app": "*",
57
+ "@pixi/core": "*",
58
+ "@pixi/display": "*",
59
+ "@pixi/filter-blur": "*",
60
+ "@pixi/filter-bulge-pinch": "*",
61
+ "@pixi/filter-color-matrix": "*",
62
+ "@pixi/sprite": "*"
63
+ },
64
+ "dependencies": {
65
+ "@ungap/structured-clone": "^1.3.0",
66
+ "bezier-easing": "^3.0.0",
67
+ "deep-freeze": "^0.0.1",
68
+ "gl-matrix": "4.0.0-beta.2"
69
+ }
70
+ }