{"version":3,"file":"Parallax_img_1.KX_c1fPq.mjs","names":["useRef","useState"],"sources":["https:/framerusercontent.com/modules/aq1T5oIoWZIMZsbuHbv9/mYJ1pmZhQbhD6lWNpJ3L/Parallax_img_1.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{useEffect,useRef,useState}from\"react\";export function ParallaxImage({image,intensity,borderRadius,uniqueKey,altText}){const containerRef=useRef(null);const imageRef=useRef(null);let animationFrame=useRef(null);// Generate a unique key dynamically (prevents Framer key conflicts)\nconst[componentKey]=useState(uniqueKey||`parallax-${Math.random()}`);useEffect(()=>{const handleScroll=()=>{if(!containerRef.current||!imageRef.current)return;const rect=containerRef.current.getBoundingClientRect();const viewportHeight=window.innerHeight;const progress=rect.top/viewportHeight;// Apply a slower parallax movement\nconst moveY=progress*intensity*-5;// Smooth animation using requestAnimationFrame\ncancelAnimationFrame(animationFrame.current);animationFrame.current=requestAnimationFrame(()=>{imageRef.current.style.transform=`translateY(${moveY}px)`;});};window.addEventListener(\"scroll\",handleScroll);return()=>{window.removeEventListener(\"scroll\",handleScroll);cancelAnimationFrame(animationFrame.current);};},[intensity]);// Get image source (CMS image or direct URL)\nconst isCMSImage=typeof image===\"object\"&&image!==null&&\"url\"in image;const imageSrc=isCMSImage?image.url:image;return /*#__PURE__*/_jsx(\"div\",{ref:containerRef,style:{...containerStyle,borderRadius},children:/*#__PURE__*/_jsx(\"img\",{ref:imageRef,src:imageSrc,alt:altText,style:{...imageStyle,borderRadius}})},componentKey);}// Styles\nconst containerStyle={overflow:\"hidden\",position:\"relative\",width:\"100%\",height:\"100%\"};const imageStyle={position:\"absolute\",top:\"0%\",left:\"0\",height:\"105%\",width:\"100%\",objectFit:\"cover\",willChange:\"transform\"};// Framer Property Controls\naddPropertyControls(ParallaxImage,{image:{type:ControlType.Image,title:\"Select Image\"},altText:{type:ControlType.String,title:\"Alt Text\",defaultValue:\"Parallax Image\"},intensity:{type:ControlType.Number,title:\"Parallax Intensity\",min:5,max:100,step:1,defaultValue:20},borderRadius:{type:ControlType.Number,title:\"Border Radius\",min:0,max:100,step:1,defaultValue:0,displayStepper:true}});\nexport const __FramerMetadata__ = {\"exports\":{\"ParallaxImage\":{\"type\":\"reactComponent\",\"name\":\"ParallaxImage\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Parallax_img_1.map"],"mappings":"sMAA4I,SAAgB,EAAc,CAAC,QAAM,YAAU,eAAa,YAAU,WAAS,CAAC,IAAM,EAAaA,EAAO,KAAK,CAAO,EAASA,EAAO,KAAK,CAAK,EAAeA,EAAO,KAAK,CAClT,CAAC,GAAcC,EAAS,GAAW,YAAY,KAAK,QAAQ,GAAG,CAAC,MAAc,CAAC,IAAM,MAAiB,CAAC,GAAG,CAAC,EAAa,SAAS,CAAC,EAAS,QAAQ,OAAO,IAAM,EAAK,EAAa,QAAQ,uBAAuB,CAAO,EAAe,EAAO,YAC7O,EADwQ,EAAK,IAAI,EAClQ,EAAU,GAC/B,qBAAqB,EAAe,QAAQ,CAAC,EAAe,QAAQ,0BAA0B,CAAC,EAAS,QAAQ,MAAM,UAAU,cAAc,EAAM,MAAO,EAAkD,OAA/C,EAAO,iBAAiB,SAAS,EAAa,KAAW,CAAC,EAAO,oBAAoB,SAAS,EAAa,CAAC,qBAAqB,EAAe,QAAQ,GAAK,CAAC,EAAU,CAAC,CACjQ,IAAM,EAA3D,OAAO,GAAQ,UAAU,GAAc,QAAQ,EAAgC,EAAM,IAAI,EAAM,OAAoB,EAAK,MAAM,CAAC,IAAI,EAAa,MAAM,CAAC,GAAG,EAAe,eAAa,CAAC,SAAsB,EAAK,MAAM,CAAC,IAAI,EAAS,IAAI,EAAS,IAAI,EAAQ,MAAM,CAAC,GAAG,EAAW,eAAa,CAAC,CAAC,CAAC,CAAC,EAAa,0BAJxR,IAAoD,IAA6C,CAKtI,EAAe,CAAC,S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