{"version":3,"file":"StopScroll.C9RG8PR6.mjs","names":["_Fragment"],"sources":["https:/framerusercontent.com/modules/XICXxbGLmNd6sGShY3pR/PLinN4rCoXK3R2UPI4Al/StopScroll.js"],"sourcesContent":["import{jsx as _jsx,Fragment as _Fragment}from\"react/jsx-runtime\";import{useEffect,useLayoutEffect}from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * @framerDisableUnlink\n *\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n */export default function StopScroll(props){const duration=props.duration*1e3;const scrollToTop=()=>window.scrollTo(0,0);useLayoutEffect(()=>{scrollToTop();const enableScroll=()=>document.body.style.overflow=\"auto\";const disableScroll=()=>document.body.style.overflow=\"hidden\";disableScroll();setTimeout(enableScroll,duration);},[]);useEffect(()=>{window.addEventListener(\"beforeunload\",scrollToTop);return()=>{window.removeEventListener(\"beforeunload\",scrollToTop);};},[]);return /*#__PURE__*/_jsx(_Fragment,{});}StopScroll.displayName=\"Stop Scroll\";addPropertyControls(StopScroll,{duration:{title:\"Duration\",type:ControlType.Number,defaultValue:2,description:\"Duration in seconds\",displayStepper:true,min:0}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"StopScroll\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerDisableUnlink\":\"*\",\"framerSupportedLayoutWidth\":\"auto\",\"framerSupportedLayoutHeight\":\"auto\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./StopScroll.map"],"mappings":"kMAKG,SAAwB,EAAW,EAAM,CAAC,IAAM,EAAS,EAAM,SAAS,IAAU,MAAgB,EAAO,SAAS,EAAE,EAAE,CAAkW,OAAjW,MAAoB,CAAC,GAAa,CAAC,IAAM,MAAiB,SAAS,KAAK,MAAM,SAAS,OAA+B,SAAS,KAAK,MAAM,SAAS,SAAyB,WAAW,EAAa,EAAS,EAAG,EAAE,CAAC,CAAC,OAAe,EAAO,iBAAiB,eAAe,EAAY,KAAW,CAAC,EAAO,oBAAoB,eAAe,EAAY,GAAK,EAAE,CAAC,CAAqB,EAAKA,EAAU,EAAE,CAAC,sBALhc,IAA6C,IAAoD,CAKiW,EAAW,YAAY,cAAc,EAAoB,EAAW,CAAC,SAAS,CAAC,MAAM,WAAW,KAAK,EAAY,OAAO,aAAa,EAAE,YAAY,sBAAsB,eAAe,GAAK,IAAI,EAAE,CAAC,CAAC"}