1(function () { 2 3 // Tolerance (px) is the size a viewport can chance 4 // before updating css variables this prevents jerky 5 // resizing when browser chrome disappears on mobile 6 var tolerance = 100; 7 8 9 var vh = window.innerHeight * 0.01; 10 document.documentElement.style.setProperty('--vh', `${vh}px`); 11 var lastHeight = window.innerHeight; 12 13 var vw = window.innerWidth * 0.01; 14 document.documentElement.style.setProperty('--vw', `${vw}px`); 15 var lastWidth = window.innerWidth; 16 17 18 window.addEventListener('resize', () => { 19 if (Math.abs(lastHeight - window.innerHeight) > tolerance) { 20 vh = window.innerHeight * 0.01; 21 document.documentElement.style.setProperty('--vh', `${vh}px`); 22 lastHeight = window.innerHeight; 23 } 24 25 if (lastWidth != window.innerWidth) { 26 vw = window.innerWidth * 0.01; 27 document.documentElement.style.setProperty('--vw', `${vw}px`); 28 lastWidth = window.innerWidth; 29 } 30 31 }); 32})();
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.