@madeinbruno/music-plug 0.1.0 → 0.4.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/styles.css CHANGED
@@ -1,232 +1,426 @@
1
- /* @madeinbruno/music-plug 스타일. 쓰는 쪽에서 한 번만 불러온다: import '@madeinbruno/music-plug/styles.css'
2
- 클래스 이름은 모두 mp- 로 시작한다.
3
- - 곡 줄(.mp-plug)은 둘러싼 글의 색(currentColor)을 따라서 밝은·어두운 화면 어디서나 맞는다.
4
- 멈추기 단추의 바탕은 --mp-ground로 바꿀 수 있다 (기본: 흰색 반투명).
5
- - 듣기 플러그(.mp-sheet)는 Music plug 색(검은 바탕, 노란 고른 표시)이다. */
6
-
7
- .mp-plug {
8
- --mp-ground: rgba(255, 255, 255, 0.92);
9
- font-size: 14px;
10
- }
11
-
12
- .mp-plug button,
13
- .mp-sheet button {
14
- padding: 0;
15
- border: 0;
16
- background: none;
17
- color: inherit;
18
- font: inherit;
19
- cursor: pointer;
20
- }
21
-
22
- .mp-plug__row {
23
- display: flex;
24
- flex-wrap: wrap;
25
- align-items: baseline;
26
- gap: 4px 10px;
27
- }
28
-
29
- .mp-plug__song {
30
- text-align: left;
31
- }
32
-
33
- .mp-plug__where {
34
- opacity: 0.55;
35
- font-size: 13px;
36
- }
37
-
38
- .mp-plug__where button {
39
- text-decoration: underline;
40
- text-underline-offset: 3px;
41
- }
42
-
43
- .mp-plug__frame {
44
- margin-top: 10px;
45
- overflow: hidden;
46
- border-radius: 2px;
47
- }
48
-
49
- .mp-plug__frame iframe {
50
- display: block;
51
- width: 100%;
52
- aspect-ratio: 16 / 9;
53
- border: 0;
54
- }
55
-
56
- .mp-plug__chip {
57
- position: fixed;
58
- bottom: 16px;
59
- left: 16px;
60
- z-index: 40;
61
- max-width: 60vw;
62
- padding: 6px 14px !important;
63
- border: 1px solid currentColor !important;
64
- border-radius: 999px;
65
- background: var(--mp-ground) !important;
66
- opacity: 0.85;
67
- white-space: nowrap;
68
- overflow: hidden;
69
- text-overflow: ellipsis;
70
- }
71
-
72
- /* ───────── 듣기 플러그 (Music plug) ───────── */
73
-
74
- .mp-sheet {
75
- --mp-bg: #0b0b0d;
76
- --mp-panel: #141417;
77
- --mp-line: #2c2c33;
78
- --mp-ink: #f2f2ee;
79
- --mp-sub: #9a9aa5;
80
- --mp-core: #ffe14a;
81
- position: fixed;
82
- inset: 0;
83
- z-index: 60;
84
- display: flex;
85
- align-items: flex-end;
86
- justify-content: center;
87
- background: rgba(0, 0, 0, 0.45);
88
- font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Noto Sans KR', 'Segoe UI', sans-serif;
89
- animation: mp-fade 140ms ease-out;
90
- }
91
-
92
- @media (min-width: 640px) {
93
- .mp-sheet {
94
- align-items: center;
95
- }
96
- }
97
-
98
- .mp-sheet__panel {
99
- box-sizing: border-box;
100
- width: 100%;
101
- max-width: 420px;
102
- max-height: 88vh;
103
- overflow-y: auto;
104
- padding: 20px 20px 24px;
105
- border-radius: 20px 20px 0 0;
106
- background: var(--mp-bg);
107
- color: var(--mp-ink);
108
- animation: mp-rise 180ms ease-out;
109
- }
110
-
111
- @media (min-width: 640px) {
112
- .mp-sheet__panel {
113
- border-radius: 20px;
114
- }
115
- }
116
-
117
- .mp-sheet__head {
118
- display: flex;
119
- align-items: center;
120
- justify-content: space-between;
121
- }
122
-
123
- .mp-sheet__brand {
124
- display: inline-flex;
125
- align-items: center;
126
- gap: 8px;
127
- font-size: 14px;
128
- font-weight: 700;
129
- }
130
-
131
- .mp-sheet__close {
132
- font-size: 24px !important;
133
- line-height: 1;
134
- color: var(--mp-sub) !important;
135
- }
136
-
137
- .mp-sheet__song {
138
- margin-top: 18px;
139
- }
140
-
141
- .mp-sheet__song p {
142
- margin: 0;
143
- }
144
-
145
- .mp-sheet__song-title {
146
- font-size: 20px;
147
- font-weight: 700;
148
- letter-spacing: -0.01em;
149
- }
150
-
151
- .mp-sheet__sub {
152
- color: var(--mp-sub);
153
- font-size: 13px;
154
- }
155
-
156
- .mp-sheet__ask {
157
- margin: 22px 0 10px;
158
- font-size: 15px;
159
- font-weight: 600;
160
- }
161
-
162
- .mp-sheet__grid {
163
- display: grid;
164
- grid-template-columns: 1fr 1fr;
165
- gap: 8px;
166
- margin: 0;
167
- padding: 0;
168
- list-style: none;
169
- }
170
-
171
- .mp-sheet__grid button {
172
- box-sizing: border-box;
173
- display: flex !important;
174
- align-items: center;
175
- gap: 10px;
176
- width: 100%;
177
- padding: 11px 12px !important;
178
- border: 1px solid var(--mp-line) !important;
179
- border-radius: 12px;
180
- background: var(--mp-panel) !important;
181
- font-size: 14px !important;
182
- text-align: left;
183
- }
184
-
185
- .mp-sheet__grid button:hover {
186
- border-color: var(--mp-sub) !important;
187
- }
188
-
189
- .mp-sheet__grid button[aria-current='true'] {
190
- border-color: var(--mp-core) !important;
191
- }
192
-
193
- .mp-sheet__mark {
194
- flex-shrink: 0;
195
- }
196
-
197
- /* 아직 고른 곳이 없을 때 골라져 있는 곳 (YouTube) */
198
- .mp-sheet__tag {
199
- margin-left: auto;
200
- padding: 1px 7px;
201
- border-radius: 999px;
202
- background: var(--mp-line);
203
- color: var(--mp-sub);
204
- font-size: 11px;
205
- font-weight: 700;
206
- }
207
-
208
- .mp-sheet__note {
209
- margin: 14px 0 0;
210
- color: var(--mp-sub);
211
- font-size: 12px;
212
- line-height: 1.6;
213
- }
214
-
215
- @keyframes mp-fade {
216
- from {
217
- opacity: 0;
218
- }
219
- }
220
-
221
- @keyframes mp-rise {
222
- from {
223
- transform: translateY(16px);
224
- }
225
- }
226
-
227
- @media (prefers-reduced-motion: reduce) {
228
- .mp-sheet,
229
- .mp-sheet__panel {
230
- animation: none;
231
- }
232
- }
1
+ /* @madeinbruno/music-plug 스타일. 쓰는 쪽에서 한 번만 불러온다: import '@madeinbruno/music-plug/styles.css'
2
+ 클래스 이름은 모두 mp- 로 시작한다.
3
+ - 곡 줄(.mp-plug)은 둘러싼 글의 색(currentColor)을 따라서 밝은·어두운 화면 어디서나 맞는다.
4
+ 음악 바의 바탕은 --mp-ground로 바꿀 수 있다 (기본: 흰색 반투명).
5
+ - 듣기 플러그(.mp-sheet)는 Music plug 색(검은 바탕, 노란 고른 표시)이다. */
6
+
7
+ .mp-plug {
8
+ --mp-ground: rgba(255, 255, 255, 0.92);
9
+ font-size: 14px;
10
+ }
11
+
12
+ .mp-plug button,
13
+ .mp-sheet button {
14
+ padding: 0;
15
+ border: 0;
16
+ background: none;
17
+ color: inherit;
18
+ font: inherit;
19
+ cursor: pointer;
20
+ }
21
+
22
+ .mp-plug__row {
23
+ display: flex;
24
+ flex-wrap: wrap;
25
+ align-items: baseline;
26
+ gap: 4px 10px;
27
+ }
28
+
29
+ .mp-plug__song {
30
+ text-align: left;
31
+ }
32
+
33
+ .mp-plug__where {
34
+ opacity: 0.55;
35
+ font-size: 13px;
36
+ }
37
+
38
+ .mp-plug__where button {
39
+ text-decoration: underline;
40
+ text-underline-offset: 3px;
41
+ }
42
+
43
+ .mp-plug__frame {
44
+ margin-top: 10px;
45
+ overflow: hidden;
46
+ border-radius: 2px;
47
+ }
48
+
49
+ .mp-plug__frame iframe {
50
+ display: block;
51
+ width: 100%;
52
+ aspect-ratio: 16 / 9;
53
+ border: 0;
54
+ }
55
+
56
+ .mp-plug__chip {
57
+ position: fixed;
58
+ bottom: 16px;
59
+ left: 16px;
60
+ z-index: 40;
61
+ display: inline-flex;
62
+ align-items: center;
63
+ gap: 8px;
64
+ max-width: min(60vw, 240px);
65
+ padding: 7px 14px 7px 12px !important;
66
+ border: 1px solid currentColor !important;
67
+ border-radius: 999px;
68
+ background: var(--mp-ground) !important;
69
+ opacity: 0.85;
70
+ line-height: 1.2;
71
+ animation: mp-fade 160ms ease-out;
72
+ }
73
+
74
+ .mp-plug__icon {
75
+ flex: none;
76
+ }
77
+
78
+ /* 길면 흘러가는 한 줄 글씨 (곡 제목) */
79
+ .mp-marquee {
80
+ display: block;
81
+ min-width: 0;
82
+ overflow: hidden;
83
+ white-space: nowrap;
84
+ }
85
+
86
+ .mp-marquee__text {
87
+ display: inline-block;
88
+ }
89
+
90
+ /* 흐를 때는 양쪽에 여백을 둬서 처음·마지막 글자가 흐린 끝에 걸리지 않게 (왼쪽 여백만큼 아이콘과의 틈을 줄인다) */
91
+ .mp-plug__chip:has(.mp-marquee--move) {
92
+ gap: 3px;
93
+ }
94
+ .mp-marquee--move .mp-marquee__text {
95
+ padding: 0 16px 0 5px;
96
+ }
97
+
98
+ .mp-marquee--move {
99
+ /* 흐를 때는 양 끝을 흐리게 지워서 잘린 티가 덜 나게 */
100
+ -webkit-mask-image: linear-gradient(90deg, transparent, #000 5px, #000 calc(100% - 12px), transparent);
101
+ mask-image: linear-gradient(90deg, transparent, #000 5px, #000 calc(100% - 12px), transparent);
102
+ }
103
+
104
+ .mp-marquee--move .mp-marquee__text {
105
+ animation: mp-marquee var(--mp-dur, 8s) ease-in-out infinite alternate;
106
+ }
107
+
108
+ @keyframes mp-marquee {
109
+ 0%,
110
+ 18% {
111
+ transform: translateX(0);
112
+ }
113
+ 82%,
114
+ 100% {
115
+ transform: translateX(var(--mp-shift, 0));
116
+ }
117
+ }
118
+
119
+ @media (prefers-reduced-motion: reduce) {
120
+ .mp-marquee--move .mp-marquee__text {
121
+ animation: none;
122
+ }
123
+ .mp-marquee {
124
+ text-overflow: ellipsis;
125
+ }
126
+ }
127
+
128
+ /* ───────── 듣기 플러그 (Music plug) ───────── */
129
+
130
+ .mp-sheet {
131
+ --mp-bg: #0b0b0d;
132
+ --mp-panel: #141417;
133
+ --mp-line: #2c2c33;
134
+ --mp-ink: #f2f2ee;
135
+ --mp-sub: #9a9aa5;
136
+ --mp-core: #ffe14a;
137
+ position: fixed;
138
+ inset: 0;
139
+ z-index: 60;
140
+ display: flex;
141
+ align-items: flex-end;
142
+ justify-content: center;
143
+ background: rgba(0, 0, 0, 0.45);
144
+ font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Noto Sans KR', 'Segoe UI', sans-serif;
145
+ animation: mp-fade 140ms ease-out;
146
+ }
147
+
148
+ @media (min-width: 640px) {
149
+ .mp-sheet {
150
+ align-items: center;
151
+ }
152
+ }
153
+
154
+ .mp-sheet__panel {
155
+ box-sizing: border-box;
156
+ width: 100%;
157
+ max-width: 420px;
158
+ max-height: 88vh;
159
+ overflow-y: auto;
160
+ padding: 20px 20px 24px;
161
+ border-radius: 20px 20px 0 0;
162
+ background: var(--mp-bg);
163
+ color: var(--mp-ink);
164
+ animation: mp-rise 180ms ease-out;
165
+ }
166
+
167
+ @media (min-width: 640px) {
168
+ .mp-sheet__panel {
169
+ border-radius: 20px;
170
+ }
171
+ }
172
+
173
+ .mp-sheet__head {
174
+ display: flex;
175
+ align-items: center;
176
+ justify-content: space-between;
177
+ }
178
+
179
+ .mp-sheet__brand {
180
+ display: inline-flex;
181
+ align-items: center;
182
+ gap: 8px;
183
+ font-size: 14px;
184
+ font-weight: 700;
185
+ }
186
+
187
+ .mp-sheet__close {
188
+ font-size: 24px !important;
189
+ line-height: 1;
190
+ color: var(--mp-sub) !important;
191
+ }
192
+
193
+ .mp-sheet__song {
194
+ margin-top: 18px;
195
+ }
196
+
197
+ .mp-sheet__song p {
198
+ margin: 0;
199
+ }
200
+
201
+ .mp-sheet__song-title {
202
+ font-size: 20px;
203
+ font-weight: 700;
204
+ letter-spacing: -0.01em;
205
+ }
206
+
207
+ .mp-sheet__sub {
208
+ color: var(--mp-sub);
209
+ font-size: 13px;
210
+ }
211
+
212
+ .mp-sheet__ask {
213
+ margin: 22px 0 10px;
214
+ font-size: 15px;
215
+ font-weight: 600;
216
+ }
217
+
218
+ .mp-sheet__grid {
219
+ display: grid;
220
+ grid-template-columns: 1fr 1fr;
221
+ gap: 8px;
222
+ margin: 0;
223
+ padding: 0;
224
+ list-style: none;
225
+ }
226
+
227
+ .mp-sheet__grid button {
228
+ box-sizing: border-box;
229
+ display: flex !important;
230
+ align-items: center;
231
+ gap: 10px;
232
+ width: 100%;
233
+ padding: 11px 12px !important;
234
+ border: 1px solid var(--mp-line) !important;
235
+ border-radius: 12px;
236
+ background: var(--mp-panel) !important;
237
+ font-size: 14px !important;
238
+ text-align: left;
239
+ }
240
+
241
+ .mp-sheet__grid button:hover {
242
+ border-color: var(--mp-sub) !important;
243
+ }
244
+
245
+ .mp-sheet__grid button[aria-current='true'] {
246
+ border-color: var(--mp-core) !important;
247
+ }
248
+
249
+ .mp-sheet__mark {
250
+ flex-shrink: 0;
251
+ }
252
+
253
+ /* 아직 고른 곳이 없을 때 골라져 있는 곳 (YouTube) */
254
+ .mp-sheet__tag {
255
+ margin-left: auto;
256
+ padding: 1px 7px;
257
+ border-radius: 999px;
258
+ background: var(--mp-line);
259
+ color: var(--mp-sub);
260
+ font-size: 11px;
261
+ font-weight: 700;
262
+ }
263
+
264
+ .mp-sheet__note {
265
+ margin: 14px 0 0;
266
+ color: var(--mp-sub);
267
+ font-size: 12px;
268
+ line-height: 1.6;
269
+ }
270
+
271
+ @keyframes mp-fade {
272
+ from {
273
+ opacity: 0;
274
+ }
275
+ }
276
+
277
+ @keyframes mp-rise {
278
+ from {
279
+ transform: translateY(16px);
280
+ }
281
+ }
282
+
283
+ @media (prefers-reduced-motion: reduce) {
284
+ .mp-sheet,
285
+ .mp-sheet__panel {
286
+ animation: none;
287
+ }
288
+ }
289
+
290
+ /* ───────── 곡 고르기 (SongField) ─────────
291
+ 쓰는 사람 화면. 둘러싼 글의 색(currentColor)을 따른다. */
292
+
293
+ .mp-pick {
294
+ font-size: 14px;
295
+ }
296
+
297
+ .mp-pick button {
298
+ padding: 0;
299
+ border: 0;
300
+ background: none;
301
+ color: inherit;
302
+ font: inherit;
303
+ cursor: pointer;
304
+ }
305
+
306
+ .mp-pick__bar {
307
+ display: flex;
308
+ align-items: baseline;
309
+ gap: 8px;
310
+ }
311
+
312
+ .mp-pick__bar input {
313
+ flex: 1;
314
+ min-width: 0;
315
+ padding: 2px 0;
316
+ border: 0;
317
+ background: transparent;
318
+ color: inherit;
319
+ font: inherit;
320
+ outline: none;
321
+ }
322
+
323
+ /* 브라우저가 붙이는 파란 지우기 단추는 숨긴다 (둘러싼 글의 모양을 따르게) */
324
+ .mp-pick__bar input::-webkit-search-cancel-button {
325
+ appearance: none;
326
+ }
327
+
328
+ .mp-pick__bar input::placeholder {
329
+ color: currentColor;
330
+ opacity: 0.45;
331
+ }
332
+
333
+ .mp-pick__bar button,
334
+ .mp-pick__actions button {
335
+ opacity: 0.6;
336
+ font-size: 13px;
337
+ }
338
+
339
+ .mp-pick__note {
340
+ margin: 8px 0 0 20px;
341
+ opacity: 0.55;
342
+ font-size: 13px;
343
+ }
344
+
345
+ .mp-pick__list {
346
+ max-height: 340px;
347
+ margin: 8px 0 0;
348
+ padding: 0;
349
+ overflow-y: auto;
350
+ list-style: none;
351
+ }
352
+
353
+ .mp-pick__list li {
354
+ display: flex;
355
+ align-items: center;
356
+ gap: 8px;
357
+ }
358
+
359
+ .mp-pick__row,
360
+ .mp-pick__chosen {
361
+ display: flex !important;
362
+ flex: 1;
363
+ align-items: center;
364
+ gap: 10px;
365
+ min-width: 0;
366
+ padding: 6px 0 !important;
367
+ text-align: left;
368
+ }
369
+
370
+ .mp-pick__row:hover {
371
+ opacity: 0.75;
372
+ }
373
+
374
+ .mp-pick__art {
375
+ flex-shrink: 0;
376
+ width: 40px;
377
+ height: 40px;
378
+ border-radius: 4px;
379
+ object-fit: cover;
380
+ }
381
+
382
+ .mp-pick__art--empty {
383
+ display: flex;
384
+ align-items: center;
385
+ justify-content: center;
386
+ border: 1px solid currentColor;
387
+ opacity: 0.4;
388
+ }
389
+
390
+ .mp-pick__text {
391
+ display: flex;
392
+ flex-direction: column;
393
+ min-width: 0;
394
+ }
395
+
396
+ .mp-pick__title,
397
+ .mp-pick__sub {
398
+ overflow: hidden;
399
+ white-space: nowrap;
400
+ text-overflow: ellipsis;
401
+ }
402
+
403
+ .mp-pick__sub {
404
+ opacity: 0.55;
405
+ font-size: 12px;
406
+ }
407
+
408
+ .mp-pick__preview {
409
+ flex-shrink: 0;
410
+ width: 32px;
411
+ height: 32px;
412
+ border-radius: 999px !important;
413
+ font-size: 11px !important;
414
+ opacity: 0.7;
415
+ }
416
+
417
+ .mp-pick__preview[aria-pressed='true'] {
418
+ opacity: 1;
419
+ }
420
+
421
+ .mp-pick__actions {
422
+ display: flex;
423
+ flex-shrink: 0;
424
+ gap: 12px;
425
+ margin-left: auto;
426
+ }