// Scroll-triggered fade-in wrapper. Adds 'idh-revealed' once the element enters the // viewport (IntersectionObserver, one-shot) — animations.css does the actual transition. function Reveal({children,delay,style,as}){ const ref = React.useRef(null); React.useEffect(function(){ const el = ref.current; if(!el) return; const io = new IntersectionObserver(function(entries){ entries.forEach(function(entry){ if(entry.isIntersecting){ el.classList.add('idh-revealed'); io.unobserve(el); } }); },{threshold:0.15}); io.observe(el); return function(){io.disconnect();}; },[]); return React.createElement(as||'div',{ref:ref,className:'idh-reveal',style:{transitionDelay:(delay||0)+'ms',...style}},children); } window.Reveal = Reveal;