1function initMenu(){ 2 var menuButton = document.querySelector("#mobile-menu-button"); 3 menuButton.onclick = function(e){ 4 e.preventDefault(); 5 document.querySelector('body').classList.toggle('mobile-menu-expanded'); 6 } 7} 8 9document.addEventListener('DOMContentLoaded', function(){ 10 initMenu(); 11 12const urlParams = new URLSearchParams(window.location.search); 13 const pageParam = urlParams.get('page'); 14 if (pageParam) { 15 document.querySelector('body').classList.add('page-' + pageParam); 16 } 17 18}, false); 19 20 21 22 23 24 25 26 27// Hide Header on on scroll down 28var didScroll; 29var lastScrollTop = 0; 30var delta = 5; 31var navbarHeight = document.querySelector('header').offsetHeight; 32 33document.addEventListener('scroll', () =>{ 34 didScroll = true; 35 if (document.scrollingElement.scrollTop > 1){ 36 document.querySelector('body').classList.add('continued'); 37 } 38 else { 39 document.querySelector('body').classList.remove('continued'); 40 } 41}); 42 43setInterval(() => { 44 if (didScroll) { 45 hasScrolled(); 46 didScroll = false; 47 } 48}, 100); 49 50function hasScrolled() { 51 var st = document.scrollingElement.scrollTop; 52 if(Math.abs(lastScrollTop - st) <= delta) 53 return; 54 if (st == 0 || st < 1){ 55 document.querySelector('header').classList.remove('nav-up'); 56 document.querySelector('header').classList.remove('nav-down'); 57 } 58 else{ 59 if (st > lastScrollTop && st > navbarHeight){ 60 // Scroll Down 61 document.querySelector('header').classList.remove('nav-down'); 62 document.querySelector('header').classList.add('nav-up'); 63 } else { 64 // Scroll Up 65 if(st + document.documentElement.clientHeight < document.documentElement.scrollHeight) { 66 document.querySelector('header').classList.add('nav-down'); 67 document.querySelector('header').classList.remove('nav-up'); 68 } 69 } 70 } 71 lastScrollTop = st; 72}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.