const navUp = () => nav.style.top = Math.min(parseInt(nav.style.top,10) + (oldScrollY - window.scrollY), 0) + 'px'
const navDown = () => nav.style.top = Math.max(parseInt(nav.style.top,10) - (window.scrollY - oldScrollY), -nav.offsetHeight) + 'px'
nav.style.top = 0 + 'px'
- window.onscroll = () => {
+ const navUpdate = () => {
if (window.matchMedia("(orientation: portrait)").matches) {
if (window.scrollY < oldScrollY) /* up */ {
if (upDelay-- <= 0)
}
oldScrollY = window.scrollY
}
+ window.requestAnimationFrame(navUpdate)
}
+ navUpdate();
}
const resizeIFrame = (iframe) => {