@applemusic-like-lyrics/core 0.5.0 → 0.5.2

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/dist/style.css CHANGED
@@ -29,76 +29,46 @@
29
29
  --amll-lp-line-padding-x: 0;
30
30
  }
31
31
  }
32
- .FmKaba_lyricLine {
33
- backface-visibility: hidden;
34
- transform-origin: 0;
35
- width: var(--amll-lp-width, 100%);
36
- min-width: var(--amll-lp-width, 100%);
37
- max-width: var(--amll-lp-width, 100%);
38
- contain: content;
39
- will-change: transform;
32
+ .FmKaba_lyricLineWrapper {
40
33
  box-sizing: border-box;
41
- border-radius: .25em;
42
34
  width: 100%;
43
- height: fit-content;
44
- padding: .5em 1em;
45
- transition: opacity .25s, filter .2s, background-color .25s, box-shadow .25s;
35
+ padding: .4em var(--lyric-line-padding-x);
36
+ will-change: transform, opacity, filter;
37
+ border-radius: .25em;
38
+ flex-direction: column;
39
+ align-items: flex-start;
40
+ gap: .3em;
41
+ transition: opacity .4s, filter .4s, background-color .25s;
42
+ display: flex;
46
43
  position: absolute;
44
+ top: 0;
45
+ left: 0;
47
46
 
48
- @media screen and (width <= 500px) {
49
- padding-left: 20px;
50
- padding-right: 20px;
51
- }
52
-
53
- &.FmKaba_dirty {
54
- opacity: 0;
55
- visibility: hidden;
56
- }
57
-
58
- &:has( > *):hover {
47
+ &:hover {
59
48
  background-color: var(--amll-lp-hover-bg-color, #fff1);
60
49
  }
61
50
 
62
- &:has( > *):active {
51
+ &:active {
63
52
  background-color: var(--amll-lp-hover-bg-color, #ffffff05);
64
53
  }
65
54
  }
66
55
 
67
- .FmKaba_lyricBgLine {
68
- opacity: .0001;
69
- font-size: max(calc(1em * var(--amll-lp-bg-line-scale, .7)), 10px);
70
- padding: 1vh
71
- calc(var(--amll-lp-line-padding-x, 1em) / var(--amll-lp-bg-line-scale, .7));
72
- transition: opacity .25s, scale .5s, filter .2s, background-color .25s, box-shadow .25s;
73
-
74
- & .FmKaba_lyricMainLine {
75
- padding: 1.2em 1em;
76
- }
77
-
78
- &.FmKaba_active {
79
- opacity: .4;
80
- transition: opacity .5s .25s, scale 1.5s cubic-bezier(0, 1, 0, 1) .25s, filter .2s, background-color .25s, box-shadow .25s;
81
- }
82
- }
83
-
84
- .amll-lyric-player {
85
- &:hover .FmKaba_lyricLine {
86
- filter: unset !important;
87
- }
88
-
89
- &.FmKaba_hasDuetLine {
90
- & .FmKaba_lyricLine:not(.FmKaba_lyricDuetLine) {
91
- padding-right: 15%;
92
- }
93
-
94
- & .FmKaba_lyricDuetLine {
95
- padding-left: 15%;
96
- }
97
- }
98
-
99
- &:not(.playing) > .FmKaba_lyricBgLine {
100
- opacity: .4;
101
- }
56
+ .FmKaba_lyricLine {
57
+ box-sizing: border-box;
58
+ width: var(--amll-lp-width, 100%);
59
+ min-width: var(--amll-lp-width, 100%);
60
+ max-width: var(--amll-lp-width, 100%);
61
+ contain: layout style paint;
62
+ content-visibility: auto;
63
+ contain-intrinsic-size: auto 40px;
64
+ backface-visibility: hidden;
65
+ transform-origin: 0;
66
+ will-change: transform, filter, opacity;
67
+ height: fit-content;
68
+ margin: -.2em;
69
+ padding: .2em;
70
+ transition: box-shadow .25s;
71
+ position: relative;
102
72
  }
103
73
 
104
74
  .FmKaba_lyricDuetLine {
@@ -107,6 +77,7 @@
107
77
  }
108
78
 
109
79
  .FmKaba_lyricMainLine {
80
+ contain: layout style;
110
81
  margin: -1em;
111
82
  padding: 1em;
112
83
  transition: opacity .3s .1s;
@@ -147,8 +118,9 @@
147
118
 
148
119
  & > span, & span.FmKaba_emphasizeWrapper {
149
120
  white-space: pre-wrap;
150
- will-change: transform;
151
121
  vertical-align: bottom;
122
+ will-change: transform, text-shadow;
123
+ contain: layout style;
152
124
  margin: -1em;
153
125
  padding: 1em;
154
126
  display: inline-block;
@@ -159,7 +131,7 @@
159
131
  padding: 1em;
160
132
 
161
133
  & > span {
162
- will-change: transform;
134
+ will-change: transform, text-shadow;
163
135
  backface-visibility: hidden;
164
136
  margin: -1em;
165
137
  padding: 1em;
@@ -168,20 +140,89 @@
168
140
  }
169
141
  }
170
142
 
143
+ .FmKaba_lyricBgLine {
144
+ opacity: .4;
145
+ font-size: max(calc(1em * var(--amll-lp-bg-line-scale, .7)), 10px);
146
+ transition: background-color .25s, box-shadow .25s;
147
+
148
+ & .FmKaba_lyricMainLine {
149
+ padding: 1.2em 1em;
150
+ }
151
+
152
+ &.FmKaba_active {
153
+ opacity: .4;
154
+ transition: background-color .25s, box-shadow .25s;
155
+ }
156
+ }
157
+
171
158
  .FmKaba_lyricSubLine {
172
159
  opacity: .3;
173
160
  font-size: max(.5em, 10px);
174
161
  line-height: 1.5em;
175
162
  transition: opacity .2s .25s;
163
+
164
+ @supports (mix-blend-mode: plus-lighter) {
165
+ opacity: .3;
166
+ }
176
167
  }
177
168
 
178
- .FmKaba_disableSpring > * {
179
- transition: filter .25s, transform .5s, background-color .25s, box-shadow .25s;
169
+ .FmKaba_bottomLine {
170
+ cursor: default;
171
+ padding-top: 0;
172
+ padding-bottom: 0;
173
+ line-height: 1.8em;
174
+
175
+ &:empty {
176
+ height: 0;
177
+ margin: 0;
178
+ padding: 0;
179
+ display: none;
180
+ }
181
+ }
182
+
183
+ .FmKaba_bgWrapper {
184
+ top: 100%;
185
+ left: var(--lyric-line-padding-x);
186
+ z-index: -1;
187
+ align-items: inherit;
188
+ width: calc(100% - var(--lyric-line-padding-x) * 2);
189
+ visibility: visible;
190
+ pointer-events: auto;
191
+ opacity: 0;
192
+ transform-origin: 0 0;
193
+ flex-direction: column;
194
+ transition: opacity .3s;
195
+ display: flex;
196
+ position: absolute;
197
+ }
198
+
199
+ .FmKaba_bgWrapperTop {
200
+ transform-origin: 0 100%;
201
+ width: 100%;
202
+ margin-top: -999px;
203
+ position: relative;
204
+ top: auto;
205
+ bottom: auto;
206
+ left: 0;
207
+ }
208
+
209
+ .FmKaba_bgWrapperActive {
210
+ opacity: 1;
211
+ width: 100%;
212
+ position: relative;
213
+ top: auto;
214
+ bottom: auto;
215
+ left: 0;
216
+ }
217
+
218
+ .FmKaba_bgWrapperHidden {
219
+ visibility: hidden;
220
+ pointer-events: none;
180
221
  }
181
222
 
182
223
  .FmKaba_interludeDots {
183
- transform-origin: center;
184
224
  opacity: 0;
225
+ transform-origin: center;
185
226
  gap: .25em;
186
227
  width: fit-content;
187
228
  height: clamp(.5em, 1vh, 3em);
@@ -196,8 +237,8 @@
196
237
  }
197
238
 
198
239
  & > * {
199
- aspect-ratio: 1;
200
240
  background-color: var(--amll-lp-color, white);
241
+ aspect-ratio: 1;
201
242
  border-radius: 50%;
202
243
  width: clamp(.5em, 1vh, 3em);
203
244
  height: clamp(.5em, 1vh, 3em);
@@ -211,26 +252,53 @@
211
252
  }
212
253
  }
213
254
 
214
- @supports (mix-blend-mode: plus-lighter) {
215
- .FmKaba_lyricSubLine {
216
- opacity: .3;
217
- }
255
+ .FmKaba_disableSpring > *, .FmKaba_disableSpring .FmKaba_lyricLine {
256
+ transition: filter .25s, transform .5s, background-color .25s, box-shadow .25s;
218
257
  }
219
258
 
220
259
  .FmKaba_tmpDisableTransition {
221
260
  transition: none !important;
222
261
  }
223
262
 
224
- .FmKaba_bottomLine {
225
- cursor: default;
226
- padding-top: 0;
227
- padding-bottom: 0;
228
- line-height: 1.8em;
229
- }
263
+ .amll-lyric-player {
264
+ --lyric-line-padding-x: 1em;
265
+
266
+ @media screen and (width <= 500px) {
267
+ --lyric-line-padding-x: 20px;
268
+ }
269
+
270
+ &:hover .FmKaba_lyricLine, &:hover .FmKaba_lyricLineWrapper {
271
+ filter: unset !important;
272
+ }
273
+
274
+ &:not(.FmKaba_playing) .FmKaba_bgWrapper {
275
+ opacity: 1;
276
+ width: 100%;
277
+ position: relative;
278
+ top: auto;
279
+ bottom: auto;
280
+ left: 0;
281
+ }
282
+
283
+ &.FmKaba_hasDuetLine {
284
+ & .FmKaba_lyricLine:not(.FmKaba_lyricDuetLine) {
285
+ padding-right: 15%;
286
+ }
287
+
288
+ & .FmKaba_lyricDuetLine {
289
+ padding-left: 15%;
290
+ }
291
+
292
+ & .FmKaba_lyricLineWrapper:has(.FmKaba_lyricDuetLine) {
293
+ align-items: flex-end;
294
+
295
+ & .FmKaba_bgWrapper {
296
+ transform-origin: 100% 0;
297
+ }
230
298
 
231
- .FmKaba_bottomLine:empty {
232
- height: 0;
233
- margin: 0;
234
- padding: 0;
235
- display: none;
299
+ & .FmKaba_bgWrapperTop {
300
+ transform-origin: 100% 100%;
301
+ }
302
+ }
303
+ }
236
304
  }
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@applemusic-like-lyrics/core",
3
- "version": "0.5.0",
3
+ "version": "0.5.2",
4
4
  "description": "AMLL 的纯 JS 核心组件框架,包括歌词显示组件和背景组件等其它可以复用的组件",
5
5
  "repository": {
6
6
  "url": "https://github.com/amll-dev/applemusic-like-lyrics.git",
7
7
  "directory": "packages/core",
8
8
  "type": "git"
9
9
  },
10
- "license": "GPL-3.0",
10
+ "license": "AGPL-3.0-only",
11
11
  "nx": {
12
12
  "tags": [
13
13
  "library"
@@ -58,8 +58,8 @@
58
58
  "stats.js": "^0.17.0",
59
59
  "typedoc": "^0.28.18",
60
60
  "typedoc-plugin-markdown": "^4.11.0",
61
- "@tsdown/css": "^0.21.9",
62
- "tsdown": "^0.21.9"
61
+ "@tsdown/css": "^0.22.0",
62
+ "tsdown": "^0.22.0"
63
63
  },
64
64
  "peerDependencies": {
65
65
  "@pixi/app": "*",