$(window).on("load",function(){initializeIntersectionObserver();});function initializeIntersectionObserver(){ const elements=document.querySelectorAll('*[data-effect]'); const observerOptions={root:null,rootMargin:'0px',threshold:[] }; for(let i=0;i<=1.0;i+=0.01){observerOptions.threshold.push(i); } const callback=(entries,observer)=>{entries.forEach(entry=>{const target=entry.target;const dataPerc=target.getAttribute('data-perc')||'0';const requiredPerc=parseFloat(dataPerc)/ 100;if(entry.isIntersecting&&entry.intersectionRatio>=requiredPerc){ target.classList.add('active'); }else{ if(target.getAttribute('data-repeat')!=undefined)target.classList.remove('active'); } }); }; const observer=new IntersectionObserver(callback,observerOptions); elements.forEach(element=>{observer.observe(element); });}$(document).ready(function(){$("[data-effect='letter_up']").each(function(){var text=$(this).text().trim();var letters=text.split('');var index=0;var start_after=($(this).attr("data-delay")!=undefined)?parseFloat($(this).attr("data-delay")):0; var spans=letters.map(function(letter,index){return "<span style='animation-delay:"+parseFloat((start_after+(index*0.05)).toFixed(2))+"s'>"+((letter===' ')?"&nbsp;":letter)+"</span>"; });var html=spans.join('');$(this).html(html); });});