function handleScrollFade(t,e){let o=document.querySelector(t);o.style.opacity="0",window.addEventListener("scroll",function(){scrollTop=window.scrollY||document.documentElement.scrollTop,scrollTop>e?(o.style.opacity="1",o.style.visibility="visible",o.style.transition=".4s"):(o.style.opacity="0",o.style.visibility="hidden",o.style.transition=".4s")})}window.addEventListener("load",function(){function t(t){t.forEach(function(t){const e=t.target;t.isIntersecting&&!e.classList.contains("is-active")&&e.classList.add("is-active")})}const e=document.querySelectorAll(".target"),o=Array.prototype.slice.call(e),n={root:null,rootMargin:"0px 0px",threshold:.4};window.innerWidth<=480&&(n.threshold=.4);const i=new IntersectionObserver(t,n);o.forEach(function(t){i.observe(t)})});const btnTop=document.querySelector(".pageTop");btnTop.addEventListener("click",()=>{window.scrollTo({top:0,behavior:"smooth"})}),document.addEventListener("DOMContentLoaded",function(){handleScrollFade(".pageTop",400)});const links=document.querySelectorAll('a[href^="#"]');links.forEach(t=>{t.addEventListener("click",e=>{e.preventDefault();const o=t.getAttribute("href"),n=document.querySelector(o),i=n.getBoundingClientRect().top,l=window.scrollY,c=84,s=i+l-c;window.scrollTo({top:s,behavior:"smooth"})})});