Skip to content

Commit

Permalink
Fix: smooth lyrics
Browse files Browse the repository at this point in the history
  • Loading branch information
sawyerf committed Dec 3, 2024
1 parent 2194f36 commit 2ba2e23
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions app/components/player/FullScreenPlayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,22 @@ const FullScreenPlayer = ({ fullscreen, time }) => {
if (index < lyrics.length - 2 && time.position >= lyrics[index + 2]?.time) return null
const isCurrent = time.position >= lyric.time && (lyrics.length == index + 1 || time.position < lyrics[index + 1]?.time)
return (
<Text
key={index}
style={{ color: isCurrent ? theme.primaryLight : theme.secondaryLight, fontSize: 23, textAlign: 'center' }}>
{lyric.text.length ? lyric.text : '...'}
</Text>)
<View style={{
display: 'flex',
justifyContent: 'flex-end',
minHeight: ((time.position > lyric.time && !isCurrent) || !index) ? 62 : 0,
}}>
<Text
key={index}
style={{
color: isCurrent ? theme.primaryLight : theme.secondaryLight,
fontSize: 23,
textAlign: 'center',
}}>
{lyric.text.length ? lyric.text : '...'}
</Text>
</View>
)
})}
</ScrollView>
}
Expand Down

0 comments on commit 2ba2e23

Please sign in to comment.