compare-plans animation POC

This commit is contained in:
tglide
2023-09-05 17:23:41 +01:00
parent 584654c4ee
commit e574a95c02
5 changed files with 128 additions and 9 deletions

View File

@@ -0,0 +1,8 @@
let lastScrollPos = 0;
export function getScrollDir() {
const scrollPos = window.scrollY;
const scrollDir = scrollPos > lastScrollPos ? 'down' : 'up';
lastScrollPos = scrollPos;
return scrollDir;
}