diff --git a/public/assets/din1451alt.ttf b/public/assets/din1451alt.ttf new file mode 100644 index 0000000..aef931a Binary files /dev/null and b/public/assets/din1451alt.ttf differ diff --git a/src/components/TrackItem.vue b/src/components/TrackItem.vue new file mode 100644 index 0000000..c190ad4 --- /dev/null +++ b/src/components/TrackItem.vue @@ -0,0 +1,27 @@ + + + + + + {{ index + 1 }} + + + {{ track.name }} + + {{ artistsOrganize(track.artists ?? []) }} + + + + + + \ No newline at end of file diff --git a/src/pages/AlbumDetail.vue b/src/pages/AlbumDetail.vue index 7ad7a14..c722a96 100644 --- a/src/pages/AlbumDetail.vue +++ b/src/pages/AlbumDetail.vue @@ -3,6 +3,8 @@ import { ref, onMounted } from 'vue' import apis from '../apis' import { useRoute } from 'vue-router' import { usePlayQueueStore } from '../stores/usePlayQueueStore' +import { artistsOrganize } from '../utils' +import TrackItem from '../components/TrackItem.vue' const album = ref() @@ -24,13 +26,6 @@ onMounted(async () => { } }) -function artistsOrganize(list: string[]) { - if (list.length === 0) { return '未知音乐人' } - return list.map((artist) => { - return artist - }).join(' / ') -} - function playTheAlbum() { if (playQueue.queueReplaceLock) { if (!confirm("当前操作会将你的待播列表清空、放入这张专辑所有曲目,并从新待播清单的开头播放。继续吗?")) { return } @@ -112,19 +107,7 @@ function playTheAlbum() { - - - {{ index + 1 }} - - - {{ track.name }} - - {{ artistsOrganize(track.artists ?? []) }} - - - + diff --git a/src/style.css b/src/style.css index f5d6ce2..8c2c557 100644 --- a/src/style.css +++ b/src/style.css @@ -7,6 +7,13 @@ font-display: swap; } +@font-face { + font-family: 'Alte DIN'; + src: url('/assets/din1451alt.ttf') format('truetype-variations'); + font-weight: 1 999; + font-display: swap; +} + * { @apply font-[MiSans]; } @@ -17,4 +24,8 @@ button { input { @apply focus:outline-none; +} + +.track_num { + font-family: 'DIN Alternate', 'Alte DIN' !important; } \ No newline at end of file diff --git a/src/utils/artistsOrganize.ts b/src/utils/artistsOrganize.ts new file mode 100644 index 0000000..f25a8b1 --- /dev/null +++ b/src/utils/artistsOrganize.ts @@ -0,0 +1,6 @@ +export default (list: string[]) => { + if (list.length === 0) { return '未知音乐人' } + return list.map((artist) => { + return artist + }).join(' / ') +} \ No newline at end of file diff --git a/src/utils/index.ts b/src/utils/index.ts new file mode 100644 index 0000000..07aa77b --- /dev/null +++ b/src/utils/index.ts @@ -0,0 +1,3 @@ +import artistsOrganize from "./artistsOrganize" + +export { artistsOrganize }