1(function() { 2 const equalizerDivs = Array.from(document.querySelectorAll('[data-equalizer]')) 3 4 const widths = { 5 small: 0, 6 medium: 640, 7 large: 1024, 8 xlarge: 1200 9 } 10 11 function validateScreenSize(equ) { 12 const watchOn = equ.dataset.equalizeOn 13 if (watchOn != undefined) { 14 const size = widths[watchOn] 15 const sizeBool = window.innerWidth > size; 16 // console.log(sizeBool) 17 return innerWidth > size; 18 } else { 19 return innerWidth > widths.medium; 20 } 21 } 22 23 function equalize(watching) { 24 const largestDiv = watching?.reduce((prev, curr) => curr.getBoundingClientRect().height > prev.getBoundingClientRect().height ? curr : prev) 25 for (watch of watching) { 26 if (watch !== largestDiv) { 27 watch.style.height = `${largestDiv.getBoundingClientRect().height}px` 28 } 29 } 30 } 31 32 function dataEqualize() { 33 for (equalizer of equalizerDivs) { 34 if (validateScreenSize(equalizer)) { 35 const watching = Array.from(equalizer.querySelectorAll('[data-equalizer-watch]')) 36 equalize(watching) 37 } 38 } 39 } 40 if (innerWidth > widths.medium) dataEqualize() 41 42 function dataEqualize2() { 43 // console.log(window.innerWidth); 44 if (window.innerWidth > widths.medium) { 45 for (equalizer of equalizerDivs) { 46 if (validateScreenSize(equalizer)) { 47 const watching = Array.from(equalizer.querySelectorAll('[data-equalizer-watch]')); 48 for (watch of watching) { 49 watch.style.height = 'auto'; 50 } 51 equalize(watching) 52 } else { 53 const watching = Array.from(equalizer.querySelectorAll('[data-equalizer-watch]')); 54 for (watch of watching) { 55 watch.style.height = 'auto'; 56 } 57 } 58 } 59 } else { 60 for (equalizer of equalizerDivs) { 61 const watching = Array.from(equalizer.querySelectorAll('[data-equalizer-watch]')); 62 for (watch of watching) { 63 watch.style.height = 'auto'; 64 } 65 } 66 } 67 } 68 69 window.addEventListener('resize', dataEqualize2) 70})()
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.