Skip to content

Commit cb3b407

Browse files
committed
🌈 style: 优化部分样式
1 parent fe5dfcd commit cb3b407

6 files changed

Lines changed: 138 additions & 115 deletions

File tree

src/components/Card/SongCard.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
{{ song.quality }}
5252
</n-tag>
5353
<!-- 原唱翻唱 -->
54-
<template>
54+
<template v-if="settingStore.showSongOriginalTag">
5555
<n-tag v-if="song.originCoverType === 1" :bordered="false" type="primary" round>
5656
5757
</n-tag>
Lines changed: 45 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,52 @@
11
<template>
22
<div class="copy-lyrics">
3-
43
<n-scrollbar class="lyrics-list">
54
<n-checkbox-group v-model:value="selectedLines">
6-
<div v-for="line in displayLyrics" :key="line.index" class="lyric-item">
7-
<n-checkbox :value="line.index" class="lyric-checkbox">
8-
<div class="lyric-content">
9-
<div v-if="showOriginal && line.text" class="text">{{ line.text }}</div>
10-
<div v-if="showTranslation && line.translation" class="translation">
11-
{{ line.translation }}
12-
</div>
13-
<div v-if="showRomaji && line.romaji" class="romaji">{{ line.romaji }}</div>
14-
</div>
15-
</n-checkbox>
16-
</div>
5+
<n-list hoverable>
6+
<n-list-item v-for="line in displayLyrics" :key="line.index">
7+
<n-checkbox :value="line.index" class="lyric-checkbox">
8+
<n-flex size="small" class="lyric-content" vertical>
9+
<n-text v-if="line.text" class="text">{{ line.text }}</n-text>
10+
<n-text v-if="showTranslation && line.translation" depth="1" class="translation">
11+
{{ line.translation }}
12+
</n-text>
13+
<n-text v-if="showRomaji && line.romaji" depth="3" class="romaji">
14+
{{ line.romaji }}
15+
</n-text>
16+
</n-flex>
17+
</n-checkbox>
18+
</n-list-item>
19+
</n-list>
1720
</n-checkbox-group>
1821
</n-scrollbar>
19-
20-
<div class="footer">
21-
<div class="filters">
22+
<n-flex align="center" justify="space-between" class="footer">
23+
<n-flex align="center">
2224
<n-checkbox-group v-model:value="selectedFilters">
23-
<n-space>
24-
<n-checkbox value="original" label="原词" />
25+
<n-flex align="center">
2526
<n-checkbox value="translation" label="翻译" />
2627
<n-checkbox value="romaji" label="音译" />
27-
</n-space>
28+
</n-flex>
2829
</n-checkbox-group>
29-
</div>
30-
<div class="actions">
31-
<n-button class="action-btn" @click="selectAll">全选</n-button>
32-
<n-button
33-
class="action-btn"
34-
type="primary"
35-
:disabled="selectedLines.length === 0"
36-
@click="handleCopy"
37-
>
30+
</n-flex>
31+
<n-flex align="center">
32+
<n-button @click="selectAll">全选</n-button>
33+
<n-button type="primary" :disabled="selectedLines.length === 0" @click="handleCopy">
3834
复制 ({{ selectedLines.length }})
3935
</n-button>
40-
</div>
41-
</div>
36+
</n-flex>
37+
</n-flex>
4238
</div>
4339
</template>
4440

