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.
- package/README.md +211 -0
- package/assets/icons/menu.svg +5 -0
- package/assets/icons/next.svg +4 -0
- package/assets/icons/note.svg +3 -0
- package/assets/icons/pause.svg +4 -0
- package/assets/icons/play.svg +3 -0
- package/assets/icons/playlist.svg +7 -0
- package/assets/icons/prev.svg +4 -0
- package/assets/icons/shuffle.svg +7 -0
- package/dist/SmoothPlayer.d.ts +91 -0
- package/dist/SmoothPlayer.js +930 -0
- package/dist/events.d.ts +7 -0
- package/dist/events.js +20 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +3 -0
- package/dist/smooth-player.css +675 -0
- package/dist/types.d.ts +170 -0
- package/dist/types.js +1 -0
- package/dist/ui.d.ts +3 -0
- package/dist/ui.js +119 -0
- package/dist/visualizers.d.ts +46 -0
- package/dist/visualizers.js +182 -0
- package/dist-cjs/SmoothPlayer.js +934 -0
- package/dist-cjs/events.js +24 -0
- package/dist-cjs/index.js +11 -0
- package/dist-cjs/types.js +2 -0
- package/dist-cjs/ui.js +122 -0
- package/dist-cjs/visualizers.js +188 -0
- package/package.json +50 -0
- package/styles/common/_base.scss +487 -0
- package/styles/index.scss +2 -0
- package/styles/themes/_aurora.scss +70 -0
- package/styles/themes/_nocturne.scss +259 -0
- package/styles/themes/_ocean.scss +13 -0
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
.smooth-player {
|
|
2
|
+
--smooth-player-muted: #9ca7b6;
|
|
3
|
+
--smooth-player-radius: 32px;
|
|
4
|
+
|
|
5
|
+
border-color: rgba(255, 255, 255, 0.08);
|
|
6
|
+
box-shadow: 0 30px 60px rgba(0, 0, 0, 0.35), inset 0 1px 1px rgba(255, 255, 255, 0.06);
|
|
7
|
+
|
|
8
|
+
.smooth-player__meta {
|
|
9
|
+
margin-top: 1.5rem;
|
|
10
|
+
text-align: center;
|
|
11
|
+
|
|
12
|
+
strong {
|
|
13
|
+
font-size: clamp(24px, 5vw, 42px);
|
|
14
|
+
font-weight: 500;
|
|
15
|
+
letter-spacing: -0.02em;
|
|
16
|
+
line-height: 1.08;
|
|
17
|
+
display: block;
|
|
18
|
+
color: color-mix(in srgb, var(--smooth-player-accent) 80%, transparent);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.smooth-player__artist {
|
|
23
|
+
margin-top: 0.375rem;
|
|
24
|
+
font-size: clamp(14px, 2.4vw, 18px);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.smooth-player__top {
|
|
28
|
+
position: relative;
|
|
29
|
+
min-height: 2.125rem;
|
|
30
|
+
display: flex;
|
|
31
|
+
align-items: center;
|
|
32
|
+
justify-content: center;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.smooth-player__top-title {
|
|
36
|
+
font-size: 0.875rem;
|
|
37
|
+
color: rgba(242, 244, 248, 0.8);
|
|
38
|
+
letter-spacing: 0.01em;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.smooth-player__nav-btn {
|
|
42
|
+
position: absolute;
|
|
43
|
+
top: 0;
|
|
44
|
+
left: 0.875rem;
|
|
45
|
+
width: 1.875rem;
|
|
46
|
+
height: 1.875rem;
|
|
47
|
+
min-width: 1.875rem;
|
|
48
|
+
min-height: 1.875rem;
|
|
49
|
+
border-radius: 50%;
|
|
50
|
+
background: transparent;
|
|
51
|
+
border: 0;
|
|
52
|
+
color: rgba(242, 244, 248, 0.7);
|
|
53
|
+
font-size: 1.25rem;
|
|
54
|
+
box-shadow: none;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.smooth-player__nav-btn[aria-expanded="true"] {
|
|
58
|
+
color: var(--smooth-player-accent);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
#shuffle-toggle {
|
|
62
|
+
position: absolute;
|
|
63
|
+
top: 0;
|
|
64
|
+
right: 0.875rem;
|
|
65
|
+
width: 1.875rem;
|
|
66
|
+
height: 1.875rem;
|
|
67
|
+
min-width: 1.875rem;
|
|
68
|
+
min-height: 1.875rem;
|
|
69
|
+
background: transparent;
|
|
70
|
+
color: rgba(242, 244, 248, 0.55);
|
|
71
|
+
box-shadow: none;
|
|
72
|
+
z-index: 4;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
#shuffle-toggle:hover {
|
|
76
|
+
filter: none;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
#shuffle-toggle .smooth-player__icon-shuffle {
|
|
80
|
+
width: 1rem;
|
|
81
|
+
height: 1rem;
|
|
82
|
+
display: block;
|
|
83
|
+
background-color: currentColor;
|
|
84
|
+
-webkit-mask: url("/assets/icons/shuffle.svg") center / contain no-repeat;
|
|
85
|
+
mask: url("/assets/icons/shuffle.svg") center / contain no-repeat;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
#shuffle-toggle.smooth-player__toggle-on {
|
|
89
|
+
color: var(--smooth-player-accent);
|
|
90
|
+
background: transparent;
|
|
91
|
+
box-shadow: none;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.smooth-player__transport {
|
|
95
|
+
margin-top: 1.75rem;
|
|
96
|
+
margin-bottom: 2.25rem;
|
|
97
|
+
display: flex;
|
|
98
|
+
justify-content: center;
|
|
99
|
+
align-items: center;
|
|
100
|
+
gap: 1.625rem;
|
|
101
|
+
|
|
102
|
+
button {
|
|
103
|
+
width: 3.125rem;
|
|
104
|
+
height: 3.125rem;
|
|
105
|
+
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.smooth-player__transport-playlist {
|
|
109
|
+
width: 3.75rem;
|
|
110
|
+
height: 3.75rem;
|
|
111
|
+
min-width: 3.75rem;
|
|
112
|
+
min-height: 3.75rem;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.smooth-player__transport-playlist .smooth-player__icon {
|
|
116
|
+
width: 1.5rem;
|
|
117
|
+
height: 1.5rem;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.smooth-player__transport-play {
|
|
121
|
+
width: 4.375rem;
|
|
122
|
+
height: 4.375rem;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.smooth-player__progress-wrap {
|
|
127
|
+
display: none;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.smooth-player__hero {
|
|
131
|
+
display: grid;
|
|
132
|
+
place-items: center;
|
|
133
|
+
margin-top: 5rem;
|
|
134
|
+
margin-bottom: 5rem;
|
|
135
|
+
position: relative;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.smooth-player__ring {
|
|
139
|
+
width: clamp(15.75rem, 74vw, 19.125rem);
|
|
140
|
+
padding: 0.09375rem;
|
|
141
|
+
box-shadow:
|
|
142
|
+
0 0 1.375rem color-mix(in srgb, var(--smooth-player-accent) 48%, transparent),
|
|
143
|
+
0 0 2.5rem color-mix(in srgb, var(--smooth-player-accent) 24%, transparent);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.smooth-player__hero-play {
|
|
147
|
+
position: absolute;
|
|
148
|
+
top: 50%;
|
|
149
|
+
left: 50%;
|
|
150
|
+
transform: translate(-50%, -50%);
|
|
151
|
+
width: 4.625rem;
|
|
152
|
+
height: 4.625rem;
|
|
153
|
+
background: transparent;
|
|
154
|
+
border: 0;
|
|
155
|
+
color: rgba(242, 244, 248, 0.78);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
.smooth-player__hero-play .smooth-player__icon-play {
|
|
159
|
+
width: 2.75rem;
|
|
160
|
+
height: 2.75rem;
|
|
161
|
+
display: block;
|
|
162
|
+
background-color: currentColor;
|
|
163
|
+
-webkit-mask: url("/assets/icons/play.svg") center / contain no-repeat;
|
|
164
|
+
mask: url("/assets/icons/play.svg") center / contain no-repeat;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
.smooth-player__hero-play[aria-pressed="true"] {
|
|
168
|
+
color: var(--smooth-player-accent);
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
.smooth-player__hero-play[aria-pressed="true"] .smooth-player__icon-play {
|
|
172
|
+
-webkit-mask: url("/assets/icons/pause.svg") center / contain no-repeat;
|
|
173
|
+
mask: url("/assets/icons/pause.svg") center / contain no-repeat;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
.smooth-player__hero-play:hover {
|
|
177
|
+
transform: translate(-50%, -50%) scale(1.02);
|
|
178
|
+
filter: brightness(1.08);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
.smooth-player__hero-play:focus-visible {
|
|
182
|
+
transform: translate(-50%, -50%);
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
.smooth-player__progress {
|
|
186
|
+
height: 3px;
|
|
187
|
+
background: linear-gradient(
|
|
188
|
+
to right,
|
|
189
|
+
color-mix(in srgb, var(--smooth-player-accent) 95%, #fff 5%) 0%,
|
|
190
|
+
color-mix(in srgb, var(--smooth-player-accent) 95%, #fff 5%) var(--smooth-player-progress),
|
|
191
|
+
rgba(255, 255, 255, 0.2) var(--smooth-player-progress),
|
|
192
|
+
rgba(255, 255, 255, 0.2) 100%
|
|
193
|
+
);
|
|
194
|
+
box-shadow: 0 0 14px rgba(14, 210, 164, 0.24);
|
|
195
|
+
|
|
196
|
+
&::-webkit-slider-thumb {
|
|
197
|
+
width: 12px;
|
|
198
|
+
height: 12px;
|
|
199
|
+
box-shadow: 0 0 0 2px rgba(14, 210, 164, 0.35), 0 0 12px rgba(14, 210, 164, 0.48);
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
&::-moz-range-thumb {
|
|
203
|
+
width: 12px;
|
|
204
|
+
height: 12px;
|
|
205
|
+
box-shadow: 0 0 0 2px rgba(14, 210, 164, 0.35), 0 0 12px rgba(14, 210, 164, 0.48);
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
.smooth-player__progress-row {
|
|
210
|
+
font-size: 11px;
|
|
211
|
+
opacity: 0.9;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
.smooth-player__playlist {
|
|
215
|
+
background: var(--smooth-player-panel);
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
.smooth-player__playlist-item {
|
|
219
|
+
text-align: left;
|
|
220
|
+
align-items: center;
|
|
221
|
+
background: transparent;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
.smooth-player__playlist-switcher {
|
|
225
|
+
padding-bottom: 0.375rem;
|
|
226
|
+
margin-bottom: 0.25rem;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
.smooth-player__playlist-switcher-trigger {
|
|
230
|
+
border-color: rgba(255, 255, 255, 0.24);
|
|
231
|
+
background: rgba(255, 255, 255, 0.08);
|
|
232
|
+
color: rgba(241, 246, 255, 0.94);
|
|
233
|
+
font-weight: 600;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
.smooth-player__playlist-switcher-menu {
|
|
237
|
+
border-color: rgba(255, 255, 255, 0.18);
|
|
238
|
+
background: rgba(16, 30, 58, 0.96);
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
.smooth-player__playlist-switcher-item {
|
|
242
|
+
border-color: rgba(255, 255, 255, 0.24);
|
|
243
|
+
background: rgba(255, 255, 255, 0.08);
|
|
244
|
+
color: rgba(241, 246, 255, 0.9);
|
|
245
|
+
font-weight: 600;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
.smooth-player__playlist-switcher-item.is-active {
|
|
249
|
+
border-color: color-mix(in srgb, var(--smooth-player-accent) 48%, #fff 52%);
|
|
250
|
+
background: color-mix(in srgb, var(--smooth-player-accent) 22%, rgba(255, 255, 255, 0.04));
|
|
251
|
+
color: #fff;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
.smooth-player__canvas {
|
|
255
|
+
margin-top: 16px;
|
|
256
|
+
border-radius: 12px;
|
|
257
|
+
min-height: 82px;
|
|
258
|
+
}
|
|
259
|
+
}
|