@madeinbruno/music-plug 0.1.0 → 0.2.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 +86 -81
- package/dist/index.d.ts +33 -1
- package/dist/index.js +60 -0
- package/dist/player.d.ts +8 -2
- package/dist/player.js +4 -2
- package/package.json +50 -50
- package/styles.css +232 -232
package/README.md
CHANGED
|
@@ -1,81 +1,86 @@
|
|
|
1
|
-
# @madeinbruno/music-plug
|
|
2
|
-
|
|
3
|
-
글 속 노래 한 곡을, 듣는 사람이 쓰는 음원 앱에서 듣게 하는 플러그예요. [Music plug](https://musicplug.madeinbruno.com)의 듣기 플러그를 다른 사이트에 붙이는 패키지예요.
|
|
4
|
-
|
|
5
|
-
```
|
|
6
|
-
♪ 밤편지 · 아이유 ← 처음 누르면 Music plug 듣기 플러그가 뜬다
|
|
7
|
-
♪ 밤편지 · 아이유 멜론 · 바꾸기 ← 고른 뒤에는 누르면 바로 멜론에서
|
|
8
|
-
```
|
|
9
|
-
|
|
10
|
-
- 처음 누르면 **듣기 플러그**(Music plug 창)가 떠서 어디서 들을지 골라요: YouTube(기본) · 멜론 · 지니 · 벅스 · FLO · VIBE · Spotify · Apple Music · YouTube Music. YouTube는 유튜브 영상이 있으면 이 페이지에서 바로, 없으면 YouTube로 열어요.
|
|
11
|
-
- 고르면 그곳에서 이 곡을 열어요 (폰에서는 앱으로). Music plug가 곡을 찾아 보내요: YouTube·YouTube Music은 그 곡을 바로(시작 시각까지), Apple Music은 곡 페이지, 나머지는 그곳의 검색 결과.
|
|
12
|
-
- 고른 곳은 기억해서 다음부터는 누르면 바로 그곳에서 열어요. 곡 옆의 **바꾸기**로 다시 골라요. madeinbruno.com 아래에서는 Music plug와 같이 기억해요 (쿠키 `mp_service`).
|
|
13
|
-
- YouTube를 고르면 글 안에 유튜브 플레이어를 열어요. 읽어 내려가면 왼쪽 아래에 멈추기·다시 듣기 단추가 떠요. 브라우저가 소리 있는 자동재생을 막아서 한 번은 눌러야 나오고, 유튜브 정책상 플레이어는 보이게 둬요.
|
|
14
|
-
- 곡 정보를 모르면(유튜브에서 제목을 못 받으면) 다른 곳에서 찾을 수 없어서 이 페이지에서 YouTube로만 틀어요.
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
import {
|
|
28
|
-
import '@madeinbruno/music-plug/
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
return
|
|
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
|
-
npm
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
1
|
+
# @madeinbruno/music-plug
|
|
2
|
+
|
|
3
|
+
글 속 노래 한 곡을, 듣는 사람이 쓰는 음원 앱에서 듣게 하는 플러그예요. [Music plug](https://musicplug.madeinbruno.com)의 듣기 플러그를 다른 사이트에 붙이는 패키지예요.
|
|
4
|
+
|
|
5
|
+
```
|
|
6
|
+
♪ 밤편지 · 아이유 ← 처음 누르면 Music plug 듣기 플러그가 뜬다
|
|
7
|
+
♪ 밤편지 · 아이유 멜론 · 바꾸기 ← 고른 뒤에는 누르면 바로 멜론에서
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
- 처음 누르면 **듣기 플러그**(Music plug 창)가 떠서 어디서 들을지 골라요: YouTube(기본) · 멜론 · 지니 · 벅스 · FLO · VIBE · Spotify · Apple Music · YouTube Music. YouTube는 유튜브 영상이 있으면 이 페이지에서 바로, 없으면 YouTube로 열어요.
|
|
11
|
+
- 고르면 그곳에서 이 곡을 열어요 (폰에서는 앱으로). Music plug가 곡을 찾아 보내요: YouTube·YouTube Music은 그 곡을 바로(시작 시각까지), Apple Music은 곡 페이지, 나머지는 그곳의 검색 결과.
|
|
12
|
+
- 고른 곳은 기억해서 다음부터는 누르면 바로 그곳에서 열어요. 곡 옆의 **바꾸기**로 다시 골라요. madeinbruno.com 아래에서는 Music plug와 같이 기억해요 (쿠키 `mp_service`).
|
|
13
|
+
- YouTube를 고르면 글 안에 유튜브 플레이어를 열어요. 읽어 내려가면 왼쪽 아래에 멈추기·다시 듣기 단추가 떠요. 브라우저가 소리 있는 자동재생을 막아서 한 번은 눌러야 나오고, 유튜브 정책상 플레이어는 보이게 둬요.
|
|
14
|
+
- 곡 정보를 모르면(유튜브에서 제목을 못 받으면) 다른 곳에서 찾을 수 없어서 이 페이지에서 YouTube로만 틀어요.
|
|
15
|
+
- **곡은 유튜브 주소뿐 아니라 여러 곳의 곡 링크로 정할 수 있어요** (`songFromUrl`): YouTube · YouTube Music · 멜론 · 지니 · 벅스 · FLO · VIBE · Spotify · Apple Music. 쓰는 사람은 자기가 쓰는 곳의 곡 링크를 넣고, 듣는 사람은 자기가 쓰는 곳에서 들어요. 듣는 사람이 고른 곳이 곡을 정한 링크와 같은 곳이면 찾지 않고 그 링크를 바로 열어요. 유튜브 링크가 아니면 글 안의 플레이어는 없고, YouTube를 고르면 YouTube에서 그 곡을 찾아 열어요.
|
|
16
|
+
|
|
17
|
+
## 설치
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
pnpm add @madeinbruno/music-plug
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## 쓰기 (Next.js 예)
|
|
24
|
+
|
|
25
|
+
```tsx
|
|
26
|
+
// 서버 컴포넌트
|
|
27
|
+
import { songFromUrl } from '@madeinbruno/music-plug';
|
|
28
|
+
import { PlugPlayer } from '@madeinbruno/music-plug/player';
|
|
29
|
+
import '@madeinbruno/music-plug/styles.css'; // 앱에서 한 번만
|
|
30
|
+
|
|
31
|
+
export default async function Post({ music }: { music: string }) {
|
|
32
|
+
const link = await songFromUrl(music); // 곡 링크(유튜브·멜론·Spotify …) → 곡 제목·가수 (하루 캐시). 곡 링크가 아니면 null
|
|
33
|
+
if (!link) return null;
|
|
34
|
+
return (
|
|
35
|
+
<PlugPlayer
|
|
36
|
+
song={link.song} // 못 읽었으면 null
|
|
37
|
+
fallbackLabel="테마 음악"
|
|
38
|
+
youtube={link.youtube} // 유튜브 링크일 때만. 있으면 글 안에서 바로 튼다
|
|
39
|
+
source={link} // 듣는 사람이 같은 곳을 고르면 이 링크를 바로 연다
|
|
40
|
+
avoid=".mib-footer"
|
|
41
|
+
/>
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
| 내보내는 것 | 설명 |
|
|
47
|
+
|---|---|
|
|
48
|
+
| `PlugPlayer` (`/player`) | 곡 한 줄과 듣기 플러그. `song`(제목·가수, 모르면 `null`), `fallbackLabel`, `youtube`(`id`, `start` 초. 있으면 YouTube를 글 안에서, 없으면 YouTube로 연다), `source`(곡을 정한 링크의 `service`·`url`. 듣는 사람이 같은 곳을 고르면 그 링크를 바로 연다), `avoid`(이 요소가 보이면 멈추기 단추를 숨김), `base`(Music plug 주소, 기본 `https://musicplug.madeinbruno.com`) |
|
|
49
|
+
| `PlugSheet` (`/player`) | 듣기 플러그 창만 따로 |
|
|
50
|
+
| `listenPageUrl(song, youtube?)` | Music plug의 고르는 화면 주소 (`/listen`). 링크로만 걸고 싶을 때. 전에 고른 곳이 있으면 그 화면 없이 바로 그곳으로 가요 |
|
|
51
|
+
| `listenGoUrl(service, song, youtube?)` | 고른 곳에서 이 곡을 여는 주소 (`/listen/go`) |
|
|
52
|
+
| `songFromUrl(link)` | 곡 링크 하나로 그 곡을 읽어요 (서버에서): `{ service, url, song, youtube? }`. 유튜브는 oEmbed로 짐작하고, 그 밖의 곳은 Music plug(`/api/song`)가 그곳의 곡 화면에서 읽어 줘요. 곡 링크가 아니면 `null`, 곡을 못 읽으면 `song`이 `null` |
|
|
53
|
+
| `linkService(link)` | 링크가 어느 곳의 곡 링크인지 주소 모양만 보고 알려 줘요 (입력 칸에서 바로 확인할 때). 곡 링크가 아니면 `null` |
|
|
54
|
+
| `youtubeId(url)`, `youtubeStart(url)` | youtube.com · youtu.be · music.youtube.com · shorts 주소에서 영상 번호와 시작 시각(`t=`) |
|
|
55
|
+
| `songFromYoutube(id)` | 유튜브 oEmbed로 영상 제목·채널을 받아 곡 제목·가수를 짐작 (서버에서). 못 받으면 `null` |
|
|
56
|
+
| `songFromVideo(title, channel)`, `cleanTitle(title)` | 위의 짐작만 따로 ("가수 - 제목", "가수 '제목'", 유튜브 뮤직의 "가수 - Topic" 채널, `(Official MV)` 같은 꼬리표 지우기) |
|
|
57
|
+
| `SERVICES`, `getService(id)` | 들을 수 있는 곳 |
|
|
58
|
+
|
|
59
|
+
곡 줄은 둘러싼 글의 색을 따르고, 듣기 플러그 창은 Music plug 색이에요. 멈추기 단추의 바탕은 `--mp-ground`로 바꿀 수 있어요.
|
|
60
|
+
|
|
61
|
+
## Music plug 쪽
|
|
62
|
+
|
|
63
|
+
듣기 플러그의 본체는 Music plug 앱(`apps/music-plug`)에 있어요.
|
|
64
|
+
- `/listen?t=제목&a=가수[&v=유튜브번호][&start=초][&pick=1]`: 어디서 들을지 고르는 화면. 전에 고른 곳이 있으면 바로 그곳으로 (`pick=1`이면 다시 고른다). 공유받은 플레이리스트의 곡마다 붙은 '듣기'도 여기로 와요.
|
|
65
|
+
- `/api/song?url=곡링크`: 곡 링크 하나로 제목·가수를 읽어 줘요 (`src/server/song`). `songFromUrl`이 불러요.
|
|
66
|
+
- `/listen/go?s=고른곳&…[&remember=1]`: 그곳에서 이 곡을 찾아 보내요 (`src/server/listen.ts`). `remember=1`이면 고른 곳을 기억해요.
|
|
67
|
+
|
|
68
|
+
## 개발
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
pnpm --filter @madeinbruno/music-plug test # 곡 정보 짐작 시험
|
|
72
|
+
pnpm --filter @madeinbruno/music-plug build # dist/ 생성
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## 배포 (npm)
|
|
76
|
+
|
|
77
|
+
atelier와 같아요 (`.github/workflows/publish-music-plug.yml`). `package.json`의 `version`을 올려 `main`에 푸시하면 Actions가 npm 승인 대기열에 올리고, npmjs.com에서 승인하면 공개돼요.
|
|
78
|
+
|
|
79
|
+
**처음 한 번은 손으로 올려야 해요.** npm의 trusted publishing은 이미 있는 패키지에만 설정할 수 있어서요.
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
npm login
|
|
83
|
+
cd packages/music-plug && pnpm install && pnpm build && npm publish --access public
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
그다음 npmjs.com → `@madeinbruno/music-plug` → Settings → Trusted publishing에 저장소 `codingbotPark/madeinbruno`, 워크플로 `publish-music-plug.yml`을 등록해 두면, 다음 버전부터는 Actions가 올려요.
|
package/dist/index.d.ts
CHANGED
|
@@ -68,4 +68,36 @@ declare const songQuery: (song: Song) => string;
|
|
|
68
68
|
*/
|
|
69
69
|
declare function songFromYoutube(id: string): Promise<Song | null>;
|
|
70
70
|
|
|
71
|
-
|
|
71
|
+
/**
|
|
72
|
+
* 곡 링크. 테마 음악을 유튜브뿐 아니라 쓰는 사람이 쓰는 음원 앱의 곡 링크로도 정할 수 있게 한다.
|
|
73
|
+
* 받는 곳: YouTube · YouTube Music · 멜론 · 지니 · 벅스 · FLO · VIBE · Spotify · Apple Music
|
|
74
|
+
*/
|
|
75
|
+
type SongLink = {
|
|
76
|
+
/** 링크가 가리키는 곳 ('ytvideo'는 YouTube 영상, 'youtube'는 YouTube Music) */
|
|
77
|
+
service: ServiceId;
|
|
78
|
+
/** 곡 주소 (짧은 주소는 풀어서) */
|
|
79
|
+
url: string;
|
|
80
|
+
/** 곡 제목·가수. 못 읽었으면 null */
|
|
81
|
+
song: Song | null;
|
|
82
|
+
/** 유튜브 링크일 때만: 영상 번호와 시작 시각(초). 있으면 글 안에서 바로 틀 수 있다 */
|
|
83
|
+
youtube?: {
|
|
84
|
+
id: string;
|
|
85
|
+
start?: number;
|
|
86
|
+
};
|
|
87
|
+
};
|
|
88
|
+
/**
|
|
89
|
+
* 이 링크가 어느 곳의 곡 링크인지 (주소 모양만 본다. 화면에서 입력을 바로 확인할 때 쓴다). 곡 링크가 아니면 null.
|
|
90
|
+
* 앱의 공유 버튼이 주는 짧은 주소(kko.to, flomuz.io, spotify.link, naver.me)는 열어 봐야 알아서 그곳의 곡으로 친다.
|
|
91
|
+
*/
|
|
92
|
+
declare function linkService(input: string | null | undefined): ServiceId | null;
|
|
93
|
+
/**
|
|
94
|
+
* 곡 링크 하나로 그 곡을 읽는다 (서버에서). 곡 링크가 아니면 null.
|
|
95
|
+
* - 유튜브·YouTube Music: 유튜브 oEmbed로 제목·채널을 받아 짐작한다 (songFromYoutube)
|
|
96
|
+
* - 그 밖의 곳: Music plug(/api/song)가 그곳의 곡 화면에서 제목·가수를 읽어 준다
|
|
97
|
+
* 곡을 못 읽어도(song이 null) 링크는 돌려주니, 그 링크로는 들을 수 있다. Next.js에서는 하루 캐시한다.
|
|
98
|
+
*/
|
|
99
|
+
declare function songFromUrl(input: string | null | undefined, { base }?: {
|
|
100
|
+
base?: string | undefined;
|
|
101
|
+
}): Promise<SongLink | null>;
|
|
102
|
+
|
|
103
|
+
export { MUSIC_PLUG_URL, SERVICES, type Service, type ServiceId, type Song, type SongLink, cleanTitle, getService, linkService, listenGoUrl, listenPageUrl, songFromUrl, songFromVideo, songFromYoutube, songQuery, youtubeId, youtubeStart };
|
package/dist/index.js
CHANGED
|
@@ -88,13 +88,73 @@ async function songFromYoutube(id) {
|
|
|
88
88
|
return null;
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
|
+
|
|
92
|
+
// src/link.ts
|
|
93
|
+
var is = (host, domain) => host === domain || host.endsWith(`.${domain}`);
|
|
94
|
+
function firstUrl(input) {
|
|
95
|
+
const found = input?.match(/https?:\/\/[^\s<>"']+/)?.[0];
|
|
96
|
+
if (!found) return null;
|
|
97
|
+
try {
|
|
98
|
+
return new URL(found);
|
|
99
|
+
} catch {
|
|
100
|
+
return null;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
function linkService(input) {
|
|
104
|
+
const url = firstUrl(input);
|
|
105
|
+
if (!url) return null;
|
|
106
|
+
const host = url.hostname.toLowerCase();
|
|
107
|
+
const path = url.pathname;
|
|
108
|
+
if (is(host, "youtube.com") || is(host, "youtu.be")) {
|
|
109
|
+
if (!youtubeId(url.href)) return null;
|
|
110
|
+
return is(host, "music.youtube.com") ? "youtube" : "ytvideo";
|
|
111
|
+
}
|
|
112
|
+
if (is(host, "melon.com")) return url.searchParams.has("songId") || /^s/i.test(url.searchParams.get("type") ?? "") ? "melon" : null;
|
|
113
|
+
if (is(host, "kko.to")) return "melon";
|
|
114
|
+
if (is(host, "genie.co.kr")) return url.searchParams.has("xgnm") || !/playlist/i.test(path) ? "genie" : null;
|
|
115
|
+
if (is(host, "bugs.co.kr")) return /\/track\/\d+/.test(path) ? "bugs" : null;
|
|
116
|
+
if (is(host, "music-flo.com")) return /\/detail\/track\//.test(path) ? "flo" : null;
|
|
117
|
+
if (is(host, "flomuz.io")) return "flo";
|
|
118
|
+
if (is(host, "vibe.naver.com")) return /\/track\/\d+/.test(path) ? "vibe" : null;
|
|
119
|
+
if (is(host, "naver.me")) return "vibe";
|
|
120
|
+
if (is(host, "open.spotify.com")) return /\/track\//.test(path) ? "spotify" : null;
|
|
121
|
+
if (is(host, "spotify.link")) return "spotify";
|
|
122
|
+
if (is(host, "music.apple.com")) return url.searchParams.has("i") || /\/song\//.test(path) ? "apple" : null;
|
|
123
|
+
return null;
|
|
124
|
+
}
|
|
125
|
+
async function songFromUrl(input, { base = MUSIC_PLUG_URL } = {}) {
|
|
126
|
+
const service = linkService(input);
|
|
127
|
+
const url = firstUrl(input);
|
|
128
|
+
if (!service || !url) return null;
|
|
129
|
+
const id = youtubeId(url.href);
|
|
130
|
+
if (id) {
|
|
131
|
+
const start = youtubeStart(url.href);
|
|
132
|
+
return { service, url: url.href, song: await songFromYoutube(id), youtube: { id, ...start ? { start } : {} } };
|
|
133
|
+
}
|
|
134
|
+
try {
|
|
135
|
+
const res = await fetch(`${base}/api/song?url=${encodeURIComponent(url.href)}`, {
|
|
136
|
+
next: { revalidate: 86400 },
|
|
137
|
+
signal: AbortSignal.timeout(1e4)
|
|
138
|
+
});
|
|
139
|
+
if (res.ok) {
|
|
140
|
+
const data = await res.json();
|
|
141
|
+
if (data.title) {
|
|
142
|
+
return { service: data.service ?? service, url: data.url ?? url.href, song: { title: data.title, artist: data.artist ?? "" } };
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
} catch {
|
|
146
|
+
}
|
|
147
|
+
return { service, url: url.href, song: null };
|
|
148
|
+
}
|
|
91
149
|
export {
|
|
92
150
|
MUSIC_PLUG_URL,
|
|
93
151
|
SERVICES,
|
|
94
152
|
cleanTitle,
|
|
95
153
|
getService,
|
|
154
|
+
linkService,
|
|
96
155
|
listenGoUrl,
|
|
97
156
|
listenPageUrl,
|
|
157
|
+
songFromUrl,
|
|
98
158
|
songFromVideo,
|
|
99
159
|
songFromYoutube,
|
|
100
160
|
songQuery,
|
package/dist/player.d.ts
CHANGED
|
@@ -32,7 +32,8 @@ type Song = {
|
|
|
32
32
|
* - 고르면 그곳에서 이 곡을 연다 (Music plug가 곡을 찾아 보낸다. 폰에서는 앱으로). YouTube면 글 안에서 유튜브 플레이어가 열린다.
|
|
33
33
|
* - 고른 곳은 기억해서 다음부터는 누르면 바로 그곳에서 연다. 곡 옆에 옅게 '멜론 · 바꾸기'가 보이고, 바꾸기로 다시 고른다.
|
|
34
34
|
* 기억은 쿠키 mp_service(madeinbruno.com 아래에서는 Music plug와 같이)와 이 브라우저(localStorage)에 둔다.
|
|
35
|
-
* - 곡을 모르면(song이 null) 다른 곳에서 찾을 수 없어서 이 페이지에서 YouTube로만
|
|
35
|
+
* - 곡을 모르면(song이 null) 다른 곳에서 찾을 수 없어서 이 페이지에서 YouTube로만 튼다 (유튜브가 아닌 곡 링크면 그 링크를 연다).
|
|
36
|
+
* - 테마 음악을 정한 곡 링크(source)가 있으면, 듣는 사람이 같은 곳을 골랐을 때 찾지 않고 그 링크를 바로 연다.
|
|
36
37
|
* - 유튜브로 듣는 중에 읽어 내려가 플레이어가 화면 밖으로 나가면 왼쪽 아래에 멈추기·다시 듣기 단추가 뜬다 (avoid로 준 요소가 보일 때는 숨긴다).
|
|
37
38
|
*
|
|
38
39
|
* 스타일은 '@madeinbruno/music-plug/styles.css' (클래스는 모두 mp-). 곡 줄은 둘러싼 글의 색을 따르고, 듣기 플러그는 Music plug 색이다.
|
|
@@ -47,13 +48,18 @@ type PlugPlayerProps = {
|
|
|
47
48
|
id: string;
|
|
48
49
|
start?: number;
|
|
49
50
|
};
|
|
51
|
+
/** 이 곡을 정한 곡 링크 (songFromUrl이 준 service·url). 듣는 사람이 같은 곳을 고르면 그 링크를 바로 연다 */
|
|
52
|
+
source?: {
|
|
53
|
+
service: ServiceId;
|
|
54
|
+
url: string;
|
|
55
|
+
};
|
|
50
56
|
/** 유튜브 플레이어가 화면 밖일 때 뜨는 멈추기 단추를, 이 요소가 보이면 숨긴다 (예: '.mib-footer') */
|
|
51
57
|
avoid?: string;
|
|
52
58
|
/** Music plug 주소 (기본 https://musicplug.madeinbruno.com) */
|
|
53
59
|
base?: string;
|
|
54
60
|
className?: string;
|
|
55
61
|
};
|
|
56
|
-
declare function PlugPlayer({ song, fallbackLabel, youtube, avoid, base, className }: PlugPlayerProps): react.JSX.Element;
|
|
62
|
+
declare function PlugPlayer({ song, fallbackLabel, youtube, source, avoid, base, className }: PlugPlayerProps): react.JSX.Element;
|
|
57
63
|
/**
|
|
58
64
|
* Music plug 듣기 플러그: 어디서 들을지 고르는 창. Music plug의 /listen 화면과 같은 모양.
|
|
59
65
|
* 바깥을 누르거나 Esc로 닫는다.
|
package/dist/player.js
CHANGED
|
@@ -64,7 +64,7 @@ function saveChoice(id) {
|
|
|
64
64
|
const shared = host === SHARED_DOMAIN || host.endsWith(`.${SHARED_DOMAIN}`) ? `; domain=.${SHARED_DOMAIN}` : "";
|
|
65
65
|
document.cookie = `mp_service=${id}; path=/; max-age=31536000; samesite=lax${shared}`;
|
|
66
66
|
}
|
|
67
|
-
function PlugPlayer({ song, fallbackLabel = "\uC74C\uC545 \uB4E3\uAE30", youtube, avoid, base = MUSIC_PLUG_URL, className }) {
|
|
67
|
+
function PlugPlayer({ song, fallbackLabel = "\uC74C\uC545 \uB4E3\uAE30", youtube, source, avoid, base = MUSIC_PLUG_URL, className }) {
|
|
68
68
|
const [choice, setChoice] = useState(null);
|
|
69
69
|
const [sheet, setSheet] = useState(false);
|
|
70
70
|
const [open, setOpen] = useState(false);
|
|
@@ -82,7 +82,8 @@ function PlugPlayer({ song, fallbackLabel = "\uC74C\uC545 \uB4E3\uAE30", youtube
|
|
|
82
82
|
setPlaying(true);
|
|
83
83
|
return;
|
|
84
84
|
}
|
|
85
|
-
|
|
85
|
+
const direct = source && source.service === s.id && !youtube ? source.url : null;
|
|
86
|
+
window.open(direct ?? listenGoUrl(s.id, song, youtube, { base }), "_blank", "noopener");
|
|
86
87
|
}
|
|
87
88
|
function choose(s) {
|
|
88
89
|
saveChoice(s.id);
|
|
@@ -92,6 +93,7 @@ function PlugPlayer({ song, fallbackLabel = "\uC74C\uC545 \uB4E3\uAE30", youtube
|
|
|
92
93
|
}
|
|
93
94
|
function tap() {
|
|
94
95
|
if (!known && youtube) return play(SERVICES[0]);
|
|
96
|
+
if (!known && source) return void window.open(source.url, "_blank", "noopener");
|
|
95
97
|
if (remembered) play(remembered);
|
|
96
98
|
else setSheet(true);
|
|
97
99
|
}
|
package/package.json
CHANGED
|
@@ -1,50 +1,50 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@madeinbruno/music-plug",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "글 속 노래를 듣는 사람이 쓰는 음원 앱(멜론·지니·벅스·FLO·VIBE·Spotify·Apple Music·YouTube Music)에서, 없으면 YouTube로 바로 듣게 하는 플러그",
|
|
5
|
-
"license": "MIT",
|
|
6
|
-
"author": "codingbotPark <pbk575@gmail.com>",
|
|
7
|
-
"homepage": "https://madeinbruno.com",
|
|
8
|
-
"repository": {
|
|
9
|
-
"type": "git",
|
|
10
|
-
"url": "git+https://github.com/codingbotPark/madeinbruno.git",
|
|
11
|
-
"directory": "packages/music-plug"
|
|
12
|
-
},
|
|
13
|
-
"type": "module",
|
|
14
|
-
"sideEffects": [
|
|
15
|
-
"*.css"
|
|
16
|
-
],
|
|
17
|
-
"main": "./dist/index.js",
|
|
18
|
-
"types": "./dist/index.d.ts",
|
|
19
|
-
"exports": {
|
|
20
|
-
".": {
|
|
21
|
-
"types": "./dist/index.d.ts",
|
|
22
|
-
"import": "./dist/index.js"
|
|
23
|
-
},
|
|
24
|
-
"./player": {
|
|
25
|
-
"types": "./dist/player.d.ts",
|
|
26
|
-
"import": "./dist/player.js"
|
|
27
|
-
},
|
|
28
|
-
"./styles.css": "./styles.css"
|
|
29
|
-
},
|
|
30
|
-
"files": [
|
|
31
|
-
"dist",
|
|
32
|
-
"styles.css"
|
|
33
|
-
],
|
|
34
|
-
"scripts": {
|
|
35
|
-
"build": "tsup",
|
|
36
|
-
"dev": "tsup --watch",
|
|
37
|
-
"check": "tsc --noEmit",
|
|
38
|
-
"test": "node --test --experimental-strip-types src/*.test.ts",
|
|
39
|
-
"prepublishOnly": "pnpm build"
|
|
40
|
-
},
|
|
41
|
-
"peerDependencies": {
|
|
42
|
-
"react": ">=18"
|
|
43
|
-
},
|
|
44
|
-
"devDependencies": {
|
|
45
|
-
"@types/react": "^19",
|
|
46
|
-
"react": "19.2.3",
|
|
47
|
-
"tsup": "^8.5.0",
|
|
48
|
-
"typescript": "^5"
|
|
49
|
-
}
|
|
50
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@madeinbruno/music-plug",
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "글 속 노래를 듣는 사람이 쓰는 음원 앱(멜론·지니·벅스·FLO·VIBE·Spotify·Apple Music·YouTube Music)에서, 없으면 YouTube로 바로 듣게 하는 플러그",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"author": "codingbotPark <pbk575@gmail.com>",
|
|
7
|
+
"homepage": "https://madeinbruno.com",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/codingbotPark/madeinbruno.git",
|
|
11
|
+
"directory": "packages/music-plug"
|
|
12
|
+
},
|
|
13
|
+
"type": "module",
|
|
14
|
+
"sideEffects": [
|
|
15
|
+
"*.css"
|
|
16
|
+
],
|
|
17
|
+
"main": "./dist/index.js",
|
|
18
|
+
"types": "./dist/index.d.ts",
|
|
19
|
+
"exports": {
|
|
20
|
+
".": {
|
|
21
|
+
"types": "./dist/index.d.ts",
|
|
22
|
+
"import": "./dist/index.js"
|
|
23
|
+
},
|
|
24
|
+
"./player": {
|
|
25
|
+
"types": "./dist/player.d.ts",
|
|
26
|
+
"import": "./dist/player.js"
|
|
27
|
+
},
|
|
28
|
+
"./styles.css": "./styles.css"
|
|
29
|
+
},
|
|
30
|
+
"files": [
|
|
31
|
+
"dist",
|
|
32
|
+
"styles.css"
|
|
33
|
+
],
|
|
34
|
+
"scripts": {
|
|
35
|
+
"build": "tsup",
|
|
36
|
+
"dev": "tsup --watch",
|
|
37
|
+
"check": "tsc --noEmit",
|
|
38
|
+
"test": "tsup && node --test --experimental-strip-types src/*.test.ts",
|
|
39
|
+
"prepublishOnly": "pnpm build"
|
|
40
|
+
},
|
|
41
|
+
"peerDependencies": {
|
|
42
|
+
"react": ">=18"
|
|
43
|
+
},
|
|
44
|
+
"devDependencies": {
|
|
45
|
+
"@types/react": "^19",
|
|
46
|
+
"react": "19.2.3",
|
|
47
|
+
"tsup": "^8.5.0",
|
|
48
|
+
"typescript": "^5"
|
|
49
|
+
}
|
|
50
|
+
}
|
package/styles.css
CHANGED
|
@@ -1,232 +1,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
|
-
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
|
+
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
|
+
}
|