diff --git a/web/src/views/Home.vue b/web/src/views/Home.vue index 44610f0..5f58b5d 100644 --- a/web/src/views/Home.vue +++ b/web/src/views/Home.vue @@ -67,15 +67,15 @@

推荐歌单

-
{{ playlist.name }}
-
+
@@ -83,16 +83,16 @@

我的歌单

-
{{ pl.name }}
{{ pl.songCount }} 首
-
+
@@ -343,6 +343,9 @@ onMounted(async () => { .playlist-card { cursor: pointer; + display: block; + text-decoration: none; + color: inherit; } .playlist-name { diff --git a/web/src/views/Lyrics.vue b/web/src/views/Lyrics.vue index f7de78f..4c6f1da 100644 --- a/web/src/views/Lyrics.vue +++ b/web/src/views/Lyrics.vue @@ -110,9 +110,20 @@ function findActiveLine(elapsed: number): number { function scrollToActiveLine(idx: number) { const el = lineRefs.value[idx]; - if (el && scrollContainer.value) { - el.scrollIntoView({ behavior: 'smooth', block: 'center' }); - } + const container = scrollContainer.value; + if (!el || !container) return; + + // Calculate target scroll position to center the active line + const containerHeight = container.clientHeight; + const lineTop = el.offsetTop; + const lineHeight = el.offsetHeight; + const targetScroll = lineTop - containerHeight / 2 + lineHeight / 2; + + // Smooth scroll using CSS scroll-behavior or manual animation + container.scrollTo({ + top: targetScroll, + behavior: 'smooth', + }); } function syncLyrics() {