-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMMM-MusicAssistant.css
More file actions
236 lines (202 loc) · 5.69 KB
/
Copy pathMMM-MusicAssistant.css
File metadata and controls
236 lines (202 loc) · 5.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
/* MMM-MusicAssistant.css */
/* Pull a color emoji font from Google Fonts so emoji in titles render without
the user installing any OS font. Falls back to the OS emoji font (and finally
a tofu box) if the mirror has no internet at load time. @import must stay at
the top of the file, before any rules. */
@import url("https://fonts.googleapis.com/css2?family=Noto+Color+Emoji");
.mma {
--mma-width: 340px;
--mma-art: 84px;
--mma-accent: #ffffff;
position: relative;
width: var(--mma-width);
border-radius: 14px;
animation: mma-fade 0.6s ease;
/* Keep MagicMirror's Roboto for text, but fall through to an emoji font for
glyphs Roboto lacks (e.g. an emoji in a song title) instead of drawing a
"missing glyph" box. The browser picks the right font per-glyph. */
font-family: "Roboto", "Roboto Condensed", "Noto Color Emoji",
"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", sans-serif;
}
.mma-hidden {
display: none;
}
@keyframes mma-fade {
from {
opacity: 0;
transform: translateY(6px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
/* ---- blurred album-art background layout ---- */
.mma-background {
padding: 16px;
}
.mma-bg {
position: absolute;
inset: -30px;
background-size: cover;
background-position: center;
filter: blur(16px) brightness(0.45) saturate(1.2);
/* translateZ(0) forces the blurred art onto its own GPU layer so the blur is
rasterized once and is NOT re-painted when the foreground card/progress bar
updates. The background art is loaded at a small size (it's blurred anyway),
so this layer's texture stays cheap. (Avoid will-change here: holding it
permanently keeps an oversized backing store and can cost more than it saves.) */
transform: scale(1.1) translateZ(0);
z-index: 0;
/* Feather the blurred art to transparent so it dissolves into the black mirror
screen. A single radial gradient softens all four sides and the corners in one
pass -- cheaper than intersecting two linear masks (no extra composite step).
The parent must NOT clip (no overflow:hidden) or the feather is cut away. */
-webkit-mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
}
/* backgroundBlur: false -> no .mma-bg layer; give the card a flat dark panel so
the text stays readable without the GPU-heavy blurred-art layer. */
.mma-background.mma-flat {
background: rgba(18, 18, 18, 0.55);
}
.mma-background .mma-card,
.mma-background .mma-nextup {
position: relative;
z-index: 1;
}
/* ---- now-playing card ---- */
.mma-card {
display: flex;
align-items: center;
gap: 14px;
}
.mma-beside {
padding: 6px 0;
}
.mma-art {
width: var(--mma-art);
height: var(--mma-art);
border-radius: 8px;
object-fit: cover;
box-shadow: 0 4px 14px rgba(0, 0, 0, 0.55);
flex: 0 0 auto;
}
.mma-info {
flex: 1 1 auto;
min-width: 0;
}
.mma-title,
.mma-artist,
.mma-album {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.mma-title {
font-size: 17px;
font-weight: 600;
line-height: 1.25;
}
.mma-artist {
font-size: 14px;
opacity: 0.92;
margin-top: 1px;
}
.mma-album {
font-size: 12px;
margin-top: 1px;
}
/* ---- progress bar ---- */
.mma-progress {
margin-top: 9px;
}
.mma-bar {
position: relative;
height: 4px;
border-radius: 4px;
background: rgba(255, 255, 255, 0.22);
overflow: visible;
}
.mma-bar-fill {
position: absolute;
left: 0;
top: 0;
height: 100%;
width: 100%;
border-radius: 4px;
background: var(--mma-accent);
/* Scale the fill with --mma-pct (0..1, inherited from .mma-bar). We DO smooth
the once-a-second step, but only via `transform` -- a transform transition
runs on the compositor thread (the element gets its own layer), so the glide
is GPU compositing of cached textures, NOT a per-frame main-thread repaint
over the heavy blur(26px) + mask background. That keeps it smooth and cheap.
Duration --mma-anim is set from updateProgressInterval so it tracks, not
overshoots, the tick rate. */
transform-origin: left center;
transform: scaleX(var(--mma-pct, 0));
transition: transform var(--mma-anim, 0.9s) linear;
}
.mma-bar-knob {
/* Sibling of the fill (not a child), so it is never distorted by the fill's
scaleX. Position is driven by --mma-knob-x (px along the bar, computed from
the measured bar width) via transform/translate -- same compositor-only path
as the fill, so it glides smoothly without a main-thread `left` animation. */
position: absolute;
top: 50%;
left: 0;
margin-left: -4.5px; /* center the 9px dot on its position */
width: 9px;
height: 9px;
border-radius: 50%;
background: var(--mma-accent);
transform: translate(var(--mma-knob-x, 0px), -50%);
transition: transform var(--mma-anim, 0.9s) linear;
box-shadow: 0 0 6px rgba(255, 255, 255, 0.5);
}
.mma-times {
display: flex;
justify-content: space-between;
margin-top: 5px;
font-variant-numeric: tabular-nums;
}
/* ---- next up ---- */
.mma-nextup {
margin-top: 14px;
padding-top: 10px;
border-top: 1px solid rgba(255, 255, 255, 0.12);
}
.mma-nextup-heading {
text-transform: uppercase;
letter-spacing: 0.08em;
margin-bottom: 7px;
}
.mma-nextup-row {
display: flex;
align-items: center;
gap: 9px;
margin-bottom: 7px;
}
.mma-nextup-row:last-child {
margin-bottom: 0;
}
.mma-nextup-art {
width: 30px;
height: 30px;
border-radius: 5px;
object-fit: cover;
flex: 0 0 auto;
}
.mma-nextup-text {
min-width: 0;
}
.mma-nextup-title,
.mma-nextup-artist {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
/* ---- idle ---- */
.mma-idle {
padding: 10px 4px;
}