@applemusic-like-lyrics/core 0.3.1 → 0.4.0

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 +5020 -0
  3. package/dist/amll-core.cjs.map +1 -0
  4. package/dist/amll-core.d.cts +997 -0
  5. package/dist/amll-core.d.mts +997 -0
  6. package/dist/{amll-core.js → amll-core.mjs} +87 -5786
  7. package/dist/amll-core.mjs.map +1 -0
  8. package/dist/style.css +399 -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,399 @@
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
+ text-wrap: balance;
133
+ word-break: keep-all;
134
+ overflow-wrap: break-word;
135
+ margin: -1em;
136
+ padding: 1em;
137
+ transition: opacity .3s .1s;
138
+
139
+ & span {
140
+ text-align: start;
141
+ vertical-align: bottom;
142
+ display: inline-block;
143
+ }
144
+
145
+ & .FmKaba_romanWord {
146
+ padding-inline-end: .3em;
147
+ font-size: .5em;
148
+ line-height: 1em;
149
+ display: flex;
150
+ }
151
+
152
+ & .FmKaba_rubyWord {
153
+ justify-content: center;
154
+ min-height: 1em;
155
+ font-size: .5em;
156
+ line-height: 1em;
157
+ display: flex;
158
+ }
159
+
160
+ & .FmKaba_wordWithRuby {
161
+ vertical-align: bottom;
162
+ flex-direction: column;
163
+ align-items: center;
164
+ display: inline-flex;
165
+ }
166
+
167
+ & .FmKaba_wordBody {
168
+ flex-direction: column;
169
+ align-items: center;
170
+ display: flex;
171
+ }
172
+
173
+ & > span, & span.FmKaba_emphasizeWrapper {
174
+ white-space: pre-wrap;
175
+ will-change: transform;
176
+ vertical-align: bottom;
177
+ margin: -1em;
178
+ padding: 1em;
179
+ display: inline-block;
180
+
181
+ &.FmKaba_emphasize, & span.FmKaba_emphasize {
182
+ backface-visibility: hidden;
183
+ margin: -1em;
184
+ padding: 1em;
185
+
186
+ & > span {
187
+ will-change: transform;
188
+ backface-visibility: hidden;
189
+ margin: -1em;
190
+ padding: 1em;
191
+ }
192
+ }
193
+ }
194
+ }
195
+
196
+ .FmKaba_lyricSubLine {
197
+ opacity: .3;
198
+ font-size: max(.5em, 10px);
199
+ line-height: 1.5em;
200
+ transition: opacity .2s .25s;
201
+ }
202
+
203
+ .FmKaba_disableSpring > * {
204
+ transition: filter .25s, transform .5s, background-color .25s, box-shadow .25s;
205
+ }
206
+
207
+ .FmKaba_interludeDots {
208
+ transform-origin: center;
209
+ opacity: 0;
210
+ gap: .25em;
211
+ width: fit-content;
212
+ height: clamp(.5em, 1vh, 3em);
213
+ padding: 2.5% .75em;
214
+ transition: opacity .25s;
215
+ display: flex;
216
+ position: absolute;
217
+ left: 0;
218
+
219
+ &.FmKaba_enabled {
220
+ opacity: 1;
221
+ }
222
+
223
+ & > * {
224
+ aspect-ratio: 1;
225
+ background-color: var(--amll-lp-color, white);
226
+ border-radius: 50%;
227
+ width: clamp(.5em, 1vh, 3em);
228
+ height: clamp(.5em, 1vh, 3em);
229
+ margin-right: 4px;
230
+ display: inline-block;
231
+ }
232
+
233
+ &.FmKaba_duet {
234
+ transform-origin: center;
235
+ right: 0;
236
+ }
237
+ }
238
+
239
+ @supports (mix-blend-mode: plus-lighter) {
240
+ .FmKaba_lyricSubLine {
241
+ opacity: .3;
242
+ }
243
+ }
244
+
245
+ .FmKaba_tmpDisableTransition {
246
+ transition: none !important;
247
+ }
248
+
249
+ .FmKaba_bottomLine {
250
+ cursor: default;
251
+ padding-top: 0;
252
+ padding-bottom: 0;
253
+ line-height: 1.8em;
254
+ }
255
+
256
+ .FmKaba_bottomLine:empty {
257
+ height: 0;
258
+ margin: 0;
259
+ padding: 0;
260
+ display: none;
261
+ }
262
+ .KxF9Iq_lyricLine {
263
+ width: var(--amll-lp-width, 100%);
264
+ min-width: var(--amll-lp-width, 100%);
265
+ max-width: var(--amll-lp-width, 100%);
266
+ contain: content;
267
+ box-sizing: border-box;
268
+ border-radius: .25em;
269
+ width: 100%;
270
+ height: fit-content;
271
+ padding: 2vh 1em;
272
+ transition: opacity .25s, filter .2s, background-color .25s, box-shadow .25s;
273
+
274
+ &:has( > *):hover {
275
+ background-color: var(--amll-lp-hover-bg-color, #fff1);
276
+ }
277
+
278
+ &:has( > *):active {
279
+ background-color: var(--amll-lp-hover-bg-color, #ffffff05);
280
+ }
281
+ }
282
+
283
+ .KxF9Iq_lyricBgLine {
284
+ opacity: 0;
285
+ font-size: max(calc(1em * var(--amll-lp-bg-line-scale, .7)), 10px);
286
+ padding: 1vh
287
+ calc(var(--amll-lp-line-padding-x, 1em) / var(--amll-lp-bg-line-scale, .7));
288
+ transition: opacity .25s, scale .5s, filter .2s, background-color .25s, box-shadow .25s;
289
+
290
+ &.KxF9Iq_active {
291
+ opacity: .4;
292
+ transition: opacity .5s .25s, scale 1.5s cubic-bezier(0, 1, 0, 1) .25s, filter .2s, background-color .25s, box-shadow .25s;
293
+ }
294
+ }
295
+
296
+ .amll-lyric-player {
297
+ &:hover .KxF9Iq_lyricLine {
298
+ filter: unset !important;
299
+ }
300
+
301
+ &.KxF9Iq_hasDuetLine {
302
+ & .KxF9Iq_lyricLine:not(.KxF9Iq_lyricDuetLine) {
303
+ padding-right: 15%;
304
+ }
305
+
306
+ & .KxF9Iq_lyricDuetLine {
307
+ padding-left: 15%;
308
+ }
309
+ }
310
+ }
311
+
312
+ .KxF9Iq_lyricDuetLine {
313
+ text-align: right;
314
+ transform-origin: 100%;
315
+ }
316
+
317
+ .KxF9Iq_lyricMainLine {
318
+ contain: content paint;
319
+ transition: opacity .3s .1s;
320
+
321
+ & span {
322
+ white-space: pre;
323
+ display: inline-block;
324
+ }
325
+
326
+ & .KxF9Iq_romanWord {
327
+ font-size: .5em;
328
+ line-height: 1em;
329
+ display: flex;
330
+ }
331
+
332
+ & .KxF9Iq_rubyWord {
333
+ justify-content: center;
334
+ min-height: 1em;
335
+ font-size: .5em;
336
+ line-height: 1em;
337
+ display: flex;
338
+ }
339
+
340
+ & .KxF9Iq_wordWithRuby {
341
+ flex-direction: column;
342
+ align-items: center;
343
+ display: inline-flex;
344
+ }
345
+
346
+ & .KxF9Iq_wordBody {
347
+ flex-direction: column;
348
+ align-items: center;
349
+ display: flex;
350
+ }
351
+ }
352
+
353
+ .KxF9Iq_lyricSubLine {
354
+ opacity: .3;
355
+ font-size: max(.5em, 10px);
356
+ line-height: 1.5em;
357
+ transition: opacity .2s .25s;
358
+ }
359
+
360
+ .KxF9Iq_interludeDots {
361
+ transform-origin: center;
362
+ opacity: 0;
363
+ gap: .25em;
364
+ width: fit-content;
365
+ height: clamp(.5em, 1vh, 3em);
366
+ padding: 2.5% .75em;
367
+ transition: opacity .25s;
368
+ display: flex;
369
+ left: 0;
370
+
371
+ &.KxF9Iq_enabled {
372
+ opacity: 1;
373
+ }
374
+
375
+ & > * {
376
+ aspect-ratio: 1;
377
+ background-color: var(--amll-lp-color, white);
378
+ border-radius: 50%;
379
+ width: clamp(.5em, 1vh, 3em);
380
+ height: clamp(.5em, 1vh, 3em);
381
+ margin-right: 4px;
382
+ display: inline-block;
383
+ }
384
+
385
+ &.KxF9Iq_duet {
386
+ transform-origin: center;
387
+ right: 0;
388
+ }
389
+ }
390
+
391
+ @supports (mix-blend-mode: plus-lighter) {
392
+ .KxF9Iq_lyricSubLine {
393
+ opacity: .3;
394
+ }
395
+ }
396
+
397
+ .KxF9Iq_tmpDisableTransition {
398
+ transition: none !important;
399
+ }
package/package.json CHANGED
@@ -1,85 +1,70 @@
1
1
  {
2
- "name": "@applemusic-like-lyrics/core",
3
- "version": "0.3.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
- "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.17",
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.0",
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.7",
53
+ "tsdown": "^0.21.7"
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
+ }