{"version":3,"file":"ScrollEffect.CruJ3-nP.mjs","names":["useState","__esmMin","init_ssg_sandbox_shims","init_npm_react_18_3_1","ce","init_jsx_runtime","c","_e","window","useVelocity","useScroll","init_framer_motion_DhsWWWsN","withSlideOutOnScrollUp","scrollVelocity","scrollY","background","borderBottomWidth","borderColor","opacity","y","isScrollingBack","setIsScrollingBack","isAtTop","setIsAtTop","isInView","setIsInView","latest","Component","props","init_ScrollEffect"],"sources":["https:/framerusercontent.com/modules/DngNCqws7h6NVtctk3cU/NsCaTg9xkFW3TvV8o9bD/ScrollEffect.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useState,useEffect}from\"react\";import{useScroll,useVelocity}from\"framer-motion\";export function withSlideOutOnScrollUp(Component){const slideDistance=25 // if we are sliding out a nav bar at the top of the screen, this will be it's height\n;const threshold=250 // only slide it back when scrolling back at velocity above this positive (or zero) value\n;return props=>{const{scrollY}=useScroll();const scrollVelocity=useVelocity(scrollY);var background=\"transparent\";var borderBottomWidth=0;var borderColor=\"rgba(0, 0, 0, 0)\";var opacity=1;var y=25;const[isScrollingBack,setIsScrollingBack]=useState(false);const[isAtTop,setIsAtTop]=useState(true) // true if the page is not scrolled or fully scrolled back\n;const[isInView,setIsInView]=useState(true);useEffect(()=>scrollVelocity.onChange(latest=>{if(latest>0){setIsScrollingBack(false);return;}if(latest<-threshold){setIsScrollingBack(true);return;}}),[]);useEffect(()=>scrollY.onChange(latest=>setIsAtTop(latest<=0)),[]);useEffect(()=>setIsInView(isScrollingBack||isAtTop),[isScrollingBack,isAtTop]);if(window){if(isScrollingBack){background=\"rgba(255, 255, 255, 1)\",borderColor=\"rgba(0, 0, 0, 0.1)\",borderBottomWidth=1,opacity=1,y=0;}else{opacity=0,y=-90;}if(isAtTop){background=\"rgba(255, 255, 255, 0)\",borderColor=\"rgba(0, 0, 0, 0)\",borderBottomWidth=0,opacity=1,y=0;}// only if menu is not open\nif(!document.querySelector(\"[data-framer-name='Phone Open']\")){return /*#__PURE__*/ _jsx(Component,{...props,animate:{backgroundColor:background,borderStyle:\"solid\",borderColor:borderColor,borderTopWidth:0,borderRightWidth:0,borderBottomWidth:borderBottomWidth,borderLeftWidth:0,opacity:opacity,y:y},transition:{duration:.35,delay:0,ease:\"easeInOut\"}});}else{return /*#__PURE__*/ _jsx(Component,{...props,animate:{backgroundColor:\"rgba(255,255,255,1)\",opacity:1}});}}};}\nexport const __FramerMetadata__ = {\"exports\":{\"withSlideOutOnScrollUp\":{\"type\":\"reactHoc\",\"name\":\"withSlideOutOnScrollUp\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ScrollEffect.map"],"mappings":"A,+LAAkI,SAAgBY,EAAuB,EAAU,CAElL,MAAO,IAAO,CAAC,GAAK,CAAC,WAASF,EAAU,EAAQG,EAAeJ,EAAYK,CAAO,EAAE,IAAIC,EAAW,cAAkBC,EAAkB,EAAMC,EAAY,mBAAuBC,EAAQ,EAAMC,EAAE,GAAG,GAAK,CAACC,EAAgBC,GAAoBrB,EAAS,EAAK,EAAO,CAACsB,EAAQC,GAAYvB,EAAS,EAAI,EAC/R,CAACwB,EAASC,GAAazB,EAAS,EAAI,EAA+S,GAA7SI,MAAcS,EAAe,SAAS,GAAQ,CAAIa,EAAO,EAAGL,EAAmB,EAAK,EAAaK,EAAO,MAAYL,EAAmB,EAAI,CAAU,CAAC,EAAE,CAAC,CAAC,EAAEjB,MAAcU,EAAQ,SAAS,GAAQS,EAAWG,GAAQ,CAAC,CAAC,EAAE,CAAC,CAAC,EAAEtB,MAAcqB,EAAYL,GAAiBE,CAAO,EAAE,CAACF,EAAgBE,CAAO,CAAC,EAAKd,EAC7R,OADwSY,GAAiB,EAAW,yBAAyB,EAAY,qBAAqB,EAAkB,EAAE,EAAQ,EAAE,EAAE,IAAQ,EAAQ,EAAE,EAAE,KAAQE,IAAS,EAAW,yBAAyB,EAAY,mBAAmB,EAAkB,EAAE,EA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