improve lyrics scrolling
This commit is contained in:
parent
1f47407622
commit
4ac8394098
1 changed files with 8 additions and 9 deletions
|
@ -160,6 +160,12 @@ const app = new Vue({
|
||||||
self.playerLCD.playbackDuration = (self.mk.currentPlaybackTime)
|
self.playerLCD.playbackDuration = (self.mk.currentPlaybackTime)
|
||||||
self.lyriccurrenttime = app.mk.currentPlaybackTime;
|
self.lyriccurrenttime = app.mk.currentPlaybackTime;
|
||||||
|
|
||||||
|
if (document.querySelector(".lyric-line.active")) {
|
||||||
|
document.querySelector(".lyric-line.active").scrollIntoView({
|
||||||
|
behavior: "smooth",
|
||||||
|
block: "center"
|
||||||
|
})
|
||||||
|
}
|
||||||
// animated dot like AM - bad perf
|
// animated dot like AM - bad perf
|
||||||
if (self.lyricon && self.drawertest){
|
if (self.lyricon && self.drawertest){
|
||||||
let currentLine = document.querySelector(`.lyric-line.active`)
|
let currentLine = document.querySelector(`.lyric-line.active`)
|
||||||
|
@ -602,15 +608,8 @@ const app = new Vue({
|
||||||
},
|
},
|
||||||
getLyricClass(start, end) {
|
getLyricClass(start, end) {
|
||||||
//this.lyriccurrenttime = app.getCurrentTime();
|
//this.lyriccurrenttime = app.getCurrentTime();
|
||||||
if (this.lyriccurrenttime >= start && this.lyriccurrenttime <= end) {
|
const delayfix = 0.5
|
||||||
setTimeout(() => {
|
if (this.lyriccurrenttime + delayfix >= start && this.lyriccurrenttime + delayfix <= end) {
|
||||||
if (document.querySelector(".lyric-line.active")) {
|
|
||||||
document.querySelector(".lyric-line.active").scrollIntoView({
|
|
||||||
behavior: "smooth",
|
|
||||||
block: "center"
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}, 200)
|
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue