smooth-player 1.0.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.
@@ -0,0 +1,487 @@
1
+ .smooth-player {
2
+ --smooth-player-background: #0b1220;
3
+ --smooth-player-foreground: rgba(243, 245, 249, 0.8);
4
+ --smooth-player-accent: #2db6c8;
5
+ --smooth-player-waveform: #f3f5f9;
6
+ --smooth-player-radius: 18px;
7
+ --smooth-player-font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
8
+ --smooth-player-surface: linear-gradient(145deg, #182743, #111a2d 56%, #0e1628);
9
+ --smooth-player-panel: linear-gradient(190deg, #1a2945 0%, #111a2e 58%, #0c1321 100%);
10
+ --smooth-player-muted: #92a4c1;
11
+ --smooth-player-progress: 0%;
12
+
13
+ position: relative;
14
+ width: min(960px, 92vw);
15
+ min-height: 500px;
16
+ border-radius: var(--smooth-player-radius);
17
+ border: 1px solid rgba(255, 255, 255, 0.12);
18
+ background: var(--smooth-player-surface);
19
+ color: var(--smooth-player-foreground);
20
+ font-family: var(--smooth-player-font-family);
21
+ overflow: hidden;
22
+
23
+ &::before {
24
+ content: "";
25
+ position: absolute;
26
+ inset: 0;
27
+ background: linear-gradient(90deg, rgba(7, 12, 22, 0) 0%, rgba(7, 12, 22, 0.5) 100%);
28
+ pointer-events: none;
29
+ opacity: 0;
30
+ transition: opacity 420ms cubic-bezier(0.2, 0.7, 0.2, 1);
31
+ }
32
+ }
33
+
34
+ .smooth-player__main {
35
+ position: relative;
36
+ z-index: 1;
37
+ height: 100%;
38
+ padding: 20px;
39
+ transition: transform 500ms cubic-bezier(0.2, 0.7, 0.2, 1), filter 420ms ease;
40
+ }
41
+
42
+ .smooth-player__row {
43
+ display: flex;
44
+ flex-wrap: wrap;
45
+ gap: 12px;
46
+ align-items: center;
47
+ justify-content: space-between;
48
+ }
49
+
50
+ .smooth-player__title {
51
+ margin: 0;
52
+ font-size: 22px;
53
+ }
54
+
55
+ .smooth-player__controls {
56
+ display: flex;
57
+ gap: 8px;
58
+ }
59
+
60
+ .smooth-player button {
61
+ border: 0;
62
+ background: var(--smooth-player-accent);
63
+ color: #041016;
64
+ width: 46px;
65
+ height: 46px;
66
+ display: inline-flex;
67
+ align-items: center;
68
+ justify-content: center;
69
+ cursor: pointer;
70
+ -webkit-tap-highlight-color: transparent;
71
+ transition: transform 180ms ease, filter 180ms ease, background 180ms ease;
72
+ border-radius: 50rem;
73
+
74
+ &:focus {
75
+ outline: none;
76
+ }
77
+
78
+ &:hover {
79
+ transform: translateY(-1px);
80
+ filter: brightness(1.1);
81
+ }
82
+
83
+ &:focus-visible {
84
+ outline: 2px solid #7fe9f5;
85
+ outline-offset: 2px;
86
+ }
87
+
88
+ &.secondary {
89
+ background: #27344f;
90
+ color: #eaf0fa;
91
+ }
92
+ }
93
+
94
+ .smooth-player__icon {
95
+ width: 22px;
96
+ height: 22px;
97
+ display: block;
98
+ }
99
+
100
+ .smooth-player__sr-only {
101
+ position: absolute;
102
+ width: 1px;
103
+ height: 1px;
104
+ padding: 0;
105
+ margin: -1px;
106
+ overflow: hidden;
107
+ clip: rect(0, 0, 0, 0);
108
+ border: 0;
109
+ }
110
+
111
+ .smooth-player__meta {
112
+ margin-top: 14px;
113
+ opacity: 0.95;
114
+ }
115
+
116
+ .smooth-player__hero {
117
+ display: grid;
118
+ place-items: center;
119
+ position: relative;
120
+ margin-top: 5rem;
121
+ margin-bottom: 5rem;
122
+ }
123
+
124
+ .smooth-player__ring {
125
+ --smooth-player-progress-angle: 0deg;
126
+ position: relative;
127
+ width: 230px;
128
+ aspect-ratio: 1 / 1;
129
+ border-radius: 50%;
130
+ padding: 2px;
131
+ background: conic-gradient(
132
+ var(--smooth-player-accent) var(--smooth-player-progress),
133
+ rgba(255, 255, 255, 0.16) 0%
134
+ );
135
+ cursor: grab;
136
+ box-shadow: 0 0 20px color-mix(in srgb, var(--smooth-player-accent) 45%, transparent);
137
+ }
138
+
139
+ .smooth-player__ring:active {
140
+ cursor: grabbing;
141
+ }
142
+
143
+ .smooth-player__ring-inner {
144
+ width: 100%;
145
+ height: 100%;
146
+ border-radius: 50%;
147
+ display: grid;
148
+ place-items: center;
149
+ }
150
+
151
+ .smooth-player__cover {
152
+ position: relative;
153
+ width: 95%;
154
+ aspect-ratio: 1 / 1;
155
+ border-radius: 50%;
156
+ overflow: hidden;
157
+ background: var(--smooth-player-background);
158
+ box-shadow: 0 16px 28px rgba(0, 0, 0, 0.36), inset 0 1px 1px rgba(255, 255, 255, 0.25);
159
+ }
160
+
161
+ .smooth-player__cover-canvas {
162
+ position: absolute;
163
+ inset: 0;
164
+ width: 100%;
165
+ height: 100%;
166
+ display: block;
167
+ }
168
+
169
+ .smooth-player__hero-play {
170
+ margin-top: 0;
171
+ }
172
+
173
+ .smooth-player__artist {
174
+ margin-top: 2px;
175
+ color: var(--smooth-player-muted);
176
+ }
177
+
178
+ .smooth-player__time {
179
+ margin-top: 8px;
180
+ font-size: 14px;
181
+ color: var(--smooth-player-muted);
182
+ }
183
+
184
+ .smooth-player__progress-wrap {
185
+ margin-top: 10px;
186
+ display: grid;
187
+ gap: 6px;
188
+ }
189
+
190
+ .smooth-player__progress-row {
191
+ display: flex;
192
+ justify-content: space-between;
193
+ align-items: center;
194
+ font-size: 12px;
195
+ color: var(--smooth-player-muted);
196
+ }
197
+
198
+ .smooth-player__progress {
199
+ --smooth-player-progress: 0%;
200
+ appearance: none;
201
+ width: 100%;
202
+ height: 7px;
203
+ border-radius: 999px;
204
+ background: linear-gradient(
205
+ to right,
206
+ var(--smooth-player-accent) 0%,
207
+ var(--smooth-player-accent) var(--smooth-player-progress),
208
+ rgba(255, 255, 255, 0.2) var(--smooth-player-progress),
209
+ rgba(255, 255, 255, 0.2) 100%
210
+ );
211
+ cursor: pointer;
212
+
213
+ &::-webkit-slider-thumb {
214
+ appearance: none;
215
+ width: 14px;
216
+ height: 14px;
217
+ border-radius: 50%;
218
+ border: 0;
219
+ background: #f4fbff;
220
+ box-shadow: 0 0 0 2px rgba(44, 182, 200, 0.35);
221
+ }
222
+
223
+ &::-moz-range-thumb {
224
+ width: 14px;
225
+ height: 14px;
226
+ border-radius: 50%;
227
+ border: 0;
228
+ background: #f4fbff;
229
+ box-shadow: 0 0 0 2px rgba(44, 182, 200, 0.35);
230
+ }
231
+ }
232
+
233
+ .smooth-player__canvas {
234
+ margin-top: 14px;
235
+ width: 100%;
236
+ border-radius: 10px;
237
+ border: 1px solid rgba(255, 255, 255, 0.1);
238
+ background: var(--smooth-player-background);
239
+ }
240
+
241
+ .smooth-player__playlist {
242
+ position: absolute;
243
+ inset: 0 0 0 auto;
244
+ width: min(350px, 90vw);
245
+ height: 100%;
246
+ padding: 20px;
247
+ background: var(--smooth-player-panel);
248
+ border-left: 1px solid rgba(255, 255, 255, 0.12);
249
+ transform: translateX(105%);
250
+ opacity: 0;
251
+ visibility: hidden;
252
+ pointer-events: none;
253
+ transition: transform 520ms cubic-bezier(0.2, 0.7, 0.2, 1), opacity 380ms ease, visibility 380ms ease;
254
+ z-index: 3;
255
+ }
256
+
257
+ .smooth-player__playlist-head {
258
+ display: flex;
259
+ align-items: center;
260
+ justify-content: space-between;
261
+ gap: 12px;
262
+
263
+ h2 {
264
+ margin: 0;
265
+ font-size: 20px;
266
+ }
267
+ }
268
+
269
+ .smooth-player__playlist-close {
270
+ width: 36px;
271
+ height: 36px;
272
+ font-size: 22px;
273
+ line-height: 1;
274
+ }
275
+
276
+ .smooth-player__playlist-switcher {
277
+ margin-top: 10px;
278
+ position: relative;
279
+ }
280
+
281
+ .smooth-player__playlist-switcher-trigger {
282
+ width: 100%;
283
+ height: auto;
284
+ min-width: 0;
285
+ min-height: 36px;
286
+ padding: 8px 12px;
287
+ border: 1px solid rgba(255, 255, 255, 0.18);
288
+ background: rgba(255, 255, 255, 0.06);
289
+ color: #e7eef9;
290
+ font-size: 13px;
291
+ line-height: 1.2;
292
+ text-align: left;
293
+ white-space: nowrap;
294
+ overflow: hidden;
295
+ text-overflow: ellipsis;
296
+ position: relative;
297
+ padding-right: 32px;
298
+ }
299
+
300
+ .smooth-player__playlist-switcher-trigger::after {
301
+ content: "";
302
+ position: absolute;
303
+ right: 12px;
304
+ top: 50%;
305
+ width: 8px;
306
+ height: 8px;
307
+ border-right: 2px solid currentColor;
308
+ border-bottom: 2px solid currentColor;
309
+ transform: translateY(-65%) rotate(45deg);
310
+ opacity: 0.8;
311
+ }
312
+
313
+ .smooth-player__playlist-switcher.is-open .smooth-player__playlist-switcher-trigger::after {
314
+ transform: translateY(-35%) rotate(-135deg);
315
+ }
316
+
317
+ .smooth-player__playlist-switcher-menu {
318
+ position: absolute;
319
+ top: calc(100% + 6px);
320
+ left: 0;
321
+ right: 0;
322
+ display: grid;
323
+ gap: 6px;
324
+ padding: 12px;
325
+ background: rgba(10, 18, 35, 0.96);
326
+ backdrop-filter: blur(10px);
327
+ border-radius: 8px;
328
+ z-index: 8;
329
+ }
330
+
331
+ .smooth-player__playlist-switcher-menu[hidden] {
332
+ display: none !important;
333
+ }
334
+
335
+ .smooth-player__playlist-switcher-item {
336
+ width: 100%;
337
+ height: auto;
338
+ min-width: 0;
339
+ min-height: 34px;
340
+ padding: 8px 10px;
341
+ border-radius: 10px;
342
+ border: 1px solid rgba(255, 255, 255, 0.14);
343
+ background: rgba(255, 255, 255, 0.04);
344
+ color: #e7eef9;
345
+ font-size: 12px;
346
+ line-height: 1.2;
347
+ text-align: left;
348
+ white-space: nowrap;
349
+ overflow: hidden;
350
+ text-overflow: ellipsis;
351
+ }
352
+
353
+ .smooth-player__playlist-switcher-item.is-active {
354
+ background: color-mix(in srgb, var(--smooth-player-accent) 24%, transparent);
355
+ border-color: color-mix(in srgb, var(--smooth-player-accent) 52%, #fff 48%);
356
+ color: #fff;
357
+ }
358
+
359
+ .smooth-player__playlist-list {
360
+ list-style: none;
361
+ margin: 12px 0 0;
362
+ padding: 0;
363
+ display: grid;
364
+ gap: 8px;
365
+ max-height: calc(100% - 108px);
366
+ overflow: auto;
367
+ }
368
+
369
+ .smooth-player__playlist-item {
370
+ width: 100%;
371
+ height: auto;
372
+ min-width: 0;
373
+ min-height: 48px;
374
+ border-radius: 8px;
375
+ border: 0;
376
+ background: transparent;
377
+ color: #f1f5fd;
378
+ padding: 8px 0;
379
+ text-align: left;
380
+ display: grid;
381
+ grid-template-columns: 18px minmax(0, 1fr);
382
+ align-items: center;
383
+ justify-content: initial;
384
+ gap: 10px;
385
+ cursor: pointer;
386
+ }
387
+
388
+ .smooth-player .smooth-player__playlist-switcher-trigger {
389
+ width: 100%;
390
+ height: auto;
391
+ min-width: 0;
392
+ min-height: 36px;
393
+ border-radius: 6px;
394
+ }
395
+
396
+ .smooth-player .smooth-player__playlist-switcher-item {
397
+ width: 100%;
398
+ height: auto;
399
+ min-width: 0;
400
+ min-height: 34px;
401
+ border-radius: 4px;
402
+ }
403
+
404
+ .smooth-player .smooth-player__playlist-item {
405
+ width: 100%;
406
+ height: auto;
407
+ min-width: 0;
408
+ min-height: 48px;
409
+ border-bottom: rgba(255, 255, 255, 0.1) 1px solid;
410
+ border-radius: 0;
411
+ }
412
+
413
+ .smooth-player__playlist-note {
414
+ width: 18px;
415
+ height: 18px;
416
+ color: rgba(243, 245, 249, 0.52);
417
+ background: currentColor;
418
+ display: block;
419
+ -webkit-mask: url("/assets/icons/note.svg") center / 15px 15px no-repeat;
420
+ mask: url("/assets/icons/note.svg") center / 15px 15px no-repeat;
421
+ }
422
+
423
+ .smooth-player__playlist-content {
424
+ min-width: 0;
425
+ display: grid;
426
+ gap: 2px;
427
+ }
428
+
429
+ .smooth-player__playlist-title {
430
+ min-width: 0;
431
+ white-space: nowrap;
432
+ overflow: hidden;
433
+ text-overflow: ellipsis;
434
+ font-weight: 600;
435
+ }
436
+
437
+ .smooth-player__playlist-artist {
438
+ min-width: 0;
439
+ white-space: nowrap;
440
+ overflow: hidden;
441
+ text-overflow: ellipsis;
442
+ font-size: 0.8rem;
443
+ color: rgba(197, 210, 231, 0.78);
444
+ }
445
+
446
+ .smooth-player__playlist-item[aria-current="true"] .smooth-player__playlist-note {
447
+ color: var(--smooth-player-accent);
448
+ }
449
+
450
+ .smooth-player__playlist-item:focus-visible {
451
+ outline: 2px solid color-mix(in srgb, var(--smooth-player-accent) 55%, #fff 45%);
452
+ outline-offset: 3px;
453
+ border-radius: 8px;
454
+ }
455
+
456
+ .smooth-player--playlist-open {
457
+ &::before {
458
+ opacity: 1;
459
+ }
460
+
461
+ .smooth-player__main {
462
+ transform: translateX(-18px) scale(0.992);
463
+ filter: saturate(0.9);
464
+ }
465
+
466
+ .smooth-player__playlist {
467
+ transform: translateX(0);
468
+ opacity: 1;
469
+ visibility: visible;
470
+ pointer-events: auto;
471
+ }
472
+ }
473
+
474
+ @media (max-width: 700px) {
475
+ .smooth-player {
476
+ min-height: 540px;
477
+ }
478
+
479
+ .smooth-player__main {
480
+ padding: 14px;
481
+ }
482
+
483
+ .smooth-player__playlist {
484
+ width: 100%;
485
+ border-left: 0;
486
+ }
487
+ }
@@ -0,0 +1,2 @@
1
+ @use "./common/base";
2
+ @use "./themes/nocturne";
@@ -0,0 +1,70 @@
1
+ .smooth-theme-aurora {
2
+ --smooth-player-muted: #c8c1dd;
3
+
4
+ &[data-smooth-layout="split"] {
5
+ .smooth-player__main {
6
+ display: grid;
7
+ grid-template-columns: minmax(0, 1fr) 320px;
8
+ grid-template-rows: auto auto 1fr;
9
+ gap: 14px;
10
+ align-content: start;
11
+ }
12
+
13
+ .smooth-player__row,
14
+ .smooth-player__meta,
15
+ .smooth-player__progress-wrap {
16
+ grid-column: 1 / 2;
17
+ }
18
+
19
+ #spectrum {
20
+ grid-column: 1 / 2;
21
+ grid-row: 4;
22
+ min-height: 210px;
23
+ margin-top: 4px;
24
+ border-radius: 16px;
25
+ }
26
+
27
+ #waveform {
28
+ grid-column: 2 / 3;
29
+ grid-row: 1 / 5;
30
+ height: calc(100% - 8px);
31
+ min-height: 300px;
32
+ margin-top: 0;
33
+ border-radius: 16px;
34
+ background: color-mix(in srgb, var(--smooth-player-background) 82%, #ffffff 18%);
35
+ }
36
+
37
+ .smooth-player__playlist {
38
+ width: min(400px, 94vw);
39
+ border-left-color: rgba(255, 122, 89, 0.35);
40
+ }
41
+
42
+ .smooth-player__playlist-item[aria-current="true"] {
43
+ border-color: rgba(255, 209, 102, 0.7);
44
+ background: rgba(255, 122, 89, 0.24);
45
+ }
46
+ }
47
+ }
48
+
49
+ @media (max-width: 980px) {
50
+ .smooth-theme-aurora[data-smooth-layout="split"] {
51
+ .smooth-player__main {
52
+ grid-template-columns: 1fr;
53
+ grid-template-rows: auto;
54
+ }
55
+
56
+ #waveform,
57
+ #spectrum,
58
+ .smooth-player__row,
59
+ .smooth-player__meta,
60
+ .smooth-player__progress-wrap {
61
+ grid-column: 1;
62
+ grid-row: auto;
63
+ }
64
+
65
+ #waveform {
66
+ margin-top: 14px;
67
+ min-height: 120px;
68
+ }
69
+ }
70
+ }