fix: 修复移动端全屏歌词前奏阶段第一句歌词不可见

getLrcStyle 在当前行无条件设置 color: transparent,
但前奏阶段 originalStyle 无 backgroundImage,导致文字透明不可见
This commit is contained in:
alger
2026-03-22 18:31:58 +08:00
parent 91ecad7f3d
commit 8e1dcd5c06

View File

@@ -1133,16 +1133,24 @@ 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(/#ffffff/g, colors.active)
.replace(/#ffffff8a/g, `${colors.primary}`),
backgroundClip: 'text',
WebkitBackgroundClip: 'text',
color: 'transparent'
};
}
// 当前行但播放时间未到(前奏/间奏),用高亮色显示
return {
color: colors.active
};
}
// 非当前播放的歌词,使用普通颜色
return {