var last_scroll_top = 0;

function onscroll() {
  let sctp = document.documentElement.scrollTop;
  if (sctp > last_scroll_top + 200) {
    document.getElementById("header").classList.add("slide-away");
    last_scroll_top = sctp;
  }
  if (sctp < last_scroll_top) {
    document.getElementById("header").classList.remove("slide-away");
    last_scroll_top = sctp;
  }
}

window.addEventListener("scroll", onscroll);
window.addEventListener("wheel", onscroll);
