feat: add new website design and tech stack

This commit is contained in:
Stefan Imhoff
2022-02-08 19:46:50 +01:00
parent f76fd39fee
commit 165152beba
495 changed files with 16157 additions and 361 deletions

View File

@@ -0,0 +1,27 @@
export function scrollHandler() {
const body = document.body;
const scrollUp = 'scroll-up';
const scrollDown = 'scroll-down';
let lastScroll = 0;
window.addEventListener('scroll', () => {
const currentScroll = window.pageYOffset;
if (currentScroll <= 0) {
body.classList.remove(scrollUp);
return;
}
if (currentScroll > lastScroll && !body.classList.contains(scrollDown)) {
body.classList.remove(scrollUp);
body.classList.add(scrollDown);
} else if (
currentScroll < lastScroll &&
body.classList.contains(scrollDown)
) {
body.classList.remove(scrollDown);
body.classList.add(scrollUp);
}
lastScroll = currentScroll;
});
}