mirror of
https://github.com/algerkong/AlgerMusicPlayer.git
synced 2026-04-25 08:47:22 +08:00
fix: 修复移动端全屏歌词前奏阶段第一句歌词不可见
getLrcStyle 在当前行无条件设置 color: transparent, 但前奏阶段 originalStyle 无 backgroundImage,导致文字透明不可见
This commit is contained in:
@@ -1133,14 +1133,22 @@ const getLrcStyle = (index: number) => {
|
|||||||
|
|
||||||
if (index === nowIndex.value) {
|
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 {
|
return {
|
||||||
...originalStyle,
|
color: colors.active
|
||||||
backgroundImage: originalStyle.backgroundImage
|
|
||||||
?.replace(/#ffffff/g, colors.active)
|
|
||||||
.replace(/#ffffff8a/g, `${colors.primary}`),
|
|
||||||
backgroundClip: 'text',
|
|
||||||
WebkitBackgroundClip: 'text',
|
|
||||||
color: 'transparent'
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user