4541
<script setup lang="ts">
4642
import { useMusicStore } from "@/stores";
47-
import { useClipboard } from "@vueuse/core";
43+
import { copyData } from "@/utils/helper";
4844
49-
const props = defineProps<{
50-
onClose: () => void;
51-
}>();
45+
const props = defineProps<{ onClose: () => void }>();
5246
5347
const musicStore = useMusicStore();
54-
const { copy } = useClipboard();
5548
56-
const selectedFilters = ref<string[]>(["original", "translation", "romaji"]);
49+
const selectedFilters = ref<string[]>(["translation", "romaji"]);
5750
const selectedLines = ref<number[]>([]);
5851
5952
const rawLyrics = computed(() => {
@@ -77,7 +70,6 @@ const displayLyrics = computed(() => {
7770
});
7871
});
7972
80-
const showOriginal = computed(() => selectedFilters.value.includes("original"));
8173
const showTranslation = computed(() => selectedFilters.value.includes("translation"));
8274
const showRomaji = computed(() => selectedFilters.value.includes("romaji"));
8375
@@ -89,12 +81,15 @@ const selectAll = () => {
8981
}
9082
};
9183
84+
/**
85+
* 复制歌词
86+
*/
9287
const handleCopy = async () => {
9388
const linesToCopy = displayLyrics.value
9489
.filter((l) => selectedLines.value.includes(l.index))
9590
.map((l) => {
9691
const parts: string[] = [];
97-
if (showOriginal.value && l.text) parts.push(l.text);
92+
if (l.text) parts.push(l.text);
9893
if (showTranslation.value && l.translation) parts.push(l.translation);
9994
if (showRomaji.value && l.romaji) parts.push(l.romaji);
10095
return parts.join("\n");
@@ -103,8 +98,7 @@ const handleCopy = async () => {
10398
.join("\n\n");
10499
105100
if (linesToCopy) {
106-
await copy(linesToCopy);
107-
window.$message.success("复制成功");
101+
await copyData(linesToCopy);
108102
props.onClose();
109103
} else {
110104
window.$message.warning("没有可复制的内容");
@@ -120,68 +114,27 @@ const handleCopy = async () => {
120114
width: 100%;
121115
}
122116
123-
124117
.lyrics-list {
125118
flex: 1;
126-
padding: 12px 20px;
127-
128-
.lyric-item {
129-
margin-bottom: 12px;
130-
padding: 8px;
131-
border-radius: 8px;
132-
transition: background-color 0.2s;
133119
134-
&:hover {
135-
background-color: rgba(0, 0, 0, 0.05);
136-
}
137-
138-
.lyric-checkbox {
139-
width: 100%;
140-
align-items: flex-start;
120+
.lyric-checkbox {
121+
width: 100%;
122+
}
141123
142-
:deep(.n-checkbox__label) {
143-
flex: 1;
144-
}
124+
.lyric-content {
125+
font-size: 14px;
126+
line-height: 1.6;
127+
.translation {
128+
font-size: 12px;
145129
}
146-
147-
.lyric-content {
148-
font-size: 14px;
149-
line-height: 1.6;
150-
151-
.text {
152-
font-weight: 500;
153-
}
154-
.translation {
155-
color: var(--n-text-color-3);
156-
font-size: 13px;
157-
}
158-
.romaji {
159-
color: var(--n-text-color-3);
160-
font-size: 12px;
161-
font-style: italic;
162-
}
130+
.romaji {
131+
font-size: 12px;
132+
font-style: italic;
163133
}
164134
}
165135
}
166136
167137
.footer {
168-
padding: 16px 20px;
169-
display: flex;
170-
justify-content: space-between;
171-
align-items: center;
172-
border-top: 1px solid var(--n-border-color);
173-
174-
.filters {
175-
display: flex;
176-
align-items: center;
177-
}
178-
179-
.actions {
180-
display: flex;
181-
gap: 12px;
182-
.action-btn {
183-
width: 90px;
184-
}
185-
}
138+
margin-top: 20px;
186139
}
187140
</style>

src/components/Player/LyricMenu.vue

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
<template>
22
<n-flex class="menu" justify="center" vertical>
3+
<div class="menu-icon" @click="openCopyLyrics">
4+
<SvgIcon name="Copy" />
5+
</div>
6+
<div class="divider" />
37
<div class="menu-icon" @click="changeOffset(-500)">
48
<SvgIcon name="Replay5" />
59
</div>
@@ -13,9 +17,6 @@
1317
<div class="menu-icon" @click="openSetting('lyrics')">
1418
<SvgIcon name="Settings" />
1519
</div>
16-
<div class="menu-icon" @click="openCopyLyrics">
17-
<SvgIcon name="Copy" />
18-
</div>
1920
</n-flex>
2021
</template>
2122

src/components/Player/MainPlayer.vue

Lines changed: 50 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@
190190
import type { DropdownOption } from "naive-ui";
191191
import { useMusicStore, useStatusStore, useDataStore, useSettingStore } from "@/stores";
192192
import { msToTime, convertSecondsToTime } from "@/utils/time";
193-
import { renderIcon, coverLoaded } from "@/utils/helper";
193+
import { renderIcon, coverLoaded, copyData } from "@/utils/helper";
194194
import { toLikeSong } from "@/utils/auth";
195195
import {
196196
openAutoClose,
@@ -216,6 +216,55 @@ const songMoreOptions = computed<DropdownOption[]>(() => {
216216
const isSong = song.type === "song";
217217
const isLocal = !!song?.path;
218218
return [
219+
{
220+
key: "more",
221+
label: "更多操作",
222+
icon: renderIcon("Menu", { size: 18 }),
223+
children: [
224+
{
225+
key: "code-name",
226+
label: `复制${song.type === "song" ? "歌曲" : "节目"}名称`,
227+
props: {
228+
onClick: () => copyData(song.name),
229+
},
230+
icon: renderIcon("Copy", { size: 18 }),
231+
},
232+
{
233+
key: "code-id",
234+
label: `复制${song.type === "song" ? "歌曲" : "节目"} ID`,
235+
show: !isLocal,
236+
props: {
237+
onClick: () => copyData(song.id),
238+
},
239+
icon: renderIcon("Copy", { size: 18 }),
240+
},
241+
{
242+
key: "share",
243+
label: `分享${song.type === "song" ? "歌曲" : "节目"}链接`,
244+
show: !isLocal,
245+
props: {
246+
onClick: () =>
247+
copyData(
248+
`https://music.163.com/#/${song.type}?id=${song.id}`,
249+
"已复制分享链接到剪切板",
250+
),
251+
},
252+
icon: renderIcon("Share", { size: 18 }),
253+
},
254+
],
255+
},
256+
{
257+
key: "search",
258+
label: "同名搜索",
259+
props: {
260+
onClick: () => router.push({ name: "search", query: { keyword: song.name } }),
261+
},
262+
icon: renderIcon("Search"),
263+
},
264+
{
265+
key: "line",
266+
type: "divider",
267+
},
219268
{
220269
key: "playlist-add",
221270
label: "添加到歌单",

src/components/Setting/AboutSetting.vue

Lines changed: 37 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
</div>
3939
<div class="set-list">
4040
<n-h3 prefix="bar"> 特别鸣谢 </n-h3>
41-
<n-flex class="link">
41+
<n-flex :size="12" class="link">
4242
<n-card
4343
v-for="(item, index) in contributors"
4444
:key="index"
@@ -57,7 +57,7 @@
5757
</div>
5858
<div class="set-list">
5959
<n-h3 prefix="bar"> 社区与资讯 </n-h3>
60-
<n-flex class="link">
60+
<n-flex :size="12" class="link">
6161
<n-card
6262
v-for="(item, index) in communityData"
6363
:key="index"
@@ -109,9 +109,30 @@ const statusStore = useStatusStore();
109109
// 特别鸣谢
110110
const contributors = [
111111
{
112-
name: "imsyy",
113-
url: "https://github.com/imsyy",
114-
description: "SPlayer 作者",
112+
name: "NeteaseCloudMusicApi",
113+
url: "https://github.com/Binaryify/NeteaseCloudMusicApi",
114+
description: "网易云音乐 API",
115+
},
116+
// https://github.com/neteasecloudmusicapienhanced/api-enhanced
117+
{
118+
name: "NeteaseCloudMusicApiEnhanced",
119+
url: "https://github.com/neteasecloudmusicapienhanced/api-enhanced",
120+
description: "网易云音乐 API 备份 + 增强",
121+
},
122+
{
123+
name: "YesPlayMusic",
124+
url: "https://github.com/qier222/YesPlayMusic",
125+
description: "高颜值的第三方网易云播放器",
126+
},
127+
{
128+
name: "UnblockNeteaseMusic",
129+
url: "https://github.com/UnblockNeteaseMusic/server",
130+
description: "Revive unavailable songs for Netease Cloud Music",
131+
},
132+
{
133+
name: "applemusic-like-lyrics",
134+
url: "https://github.com/Steve-xmh/applemusic-like-lyrics",
135+
description: "类 Apple Music 歌词显示组件库",
115136
},
116137
];
117138
@@ -202,19 +223,17 @@ onMounted(getUpdateData);
202223
}
203224
}
204225
}
205-
.link {
206-
.link-item {
207-
max-width: 200px;
208-
border-radius: 8px;
209-
cursor: pointer;
210-
:deep(.n-card__content) {
211-
display: flex;
212-
align-items: center;
213-
padding: 12px;
214-
}
215-
.n-icon {
216-
margin-right: 6px;
217-
}
226+
.link-item {
227+
max-width: 200px;
228+
border-radius: 8px;
229+
cursor: pointer;
230+
:deep(.n-card__content) {
231+
display: flex;
232+
align-items: center;
233+
padding: 12px;
234+
}
235+
.n-icon {
236+
margin-right: 6px;
218237
}
219238
}
220239
</style>

src/views/Search/songs.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
v-if="searchCount > 0"
66
:data="searchResultData"
77
:loading="loading"
8+
doubleClickAction="add"
89
loadMore
910
disabledSort
1011
@reachBottom="reachBottom"

0 commit comments

Comments
 (0)