{"version":3,"sources":["global.js"],"names":["document","addEventListener","event","let","prevScrollTop","window","pageYOffset","documentElement","scrollTop","prevScrollDirection","st","querySelector","classList","add","remove","observer","IntersectionObserver","entries","boundingClientRect","y","navToggle","observe","getElementById","navClose","toggle"],"mappings":"AACAA,SAAAC,iBAAA,mBAAA,SAAAC,GACAC,IAAAC,EAAAC,OAAAC,aAAAN,SAAAO,gBAAAC,UACAC,EAAA,GAEAJ,OAAAJ,iBACA,SACA,WACA,IAAAS,EAAAL,OAAAC,aAAAN,SAAAO,gBAAAC,UACAE,EAAAN,GAAA,SAAAK,GAEAA,EAAA,OACAT,SAAAW,cAAA,QAAA,EAAAC,UAAAC,IAAA,UAAA,GACAH,EAAAN,GAAA,OAAAK,IAEAT,SAAAW,cAAA,QAAA,EAAAC,UAAAE,OAAA,UAAA,EACAL,EAAA,MAEAL,EAAAM,GAAA,EAAA,EAAAA,CACA,EACA,CAAA,CACA,EAIAP,IAAAY,EAAA,IAAAC,qBAAA,IAEAC,EAAA,GAAAC,mBAAAC,EAAA,EAEAnB,SAAAW,cAAA,QAAA,EAAAC,UAAAC,IAAA,QAAA,EAGAb,SAAAW,cAAA,QAAA,EAAAC,UAAAE,OAAA,QAAA,CAEA,CAAA,EAOAM,GANApB,SAAAW,cAAA,iBAAA,GACAI,EAAAM,QAAArB,SAAAW,cAAA,iBAAA,CAAA,EAKAX,SAAAsB,eAAA,YAAA,GACAC,EAAAvB,SAAAsB,eAAA,gBAAA,EACAF,GACAA,EAAAnB,iBAAA,QAAA,WACAD,SAAAsB,eAAA,UAAA,EACAV,UAAAY,OAAA,QAAA,EACAxB,SAAAW,cAAA,QAAA,EAAAC,UAAAC,IAAA,kBAAA,CACA,CAAA,EAEAU,GACAA,EAAAtB,iBAAA,QAAA,WACAD,SAAAsB,eAAA,UAAA,EACAV,UAAAY,OAAA,QAAA,EACAxB,SAAAW,cAAA,QAAA,EAAAC,UAAAE,OAAA,kBAAA,CACA,CAAA,CAGA,CAAA","file":"global.min.js","sourcesContent":["//nav scrollUp functionality\ndocument.addEventListener(\"DOMContentLoaded\", function (event) {\n let prevScrollTop = window.pageYOffset || document.documentElement.scrollTop;\n let prevScrollDirection = \"\";\n\n window.addEventListener(\n \"scroll\",\n function () {\n const st = window.pageYOffset || document.documentElement.scrollTop;\n if (st > prevScrollTop && prevScrollDirection !== \"down\") {\n // downscroll code here\n prevScrollDirection = \"down\";\n document.querySelector(\"header\").classList.add(\"scrollUp\");\n } else if (st < prevScrollTop && prevScrollDirection !== \"up\") {\n // upscroll code\n document.querySelector(\"header\").classList.remove(\"scrollUp\");\n prevScrollDirection = \"up\";\n }\n prevScrollTop = st <= 0 ? 0 : st; // for Mobile or negative scrolling\n },\n false\n );\n //nav scrollUp functionality\n\n //nav active functionality\n let observer = new IntersectionObserver((entries) => {\n // console.log(entries);\n if (entries[0].boundingClientRect.y < 0) {\n // console.log(\"Past 200px!\");\n document.querySelector(\"header\").classList.add(\"active\");\n } else {\n // console.log(\"Not past 200px\");\n document.querySelector(\"header\").classList.remove(\"active\");\n }\n });\n if (document.querySelector(\"#pixel-to-watch\")) {\n observer.observe(document.querySelector(\"#pixel-to-watch\"));\n }\n //nav active functionality\n\n //nav toggle functionality\n var navToggle = document.getElementById(\"nav-toggle\");\n var navClose = document.getElementById(\"main-nav-close\");\n if (navToggle) {\n navToggle.addEventListener(\"click\", function () {\n var nav = document.getElementById(\"main-nav\");\n nav.classList.toggle(\"active\");\n document.querySelector(\"header\").classList.add(\"disable-scrollUp\");\n });\n }\n if (navClose) {\n navClose.addEventListener(\"click\", function () {\n var nav = document.getElementById(\"main-nav\");\n nav.classList.toggle(\"active\");\n document.querySelector(\"header\").classList.remove(\"disable-scrollUp\");\n });\n }\n //nav toggle functionality\n});\n"]}