1 2(function () { 3 var urlParams = new URLSearchParams(location.search); 4 var navType = urlParams.get('nav'); 5 var isIns = navType === 'insurance'; 6 var isPtau = navType === 'ptau'; 7 var isSpecial = isIns || isPtau; // either insurance or ptau 8 9 function togglePair(showSel, hideSel, showCls, hideCls){ 10 var showEls = document.querySelectorAll(showSel); 11 var hideEls = document.querySelectorAll(hideSel); 12 if (isSpecial) { 13 hideEls.forEach(el => { el.classList.add(hideCls); el.classList.remove(showCls); }); 14 showEls.forEach(el => { el.classList.add(showCls); el.classList.remove(hideCls); }); 15 } else { 16 showEls.forEach(el => { el.classList.add(hideCls); el.classList.remove(showCls); }); 17 hideEls.forEach(el => { el.classList.add(showCls); el.classList.remove(hideCls); }); 18 } 19 } 20 21 function toggleTriple(insSel, ptauSel, defaultSel, showCls, hideCls){ 22 var insEls = document.querySelectorAll(insSel); 23 var ptauEls = document.querySelectorAll(ptauSel); 24 var defaultEls = document.querySelectorAll(defaultSel); 25 26 // Hide all first 27 [insEls, ptauEls, defaultEls].forEach(els => { 28 els.forEach(el => { el.classList.add(hideCls); el.classList.remove(showCls); }); 29 }); 30 31 // Show the appropriate one 32 if (isIns) { 33 insEls.forEach(el => { el.classList.add(showCls); el.classList.remove(hideCls); }); 34 } else if (isPtau) { 35 ptauEls.forEach(el => { el.classList.add(showCls); el.classList.remove(hideCls); }); 36 } else { 37 defaultEls.forEach(el => { el.classList.add(showCls); el.classList.remove(hideCls); }); 38 } 39 } 40 41 function fadeAbsTo(value){ 42 document.querySelectorAll('.navbar_container').forEach(el => { 43 if (!el.style.transition) el.style.transition = 'opacity 0ms'; 44 el.style.opacity = value; 45 }); 46 } 47 48 function run(){ 49 fadeAbsTo('0'); 50 51 // Handle pages that have triple navbars (default, insurance, ptau) 52 toggleTriple('.navbar_new-landing', '.navbar_new-ptau', '.navbar_new', 'nav-force-show', 'nav-force-hide'); 53 54 // Handle footers (assuming you want the same logic) 55 togglePair('.footer-landing', '.footer', 'foot-force-show', 'foot-force-hide'); 56 57 requestAnimationFrame(() => fadeAbsTo('1')); 58 } 59 60 (document.readyState === 'loading') 61 ? document.addEventListener('DOMContentLoaded', run) 62 : run(); 63})();
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.