From 6ced902d93be20c5df2e22eeaa916329c3df5874 Mon Sep 17 00:00:00 2001 From: Jannis Mattheis Date: Sun, 3 Aug 2025 22:11:17 +0200 Subject: [PATCH] fix: later scroll button --- ui/src/common/ScrollUpButton.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/src/common/ScrollUpButton.tsx b/ui/src/common/ScrollUpButton.tsx index 9bd7429..cf04c7f 100644 --- a/ui/src/common/ScrollUpButton.tsx +++ b/ui/src/common/ScrollUpButton.tsx @@ -6,8 +6,8 @@ const ScrollUpButton = () => { const [state, setState] = React.useState({display: 'none', opacity: 0}); React.useEffect(() => { const scrollHandler = () => { - const currentScrollPos = window.pageYOffset; - const opacity = Math.min(currentScrollPos / 500, 1); + const currentScrollPos = Math.max(window.pageYOffset - 1000, 0); + const opacity = Math.min(currentScrollPos / 1000, 1); const nextState = {display: currentScrollPos > 0 ? 'inherit' : 'none', opacity}; if (state.display !== nextState.display || state.opacity !== nextState.opacity) { setState(nextState);