{"version":3,"file":"ParallaxFixedImage.BWYfYzn2.mjs","names":["useMemo"],"sources":["https:/framerusercontent.com/modules/WFH1DUepaeTUoRqI6xo1/lckJR7HZ5YmWwxc4hee3/ParallaxFixedImage.js"],"sourcesContent":["// ParallaxFixedImage: A parallax image component where the image stays fixed in place while the user scrolls. Supports image upload, opacity, overlay color, border radius, and responsive sizing.\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{useMemo}from\"react\";const defaultImage={src:\"https://framerusercontent.com/images/GfGkADagM4KEibNcIiRUWlfrR0.jpg\",alt:\"Gradient 1 - Blue\"};/**\n * ParallaxFixedImage\n *\n * @framerSupportedLayoutWidth 100%\n * @framerSupportedLayoutHeight fixed\n */export default function ParallaxFixedImage(props){const{image=defaultImage,opacity=1,overlayColor=\"#000000\",overlayOpacity=0,borderRadius=\"0px\",imagePosition=\"center\",link=\"\",openInNewTab=false,style={}}=props;const overlayRGBA=useMemo(()=>{// Convert hex to rgba\nlet hex=overlayColor.replace(\"#\",\"\");if(hex.length===3)hex=hex.split(\"\").map(x=>x+x).join(\"\");const num=parseInt(hex,16);const r=num>>16&255;const g=num>>8&255;const b=num&255;return`rgba(${r},${g},${b},${overlayOpacity})`;},[overlayColor,overlayOpacity]);return link?/*#__PURE__*/_jsx(\"a\",{href:link,target:openInNewTab?\"_blank\":undefined,rel:openInNewTab?\"noopener noreferrer\":undefined,style:{display:\"block\",width:\"100%\",height:\"100%\",textDecoration:\"none\",color:\"inherit\"},\"aria-label\":image.alt||\"Parallax link\",children:/*#__PURE__*/_jsxs(\"div\",{style:{...style,position:\"relative\",width:\"100%\",height:\"100%\",overflow:\"hidden\",borderRadius,display:\"flex\",alignItems:\"stretch\",justifyContent:\"stretch\",background:\"transparent\"},children:[/*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",top:0,left:0,zIndex:1,pointerEvents:\"none\",borderRadius,background:overlayOpacity>0?overlayRGBA:undefined,width:\"100%\",height:\"100%\"}}),/*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",top:0,left:0,zIndex:0,pointerEvents:\"none\",borderRadius,backgroundImage:`url(${image.src})`,backgroundSize:\"cover\",backgroundPosition:imagePositionToCSS(imagePosition),backgroundRepeat:\"no-repeat\",backgroundAttachment:\"fixed\",opacity,transition:\"opacity 0.2s cubic-bezier(.4,0,.2,1)\",width:\"100%\",height:\"100%\"},\"aria-label\":image.alt||\"Parallax image\",role:\"img\"})]})}):/*#__PURE__*/_jsxs(\"div\",{style:{...style,position:\"relative\",width:\"100%\",height:\"100%\",overflow:\"hidden\",borderRadius,display:\"flex\",alignItems:\"stretch\",justifyContent:\"stretch\",background:\"transparent\"},children:[/*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",top:0,left:0,zIndex:1,pointerEvents:\"none\",borderRadius,background:overlayOpacity>0?overlayRGBA:undefined,width:\"100%\",height:\"100%\"}}),/*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",top:0,left:0,zIndex:0,pointerEvents:\"none\",borderRadius,backgroundImage:`url(${image.src})`,backgroundSize:\"cover\",backgroundPosition:imagePositionToCSS(imagePosition),backgroundRepeat:\"no-repeat\",backgroundAttachment:\"fixed\",opacity,transition:\"opacity 0.2s cubic-bezier(.4,0,.2,1)\",width:\"100%\",height:\"100%\"},\"aria-label\":image.alt||\"Parallax image\",role:\"img\"})]});}function imagePositionToCSS(position){switch(position){case\"center\":return\"center\";case\"topLeft\":return\"left top\";case\"topRight\":return\"right top\";case\"bottomLeft\":return\"left bottom\";case\"bottomRight\":return\"right bottom\";default:return\"center\";}}addPropertyControls(ParallaxFixedImage,{image:{type:ControlType.ResponsiveImage,title:\"Image\"},link:{type:ControlType.Link,title:\"Link\",defaultValue:\"\"},openInNewTab:{type:ControlType.Boolean,title:\"New Tab\",defaultValue:false,enabledTitle:\"Yes\",disabledTitle:\"No\"},opacity:{type:ControlType.Number,title:\"Image Opacity\",min:0,max:1,step:.01,defaultValue:1,unit:\"\"},overlayColor:{type:ControlType.Color,title:\"Overlay Color\",defaultValue:\"#000000\"},overlayOpacity:{type:ControlType.Number,title:\"Overlay Opacity\",min:0,max:1,step:.01,defaultValue:0,unit:\"\"},borderRadius:{type:ControlType.BorderRadius,title:\"Border Radius\",defaultValue:\"0px\"},imagePosition:{type:ControlType.Enum,title:\"Image Position\",options:[\"center\",\"topLeft\",\"topRight\",\"bottomLeft\",\"bottomRight\"],defaultValue:\"center\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ParallaxFixedImage\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"fixed\",\"framerSupportedLayoutWidth\":\"100%\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ParallaxFixedImage.map"],"mappings":"6KAMG,SAAwB,EAAmB,EAAM,CAAC,GAAK,CAAC,QAAM,EAAa,UAAQ,EAAE,eAAa,UAAU,iBAAe,EAAE,eAAa,MAAM,gBAAc,SAAS,OAAK,GAAG,eAAa,GAAM,QAAM,CAAC,GAAG,EAAY,EAAYA,MAAY,CACnP,IAAI,EAAI,EAAa,QAAQ,IAAI,EAAE,EAAK,EAAI,SAAS,IAAE,EAAI,EAAI,MAAM,EAAE,CAAC,CAAC,IAAI,GAAG,EAAE,CAAC,CAAC,CAAC,KAAK,EAAE,GAAE,IAAM,EAAI,SAAS,EAAI,EAAE,EAAyD,MAAM,QAArD,GAAK,GAAG,IAAuD,GAA3C,GAAK,EAAE,IAAyC,GAA7B,EAAI,IAA8B,GAAG,EAAe,EAAG,EAAE,CAAC,EAAa,CAAc,CAAC,EAAE,OAAO,EAAkB,EAAK,IAAI,CAAC,KAAK,EAAK,OAAO,EAAa,SAAS,IAAA,GAAU,IAAI,EAAa,sBAAsB,IAAA,GAAU,MAAM,CAAC,QAAQ,QAAQ,MAAM,OAAO,OAAO,OAAO,eAAe,OAAO,MAAM,SAAS,EA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