const scrollEnd="80px";const postScrollColor="#030303";const postScrollColorBorder="#76011b";const preScrollColorBorder="rgba(118, 1, 27, 0)";const postScrollShadow="0px 4px 10px 0px rgba(0, 0, 0, 0.5)";gsap.registerPlugin(ScrollTrigger);let mm=gsap.matchMedia(),animationDesktop;const desktopNav=document.querySelector("#navbar-desktop"),mobileNav=document.querySelector("#navbar-mobile");gsap.set(desktopNav,{borderColor:preScrollColorBorder});const startDesktopAnimation=function(){animationDesktop=gsap.to([desktopNav.querySelector(".brand>img"),desktopNav],{scrollTrigger:{trigger:"body",start:"top",end:scrollEnd,scrub:!0,},width:(r)=>(r===0?"80%":"100%"),backgroundColor:(r)=>(r===1?postScrollColor:null),borderColor:(r)=>(r===1?postScrollColorBorder:null),boxShadow:(r)=>(r===1?postScrollShadow:null),},);};(startDesktopAnimation(),mm.add("(max-width:66rem)",()=>{animationDesktop?.revert();gsap.set(mobileNav,{borderColor:preScrollColorBorder});let r=gsap.to([mobileNav.querySelector(".brand>img"),mobileNav],{scrollTrigger:{trigger:"body",start:"top",end:scrollEnd,scrub:!0,},width:(r)=>(r===0?"80%":"100%"),backgroundColor:(r)=>(r===1?postScrollColor:null),borderColor:(r)=>(r===1?postScrollColorBorder:null),boxShadow:(r)=>(r===1?postScrollShadow:null),});return()=>{(r.revert(),startDesktopAnimation());};}));