{"version":3,"file":"Smooth_scroll.MRJtUHca.mjs","names":[],"sources":["https:/framerusercontent.com/modules/EuUtoOGsTe58Yz7k4N5V/aQPACPSawwOGNKOCfBPs/Smooth_scroll.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect}from\"react\";import{addPropertyControls,ControlType}from\"framer\";import Lenis from\"@studio-freight/lenis\";/**\n * @framerDisableUnlink\n */export function SmoothScroll({scrollIntensity,smoothWheel,smoothTouch}){useEffect(()=>{// Inicializa o Lenis Scroll no body\nconst lenis=new Lenis({duration:scrollIntensity,easing:t=>Math.min(1,1.001-Math.pow(2,-10*t)),smoothWheel:smoothWheel,smoothTouch:smoothTouch});const onScroll=e=>{// Custom scroll handling if needed\nconsole.log(e);};lenis.on(\"scroll\",onScroll);function raf(time){lenis.raf(time);requestAnimationFrame(raf);}requestAnimationFrame(raf);// Altera o estilo do body para permitir o scroll suave\ndocument.body.style.overflow=\"auto\";document.body.style.scrollBehavior=\"smooth\";return()=>{lenis.destroy();document.body.style.overflow=\"auto\"// Restaura o estilo do body\n;document.body.style.scrollBehavior=\"auto\";};},[scrollIntensity,smoothWheel,smoothTouch]);return /*#__PURE__*/_jsx(\"div\",{style:{width:1,height:1,overflow:\"hidden\",position:\"absolute\",top:0,left:0}});}addPropertyControls(SmoothScroll,{scrollIntensity:{type:ControlType.Number,title:\"Scroll Intensity\",defaultValue:1.2,min:.1,max:10,step:.1,description:\"Adjust the intensity of the smooth scroll.\"},smoothWheel:{type:ControlType.Boolean,title:\"Smooth Wheel\",defaultValue:true,description:\"Enable or disable smooth scrolling for the mouse wheel.\"},smoothTouch:{type:ControlType.Boolean,title:\"Smooth Touch\",defaultValue:false,description:\"Enable or disable smooth scrolling for touch events.\"},codeBy:{type:ControlType.String,title:\" \",defaultValue:\"Code by @omatusaelhorch\",readOnly:true,displaySegmentedControl:false,description:\"This component was created by @omatusaelhorch.\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"SmoothScroll\":{\"type\":\"reactComponent\",\"name\":\"SmoothScroll\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerDisableUnlink\":\"\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Smooth_scroll.map"],"mappings":"oUAEG,SAAgB,EAAa,CAAC,kBAAgB,cAAY,cAAY,CAAC,CAIgB,OAJf,MAAc,CACzF,IAAM,EAAM,IAAI,EAAM,CAAC,SAAS,EAAgB,OAAO,GAAG,KAAK,IAAI,EAAE,MAAe,IAAE,IAAI,IAAgB,cAAwB,cAAY,EAAQ,EAAS,GAAG,CAClK,QAAQ,IAAI,EAAI,EAAC,EAAM,GAAG,SAAS,GAAU,SAAS,EAAI,EAAK,CAAC,EAAM,IAAI,GAAM,sBAAsB,EAAM,CAC5B,6BADkD,GAClI,SAAS,KAAK,MAAM,SAAS,OAAO,SAAS,KAAK,MAAM,eAAe,aAAmB,CAAC,EAAM,UAAU,SAAS,KAAK,MAAM,SAAS,OACvI,SAAS,KAAK,MAAM,eAAe,MAAQ,CAAE,EAAC,CAAC,EAAgB,EAAY,EAAY,EAAsB,EAAK,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,EAAE,SAAS,SAAS,SAAS,WAAW,IAAI,EAAE,KAAK,EAAE,CAAC,CAAG,iCAAoB,EAAa,CAAC,gBAAgB,CAAC,KAAK,EAAY,OAAO,MAAM,mBAAmB,aAAa,IAAI,IAAI,GAAG,IAAI,GAAG,KAAK,GAAG,YAAY,6CAA6C,CAAC,YAAY,CAAC,KAAK,EAAY,QAAQ,MAAM,eAAe,aAAa,GAAK,YAAY,0DAA0D,CAAC,YAAY,CAAC,KAAK,EAAY,QAAQ,MAAM,eAAe,aAAa,GAAM,YAAY,uDAAuD,CAAC,OAAO,CAAC,KAAK,EAAY,OAAO,MAAM,IAAI,aAAa,0BAA0B,SAAS,GAAK,wBAAwB,GAAM,YAAY,iDAAiD,CAAC"}