{ let currentScroll = window.pageYOffset || document.documentElement.scrollTop; if (currentScroll > lastScroll && currentScroll > headerHeight) { header.classList.add('header-hidden'); } else { header.classList.remove('header-hidden'); } lastScroll = currentScroll; }); } }" >