There was an error while loading. Please reload this page.
1 parent bdb3994 commit 1cbf62aCopy full SHA for 1cbf62a
1 file changed
src/components/home/Header.tsx
@@ -11,7 +11,10 @@ export default function Header() {
11
const [scrolled, setScrolled] = useState(false);
12
13
useEffect(() => {
14
- const onScroll = () => setScrolled(window.scrollY > 60);
+ const onScroll = () => {
15
+ const threshold = window.innerHeight * 0.95 - 72;
16
+ setScrolled(window.scrollY >= threshold);
17
+ };
18
window.addEventListener('scroll', onScroll, { passive: true });
19
return () => window.removeEventListener('scroll', onScroll);
20
}, []);
0 commit comments