smooth out jump and clean up CSS a little bit

This commit is contained in:
MathMan05 2024-07-29 16:28:11 -05:00
parent 121de3d9b2
commit 92987ca77b
4 changed files with 23 additions and 18 deletions

View file

@ -141,11 +141,18 @@ class InfiniteScroller{
}
console.log(element,id,":3");
if(element){
element.scrollIntoView();
if(flash){
element.scrollIntoView({
behavior:"smooth",
block:"center"
});
await new Promise(resolve => setTimeout(resolve, 1000));
element.classList.remove("jumped");
await new Promise(resolve => setTimeout(resolve, 100));
element.classList.add("jumped");
}else{
element.scrollIntoView();
}
}else{
for(const thing of this.HTMLElements){