Commit 5272a07

HPCesia <me@hpcesia.com>
2025-01-21 11:19:42
fix: read percentage
1 parent bfcbfbd
Changed files (1)
src
src/components/SideToolBar.astro
@@ -62,7 +62,7 @@ import DarkModeButton from './widgets/DarkModeButton.astro';
       const bottomPos =
         (document.getElementById('comment') || document.getElementById('footer'))?.offsetTop ||
         document.documentElement.scrollHeight;
-      const isNearEnd = window.screenY + document.documentElement.clientHeight >= bottomPos;
+      const isNearEnd = window.scrollY + document.documentElement.clientHeight >= bottomPos;
       if (isNearEnd) {
         stbReadPercent?.classList.add('opacity-0');
         stbBackToTopIcon?.classList.remove('opacity-0');