@applemusic-like-lyrics/core 0.5.1 → 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
@@ -30,15 +30,27 @@
30
30
  }
31
31
  }
32
32
  .FmKaba_lyricLineWrapper {
33
+ box-sizing: border-box;
34
+ width: 100%;
35
+ padding: .4em var(--lyric-line-padding-x);
33
36
  will-change: transform, opacity, filter;
37
+ border-radius: .25em;
34
38
  flex-direction: column;
35
39
  align-items: flex-start;
36
- width: 100%;
37
- transition: opacity .4s, filter .4s;
40
+ gap: .3em;
41
+ transition: opacity .4s, filter .4s, background-color .25s;
38
42
  display: flex;
39
43
  position: absolute;
40
44
  top: 0;
41
45
  left: 0;
46
+
47
+ &:hover {
48
+ background-color: var(--amll-lp-hover-bg-color, #fff1);
49
+ }
50
+
51
+ &:active {
52
+ background-color: var(--amll-lp-hover-bg-color, #ffffff05);
53
+ }
42
54
  }
43
55
 
44
56
  .FmKaba_lyricLine {
@@ -46,33 +58,17 @@
46
58
  width: var(--amll-lp-width, 100%);
47
59
  min-width: var(--amll-lp-width, 100%);
48
60
  max-width: var(--amll-lp-width, 100%);
49
- contain: content;
61
+ contain: layout style paint;
62
+ content-visibility: auto;
63
+ contain-intrinsic-size: auto 40px;
50
64
  backface-visibility: hidden;
51
65
  transform-origin: 0;
52
- will-change: transform;
53
- border-radius: .25em;
66
+ will-change: transform, filter, opacity;
54
67
  height: fit-content;
55
- padding: .5em 1em;
56
- transition: background-color .25s, box-shadow .25s;
68
+ margin: -.2em;
69
+ padding: .2em;
70
+ transition: box-shadow .25s;
57
71
  position: relative;
58
-
59
- @media screen and (width <= 500px) {
60
- padding-left: 20px;
61
- padding-right: 20px;
62
- }
63
-
64
- &.FmKaba_dirty {
65
- opacity: 0;
66
- visibility: hidden;
67
- }
68
-
69
- &:has( > *):hover {
70
- background-color: var(--amll-lp-hover-bg-color, #fff1);
71
- }
72
-
73
- &:has( > *):active {
74
- background-color: var(--amll-lp-hover-bg-color, #ffffff05);
75
- }
76
72
  }
77
73
 
78
74
  .FmKaba_lyricDuetLine {
@@ -81,6 +77,7 @@
81
77
  }
82
78
 
83
79
  .FmKaba_lyricMainLine {
80
+ contain: layout style;
84
81
  margin: -1em;
85
82
  padding: 1em;
86
83
  transition: opacity .3s .1s;
@@ -122,7 +119,8 @@
122
119
  & > span, & span.FmKaba_emphasizeWrapper {
123
120
  white-space: pre-wrap;
124
121
  vertical-align: bottom;
125
- will-change: transform;
122
+ will-change: transform, text-shadow;
123
+ contain: layout style;
126
124
  margin: -1em;
127
125
  padding: 1em;
128
126
  display: inline-block;
@@ -133,7 +131,7 @@
133
131
  padding: 1em;
134
132
 
135
133
  & > span {
136
- will-change: transform;
134
+ will-change: transform, text-shadow;
137
135
  backface-visibility: hidden;
138
136
  margin: -1em;
139
137
  padding: 1em;
@@ -144,8 +142,6 @@
144
142
 
145
143
  .FmKaba_lyricBgLine {
146
144
  opacity: .4;
147
- padding: 1vh
148
- calc(var(--amll-lp-line-padding-x, 1em) / var(--amll-lp-bg-line-scale, .7));
149
145
  font-size: max(calc(1em * var(--amll-lp-bg-line-scale, .7)), 10px);
150
146
  transition: background-color .25s, box-shadow .25s;
151
147
 
@@ -185,34 +181,38 @@
185
181
  }
186
182
 
187
183
  .FmKaba_bgWrapper {
184
+ top: 100%;
185
+ left: var(--lyric-line-padding-x);
188
186
  z-index: -1;
189
187
  align-items: inherit;
188
+ width: calc(100% - var(--lyric-line-padding-x) * 2);
190
189
  visibility: visible;
191
190
  pointer-events: auto;
192
191
  opacity: 0;
193
- width: 100%;
194
- transform-origin: var(--lyric-line-padding-x) top;
192
+ transform-origin: 0 0;
195
193
  flex-direction: column;
196
194
  transition: opacity .3s;
197
195
  display: flex;
198
196
  position: absolute;
199
- top: 100%;
200
- left: 0;
201
197
  }
202
198
 
203
199
  .FmKaba_bgWrapperTop {
204
- transform-origin: var(--lyric-line-padding-x) bottom;
200
+ transform-origin: 0 100%;
201
+ width: 100%;
205
202
  margin-top: -999px;
206
203
  position: relative;
207
204
  top: auto;
208
205
  bottom: auto;
206
+ left: 0;
209
207
  }
210
208
 
211
209
  .FmKaba_bgWrapperActive {
212
210
  opacity: 1;
211
+ width: 100%;
213
212
  position: relative;
214
213
  top: auto;
215
214
  bottom: auto;
215
+ left: 0;
216
216
  }
217
217
 
218
218
  .FmKaba_bgWrapperHidden {
@@ -271,6 +271,15 @@
271
271
  filter: unset !important;
272
272
  }
273
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
+
274
283
  &.FmKaba_hasDuetLine {
275
284
  & .FmKaba_lyricLine:not(.FmKaba_lyricDuetLine) {
276
285
  padding-right: 15%;
@@ -284,19 +293,12 @@
284
293
  align-items: flex-end;
285
294
 
286
295
  & .FmKaba_bgWrapper {
287
- transform-origin: calc(100% - var(--lyric-line-padding-x)) top;
296
+ transform-origin: 100% 0;
288
297
  }
289
298
 
290
299
  & .FmKaba_bgWrapperTop {
291
- transform-origin: calc(100% - var(--lyric-line-padding-x)) bottom;
300
+ transform-origin: 100% 100%;
292
301
  }
293
302
  }
294
303
  }
295
-
296
- &:not(.FmKaba_playing) .FmKaba_bgWrapper {
297
- opacity: 1;
298
- position: relative;
299
- top: auto;
300
- bottom: auto;
301
- }
302
304
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applemusic-like-lyrics/core",
3
- "version": "0.5.1",
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",
@@ -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": "*",