1document.addEventListener('DOMContentLoaded', function () { 2 3 document.querySelectorAll('.egnyte_fusion__video').forEach(function (el) { 4 if (el.parentElement) { 5 el.parentElement.classList.add('viemo-video'); 6 } 7 }); 8 9 const BUFFER = 24; // px before touching device wall 10 const BREAKPOINT = 1230; // activate only above this 11 let lastVW = window.innerWidth; 12 let ticking = false; 13 14 function resizeImagesAtCollision() { 15 if (ticking) return; 16 ticking = true; 17 18 requestAnimationFrame(() => { 19 ticking = false; 20 21 const vw = window.innerWidth; 22 const deltaVW = vw - lastVW; 23 lastVW = vw; 24 25 // â Disable logic on small screens 26 if (vw <= BREAKPOINT) { 27 return; 28 } 29 30 document.querySelectorAll('.size-auto img').forEach(img => { 31 if (!img.complete) return; 32 33 // Initialize once 34 if (!img.dataset.originalWidth) { 35 const attrWidth = img.getAttribute('width'); 36 img.dataset.originalWidth = attrWidth 37 ? parseFloat(attrWidth) 38 : img.getBoundingClientRect().width; 39 40 img.dataset.currentWidth = img.dataset.originalWidth; 41 } 42 43 const originalWidth = parseFloat(img.dataset.originalWidth); 44 let currentWidth = parseFloat(img.dataset.currentWidth); 45 46 const rect = img.getBoundingClientRect(); 47 const touchingRight = rect.right >= (vw - BUFFER); 48 const touchingLeft = rect.left <= BUFFER; 49 50 /* ------------------------------- 51 * SHRINK â only when touching wall 52 * ------------------------------- */ 53 if (touchingRight) { 54 currentWidth -= rect.right - (vw - BUFFER); 55 } else if (touchingLeft) { 56 currentWidth -= BUFFER - rect.left; 57 } 58 59 /* ------------------------------- 60 * GROW â only after collision ends 61 * ------------------------------- */ 62 else if (deltaVW > 0 && currentWidth < originalWidth) { 63 currentWidth += deltaVW; 64 } 65 66 // Clamp 67 currentWidth = Math.max(0, Math.min(currentWidth, originalWidth)); 68 69 // Apply 70 img.dataset.currentWidth = currentWidth; 71 img.style.width = `${currentWidth}px`; 72 img.style.height = 'auto'; 73 }); 74 }); 75 } 76 77 // Initial run 78 resizeImagesAtCollision(); 79 80 // React to viewport changes 81 window.addEventListener('resize', resizeImagesAtCollision); 82 window.addEventListener('orientationchange', resizeImagesAtCollision); 83 84});
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.