{"version":3,"file":"Nav_scroll.DYbVLRvd.mjs","names":["useRef","__legacyOverrideHOC_DataObserverContext","_jsx"],"sources":["https:/framerusercontent.com/modules/5oKw5n27OfUVu3GkoH0d/RWO82FFpbnGt4DNXwmn8/Nav_scroll.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useRef}from\"react\";import{useMotionValue,animate}from\"framer\";export function HideOnScroll(){const lastScrollY=useRef(0);const y=useMotionValue(0);const OFFSET=200;useEffect(()=>{const scrollContainer=document.querySelector(\"[data-framer-scroll-container]\")||window;const handleScroll=()=>{const currentScrollY=scrollContainer===window?window.scrollY:scrollContainer.scrollTop;if(currentScrollY>OFFSET){if(currentScrollY>lastScrollY.current+5){// 👇 Scroll down → hide smoothly\nanimate(y,-180,{duration:.25,ease:\"easeOut\"});}else if(currentScrollY<lastScrollY.current-5){// 👇 Scroll up → show smoothly\nanimate(y,0,{duration:.25,ease:\"easeOut\"});}}else{animate(y,0,{duration:.2});}lastScrollY.current=currentScrollY;};scrollContainer.addEventListener(\"scroll\",handleScroll);return()=>scrollContainer.removeEventListener(\"scroll\",handleScroll);},[]);return{style:{y}};}import{useContext as __legacyOverrideHOC_useContext}from\"react\";import{DataObserverContext as __legacyOverrideHOC_DataObserverContext}from\"framer\";export function withHideOnScroll(C){return props=>{__legacyOverrideHOC_useContext(__legacyOverrideHOC_DataObserverContext);return _jsx(C,{...props,...HideOnScroll(props)});};}withHideOnScroll.displayName=\"HideOnScroll\";\nexport const __FramerMetadata__ = {\"exports\":{\"withHideOnScroll\":{\"type\":\"reactHoc\",\"name\":\"withHideOnScroll\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"HideOnScroll\":{\"type\":\"override\",\"name\":\"HideOnScroll\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Nav_scroll.map"],"mappings":"4OAA0H,SAAgB,GAAc,CAAC,IAAM,EAAYA,EAAO,EAAE,CAAO,EAAE,EAAe,EAAE,CAEwC,OAFtB,MAAc,CAAC,IAAM,EAAgB,SAAS,cAAc,iCAAiC,EAAE,EAAa,MAAiB,CAAC,IAAM,EAAe,IAAkB,EAAO,EAAO,QAAQ,EAAgB,UAAa,EAAe,IAAW,EAAe,EAAY,QAAQ,EACrf,EAAQ,EAAE,KAAK,CAAC,SAAS,IAAI,KAAK,UAAU,CAAC,CAAU,EAAe,EAAY,QAAQ,GAC1F,EAAQ,EAAE,EAAE,CAAC,SAAS,IAAI,KAAK,UAAU,CAAC,CAAQ,EAAQ,EAAE,EAAE,CAAC,SAAS,GAAG,CAAC,CAAE,EAAY,QAAQ,GAAyE,OAAxD,EAAgB,iBAAiB,SAAS,EAAa,KAAW,EAAgB,oBAAoB,SAAS,EAAa,EAAG,EAAE,CAAC,CAAO,CAAC,MAAM,CAAC,IAAE,CAAC,CAAqJ,SAAgB,EAAiB,EAAE,CAAC,MAAO,KAAQ,EAA+BC,EAAwC,CAAQC,EAAK,EAAE,CAAC,GAAG,EAAM,GAAG,EAAa,EAAM,CAAC,CAAC,uBAF5hB,IAAoC,IAA2C,CAEid,EAAiB,YAAY"}