From 8e1dcd5c066a90e5236ed0fa45c2b1af8e74cf54 Mon Sep 17 00:00:00 2001 From: alger Date: Sun, 22 Mar 2026 18:31:58 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E7=A7=BB=E5=8A=A8?= =?UTF-8?q?=E7=AB=AF=E5=85=A8=E5=B1=8F=E6=AD=8C=E8=AF=8D=E5=89=8D=E5=A5=8F?= =?UTF-8?q?=E9=98=B6=E6=AE=B5=E7=AC=AC=E4=B8=80=E5=8F=A5=E6=AD=8C=E8=AF=8D?= =?UTF-8?q?=E4=B8=8D=E5=8F=AF=E8=A7=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit getLrcStyle 在当前行无条件设置 color: transparent, 但前奏阶段 originalStyle 无 backgroundImage,导致文字透明不可见 --- .../components/lyric/MusicFullMobile.vue | 22 +++++++++++++------ 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/src/renderer/components/lyric/MusicFullMobile.vue b/src/renderer/components/lyric/MusicFullMobile.vue index c2d8aca..e067582 100644 --- a/src/renderer/components/lyric/MusicFullMobile.vue +++ b/src/renderer/components/lyric/MusicFullMobile.vue @@ -1133,14 +1133,22 @@ const getLrcStyle = (index: number) => { if (index === nowIndex.value) { // 当前播放的歌词,使用渐变效果 + // 只有原始样式包含 backgroundImage 时才设置 color: transparent + // 否则前奏阶段文字会因 transparent 而不可见 + if (originalStyle.backgroundImage) { + return { + ...originalStyle, + backgroundImage: originalStyle.backgroundImage + .replace(/#ffffff/g, colors.active) + .replace(/#ffffff8a/g, `${colors.primary}`), + backgroundClip: 'text', + WebkitBackgroundClip: 'text', + color: 'transparent' + }; + } + // 当前行但播放时间未到(前奏/间奏),用高亮色显示 return { - ...originalStyle, - backgroundImage: originalStyle.backgroundImage - ?.replace(/#ffffff/g, colors.active) - .replace(/#ffffff8a/g, `${colors.primary}`), - backgroundClip: 'text', - WebkitBackgroundClip: 'text', - color: 'transparent' + color: colors.active }; }