Browse Source

feat: 谱面滚动scrollTo,动画修改

TIANYONG 3 weeks ago
parent
commit
79f3ac631f
1 changed files with 3 additions and 2 deletions
  1. 3 2
      src/state.ts

+ 3 - 2
src/state.ts

@@ -1207,17 +1207,18 @@ export const scrollViewNote = (resetTop?: boolean) => {
     if (offsetTop === cursorElement.offsetTop || Math.abs(offsetTop - cursorElement.offsetTop) < 30) return;
   }
   offsetTop = cursorElement.offsetTop;
+  const animateType = browser().android ? "instant" : "smooth"
   if (offsetTop > (state.headTopHeight + 30)) {
     musicScrollTop = (offsetTop - state.headTopHeight - 30) * state.musicZoom
     musicAndSelection.scrollTo({
       top: (offsetTop - state.headTopHeight - 30) * state.musicZoom,
-      behavior: "smooth",
+      behavior: animateType,
     });
   } else {
     musicScrollTop = 0
     musicAndSelection.scrollTo({
       top: 0,
-      behavior: "smooth",
+      behavior: animateType,
     });
   }
 };