" (or "Frontend footer"), Location = same conditions as the CSS snippet. Pairs with blog-restyle.css (.journal-photo / .journal-photo.in). */ (function(){ function run(){ var els = document.querySelectorAll('.journal-photo'); if (!els.length) return; function revealAll(){ els.forEach(function(el){ el.classList.add('in'); }); } if ('IntersectionObserver' in window) { var io = new IntersectionObserver(function(entries){ entries.forEach(function(e){ if (e.isIntersecting) { e.target.classList.add('in'); io.unobserve(e.target); } }); }, {threshold:.15}); els.forEach(function(el){ io.observe(el); }); } else { revealAll(); } // safety net: force-reveal regardless of observer state, so a stuck // trigger never leaves photos permanently clipped/invisible setTimeout(revealAll, 1500); } if (document.readyState === 'loading') { document.addEventListener('DOMContentLoaded', run); } else { run(); } })();