优化歌词在短时间内快速播放时的滚动效果

This commit is contained in:
lyswhut
2023-09-02 13:39:46 +08:00
parent ed858bafdc
commit 5e7ef691ae
5 changed files with 150 additions and 75 deletions
@@ -35,10 +35,6 @@ export default (isComputeHeight) => {
const handleScrollLrc = (duration = 300) => {
if (!dom_lines?.length || !dom_lyric.value) return
if (cancelScrollFn) {
cancelScrollFn()
cancelScrollFn = null
}
if (isStopScroll) return
let dom_p = dom_lines[lyric.line]
@@ -161,10 +157,6 @@ export default (isComputeHeight) => {
if (lines.length) {
setLyric(lines)
} else {
if (cancelScrollFn) {
cancelScrollFn()
cancelScrollFn = null
}
cancelScrollFn = scrollTo(dom_lyric.value, 0, 300, () => {
if (lyric.lines !== lines) return
setLyric(lines)
@@ -35,10 +35,6 @@ export default (isComputeWidth) => {
const handleScrollLrc = (duration = 300) => {
if (!dom_lines?.length || !dom_lyric.value) return
if (cancelScrollFn) {
cancelScrollFn()
cancelScrollFn = null
}
if (isStopScroll) return
let dom_p = dom_lines[lyric.line]
@@ -161,10 +157,6 @@ export default (isComputeWidth) => {
if (lines.length) {
setLyric(lines)
} else {
if (cancelScrollFn) {
cancelScrollFn()
cancelScrollFn = null
}
cancelScrollFn = scrollXRTo(dom_lyric.value, 0, 300, () => {
if (lyric.lines !== lines) return
setLyric(lines)