Humany
rt = gup("go", false); if(goCart){ window.setTimeout( function(){ window.location.href = "/go/"+goCart+"?session=true"; }, 500 ); } var userScrollIntent = false; var scrollKeys = { ArrowDown: true, ArrowUp: true, End: true, Home: true, PageDown: true, PageUp: true, ' ': true }; function markUserScrollIntent(event) { if (!event.isTrusted) { return; } if (event.type !== 'keydown' || scrollKeys[event.key]) { userScrollIntent = true; } } function markScrollbarScrollIntent(event) { if (!event.isTrusted) { return; } var scrollbarStart = document.documentElement.clientWidth; if (scrollbarStart < window.innerWidth) { if (event.clientX >= scrollbarStart) { userScrollIntent = true; } return; } // Overlay scrollbar events target the document root without reducing client width. if (event.target === document.documentElement && event.clientX >= window.innerWidth - 20) { userScrollIntent = true; } } window.addEventListener('wheel', markUserScrollIntent, { passive: true }); window.addEventListener('touchmove', markUserScrollIntent, { passive: true }); window.addEventListener('keydown', markUserScrollIntent); window.addEventListener('pointerdown', markScrollbarScrollIntent, { passive: true }); window.addEventListener('scroll', function() { var currentScrollPos = window.pageYOffset; var topNav = document.getElementsByClassName("navbar-top")[0] || false; if (!topNav || topNav.offsetHeight === 0) { return; } var targetOffset = topNav.offsetHeight; if (currentScrollPos <= 0) { topNav.style.transition = "none"; topNav.style.marginTop = "0px"; return; } if (userScrollIntent) { topNav.style.transition = "margin-top 400ms ease-in-out"; topNav.style.marginTop = "-" + targetOffset + "px"; } });