0
(function(){ function initPortableCardReveal(){ var cards = Array.prototype.slice.call(document.querySelectorAll( '.sqs-block-image figure.image-block-outer-wrapper.image-block-v2' )).filter(function(el){ return !!el.querySelector('.sqs-dynamic-text-container'); }); if (!cards.length) return; function reveal(el){ el.classList.add('portable-revealed','animation-loaded','sqs-text-ready'); el.querySelectorAll('.image-card-wrapper,.image-card,.image-title-wrapper,.image-subtitle-wrapper,.image-button-wrapper,.sqs-dynamic-text,.sqs-dynamic-text-container').forEach(function(node){ node.style.setProperty('opacity','1','important'); node.style.setProperty('visibility','visible','important'); }); } cards.forEach(function(el){ el.classList.add('portable-scroll-card'); /* Undo the previous static-mirror workaround so the reveal can run again. */ el.classList.remove('animation-loaded','sqs-text-ready'); }); if (!('IntersectionObserver' in window)) { cards.forEach(reveal); return; } var observer = new IntersectionObserver(function(entries){ entries.forEach(function(entry){ if (entry.isIntersecting || entry.intersectionRatio > 0) { reveal(entry.target); observer.unobserve(entry.target); } }); }, {root:null, rootMargin:'0px 0px -5% 0px', threshold:0.04}); cards.forEach(function(el){ observer.observe(el); }); /* Fail-safe: never leave text permanently clipped if a browser has a broken observer. */ setTimeout(function(){ cards.forEach(function(el){ var r = el.getBoundingClientRect(); if (!el.classList.contains('portable-revealed') && r.top < window.innerHeight * 1.15 && r.bottom > -50) reveal(el); }); }, 1400); } if (document.readyState === 'loading') { document.addEventListener('DOMContentLoaded', initPortableCardReveal, {once:true}); } else { initPortableCardReveal(); } })();