document.addEventListener('DOMContentLoaded', function() { var posts = document.querySelectorAll('.bdp_blog_post'); var observer = new IntersectionObserver(function(entries) { entries.forEach(function(entry) { if (entry.isIntersecting) { entry.target.classList.add('visible'); } }); }, { threshold: 0.5 }); posts.forEach(function(post) { observer.observe(post); }); });