mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-18 06:54:15 +00:00
fix opacity anim
This commit is contained in:
parent
af6c217176
commit
12a9b8eba8
@ -19,8 +19,8 @@ const LyricsText = React.forwardRef((props, textRef) => {
|
|||||||
|
|
||||||
const lineIndex = lyrics.synced_lyrics.findIndex((line) => {
|
const lineIndex = lyrics.synced_lyrics.findIndex((line) => {
|
||||||
return (
|
return (
|
||||||
currentTrackTime >= line.startTimeMs &&
|
currentTrackTime >= (line.startTimeMs ?? line.start_ms) &&
|
||||||
currentTrackTime <= line.endTimeMs
|
currentTrackTime <= (line.endTimeMs ?? line.end_ms)
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -123,12 +123,11 @@ const LyricsText = React.forwardRef((props, textRef) => {
|
|||||||
return (
|
return (
|
||||||
<div className="lyrics-text-wrapper">
|
<div className="lyrics-text-wrapper">
|
||||||
<AnimatePresence>
|
<AnimatePresence>
|
||||||
{visible && (
|
|
||||||
<motion.div
|
<motion.div
|
||||||
ref={textRef}
|
ref={textRef}
|
||||||
className="lyrics-text"
|
className="lyrics-text"
|
||||||
animate={{
|
animate={{
|
||||||
opacity: 1,
|
opacity: visible ? 1 : 0,
|
||||||
}}
|
}}
|
||||||
initial={{
|
initial={{
|
||||||
opacity: 0,
|
opacity: 0,
|
||||||
@ -156,7 +155,6 @@ const LyricsText = React.forwardRef((props, textRef) => {
|
|||||||
)
|
)
|
||||||
})}
|
})}
|
||||||
</motion.div>
|
</motion.div>
|
||||||
)}
|
|
||||||
</AnimatePresence>
|
</AnimatePresence>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user