{"version":3,"file":"Smooth_Scroll.Dz2SC9mL.mjs","names":["p","useRef","Lenis","_Fragment"],"sources":["https:/framerusercontent.com/modules/HvNHO2ScTr7HQzwUcSD4/gaG4psyF6bVtRqiDYWmW/Scroll_progress_bar.js","https:/framerusercontent.com/modules/Yppqt3Cs3Y8TZqvASnXl/ALzPzo9ZL7qsyNt6jnNi/Smooth_Scroll.js"],"sourcesContent":["// ScrollProgressBar.tsx\n// @framerSupportedLayoutWidth auto\n// @framerSupportedLayoutHeight auto\nimport{jsx as _jsx}from\"react/jsx-runtime\";import*as React from\"react\";import{motion,useMotionValue}from\"framer-motion\";import{addPropertyControls,ControlType}from\"framer\";export default function ScrollProgressBar({thickness,color,orientation,hPosition,vPosition}){const progress=useMotionValue(0);React.useEffect(()=>{const update=()=>{const doc=document.documentElement;const body=document.body;const scrollHeight=Math.max(body.scrollHeight,doc.scrollHeight,body.offsetHeight,doc.offsetHeight,body.clientHeight,doc.clientHeight);const viewport=doc.clientHeight;const max=Math.max(scrollHeight-viewport,1);const y=window.pageYOffset||doc.scrollTop||body.scrollTop||0;progress.set(Math.min(Math.max(y/max,0),1));};update();window.addEventListener(\"scroll\",update,{passive:true});window.addEventListener(\"resize\",update);return()=>{window.removeEventListener(\"scroll\",update);window.removeEventListener(\"resize\",update);};},[progress]);const t=Math.max(thickness,1);// Container style (fixed, full-page)\nconst container={position:\"fixed\",zIndex:9999,pointerEvents:\"none\"};let barStyle;if(orientation===\"horizontal\"){Object.assign(container,{left:0,right:0,height:t,top:hPosition===\"top\"?0:undefined,bottom:hPosition===\"bottom\"?0:undefined});barStyle={height:\"100%\",width:\"100%\",background:color,scaleX:progress,transformOrigin:\"0% 50%\",willChange:\"transform\"};}else{Object.assign(container,{top:0,bottom:0,width:t,left:vPosition===\"left\"?0:undefined,right:vPosition===\"right\"?0:undefined});barStyle={width:\"100%\",height:\"100%\",background:color,scaleY:progress,transformOrigin:\"50% 0%\",willChange:\"transform\"};}return /*#__PURE__*/_jsx(\"div\",{style:container,children:/*#__PURE__*/_jsx(motion.div,{style:barStyle})});}addPropertyControls(ScrollProgressBar,{thickness:{type:ControlType.Number,title:\"Thickness\",defaultValue:3,min:1,max:40,unit:\"px\"},color:{type:ControlType.Color,title:\"Color\",defaultValue:\"#FF1212\"},orientation:{type:ControlType.Enum,title:\"Orientation\",options:[\"horizontal\",\"vertical\"],optionTitles:[\"Horizontal\",\"Vertical\"],defaultValue:\"horizontal\"},hPosition:{type:ControlType.Enum,title:\"Position\",options:[\"top\",\"bottom\"],optionTitles:[\"Top\",\"Bottom\"],defaultValue:\"top\",hidden:p=>p.orientation!==\"horizontal\"},vPosition:{type:ControlType.Enum,title:\"Position\",options:[\"left\",\"right\"],optionTitles:[\"Left\",\"Right\"],defaultValue:\"left\",hidden:p=>p.orientation!==\"vertical\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ScrollProgressBar\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Scroll_progress_bar.map","import{jsx as _jsx,Fragment as _Fragment}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import Lenis from\"@studio-freight/lenis\";import{useEffect,useRef}from\"react\";/**\n * @framerDisableUnlink\n */export default function SmoothScroll(props){const{intensity}=props;const lenis=useRef(null);useEffect(()=>{if(lenis.current)lenis.current.scrollTo(0,{immediate:true});},[lenis]);useEffect(()=>{const overlayElement=document.getElementById(\"overlay\");if(overlayElement){const handleMutation=(mutationsList,observer)=>{for(const mutation of mutationsList){if(mutation.type===\"childList\"){const hasChildren=overlayElement.children.length>0;if(hasChildren){// Check if the html tag has the style \"overflow: hidden;\"\nconst htmlElement=document.documentElement;const computedStyle=window.getComputedStyle(htmlElement);const isOverflowHidden=computedStyle.getPropertyValue(\"overflow\")===\"hidden\";if(isOverflowHidden){lenis.current.stop();}else{lenis.current.start();}}else{lenis.current.start();}}}};const observer=new MutationObserver(handleMutation);const config={childList:true};observer.observe(overlayElement,config);return()=>observer.disconnect();}},[]);useEffect(()=>{lenis.current=new Lenis({duration:intensity/10});const raf=time=>{lenis.current.raf(time);requestAnimationFrame(raf);};requestAnimationFrame(raf);return()=>{lenis.current.destroy();lenis.current=null;};},[]);return /*#__PURE__*/_jsx(_Fragment,{children:/*#__PURE__*/_jsx(\"style\",{children:`\n      html.lenis {\n        height: auto;\n      }\n\n      .lenis.lenis-smooth {\n        scroll-behavior: auto !important;\n      }\n\n      .lenis.lenis-smooth [data-lenis-prevent] {\n        overscroll-behavior: contain;\n      }\n\n      .lenis.lenis-stopped {\n        overflow: hidden;\n      }\n\n      .lenis.lenis-scrolling iframe {\n        pointer-events: none;\n      }\n    `})});}SmoothScroll.displayName=\"Smooth Scroll\";addPropertyControls(SmoothScroll,{intensity:{title:\"Intensity\",type:ControlType.Number,defaultValue:10}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"SmoothScroll\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerDisableUnlink\":\"\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Smooth_Scroll.map"],"mappings":"keAG4K,SAAwB,EAAkB,CAAC,YAAU,QAAM,cAAY,YAAU,aAAW,CAAC,IAAM,EAAS,EAAe,EAAE,CAAC,MAAoB,CAAC,IAAM,MAAW,CAAC,IAAM,EAAI,SAAS,gBAAsB,EAAK,SAAS,KAAW,EAAa,KAAK,IAAI,EAAK,aAAa,EAAI,aAAa,EAAK,aAAa,EAAI,aAAa,EAAK,aAAa,EAAI,aAAa,CAAO,EAAS,EAAI,aAAmB,EAAI,KAAK,IAAI,EAAa,EAAS,EAAE,CAAO,EAAE,EAAO,aAAa,EAAI,WAAW,EAAK,WAAW,EAAE,EAAS,IAAI,KAAK,IAAI,KAAK,IAAI,EAAE,EAAI,EAAE,CAAC,EAAE,CAAC,EAA6G,OAA1G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