{"version":3,"file":"ImageShadow.Br2cp4lU.mjs","names":["useState","useCallback","_Fragment"],"sources":["https:/framerusercontent.com/modules/nPkVmfLxzc4gEz1GNaAm/3EfwVHKYI8QjMXWLAWB9/ImageShadow.js"],"sourcesContent":["// Custom image component with colorful blurred shadow effect\nimport{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{useState,useEffect,useCallback,startTransition}from\"react\";/**\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n */export default function ImageShadow(props){const{image={src:\"https://framerusercontent.com/images/GfGkADagM4KEibNcIiRUWlfrR0.jpg\",alt:\"Image with shadow\"},images=[],enableRotation,rotationInterval,transitionDuration,shadow,borderRadius,showName,name,namePosition,nameColor,nameBackground,nameFont,namePadding,url,style}=props;const[currentIndex,setCurrentIndex]=useState(0);const getImageList=useCallback(()=>{if(enableRotation&&images.length>0){return images;}return[image];},[enableRotation,images,image]);const imageList=getImageList();const currentImage=imageList[currentIndex]||image;useEffect(()=>{if(!enableRotation||images.length<=1)return;const interval=setInterval(()=>{startTransition(()=>{setCurrentIndex(prev=>(prev+1)%images.length);});},rotationInterval*1e3);return()=>clearInterval(interval);},[enableRotation,images.length,rotationInterval]);const containerStyle={position:\"relative\",width:\"100%\",height:\"100%\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\"};const shadowStyle={position:\"absolute\",width:\"100%\",height:\"100%\",backgroundImage:`url(${currentImage.src})`,backgroundSize:\"cover\",backgroundPosition:\"center\",borderRadius:`${borderRadius}px`,filter:`blur(${shadow.blurAmount}px) brightness(${1-shadow.darkenAmount/100})`,opacity:shadow.opacity/100,transform:`translate(${shadow.offsetX}px, ${shadow.offsetY}px)`,zIndex:0,transition:`background-image ${transitionDuration}s ease-in-out`};const imageStyle={position:\"relative\",width:\"100%\",height:\"100%\",objectFit:\"cover\",borderRadius:`${borderRadius}px`,zIndex:1,transition:`opacity ${transitionDuration}s ease-in-out`};const getNamePositionStyles=()=>{const base={position:\"absolute\",padding:`${namePadding}px`,borderRadius:`${Math.max(0,borderRadius-namePadding)}px`,backgroundColor:nameBackground,color:nameColor,zIndex:2,...nameFont};switch(namePosition){case\"top-left\":return{...base,top:0,left:0};case\"top-right\":return{...base,top:0,right:0};case\"bottom-left\":return{...base,bottom:0,left:0};case\"bottom-right\":return{...base,bottom:0,right:0};case\"center\":return{...base,top:\"50%\",left:\"50%\",transform:\"translate(-50%, -50%)\"};default:return{...base,bottom:0,left:0};}};const content=/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(\"div\",{style:shadowStyle,\"aria-hidden\":\"true\"}),/*#__PURE__*/_jsx(\"img\",{src:currentImage.src,alt:currentImage.alt||\"\",style:imageStyle}),showName&&name&&/*#__PURE__*/_jsx(\"span\",{style:getNamePositionStyles(),children:name})]});return /*#__PURE__*/_jsx(\"div\",{style:containerStyle,children:url?/*#__PURE__*/_jsx(\"a\",{href:url,target:\"_blank\",rel:\"noopener noreferrer\",style:{display:\"contents\",textDecoration:\"none\",color:\"inherit\"},children:content}):content});}addPropertyControls(ImageShadow,{image:{type:ControlType.ResponsiveImage,title:\"Image\"},enableRotation:{type:ControlType.Boolean,title:\"Rotate Images\",defaultValue:false,enabledTitle:\"On\",disabledTitle:\"Off\"},images:{type:ControlType.Array,title:\"Images\",control:{type:ControlType.ResponsiveImage},maxCount:10,defaultValue:[],hidden:({enableRotation})=>!enableRotation},rotationInterval:{type:ControlType.Number,title:\"Interval\",defaultValue:3,min:1,max:30,step:.5,unit:\"s\",hidden:({enableRotation})=>!enableRotation},transitionDuration:{type:ControlType.Number,title:\"Transition\",defaultValue:.5,min:.1,max:2,step:.1,unit:\"s\",hidden:({enableRotation})=>!enableRotation},shadow:{type:ControlType.Object,title:\"Shadow\",controls:{opacity:{type:ControlType.Number,title:\"Opacity\",defaultValue:80,min:0,max:100,step:1,unit:\"%\"},darkenAmount:{type:ControlType.Number,title:\"Darken Amount\",defaultValue:10,min:0,max:100,step:1,unit:\"%\"},offsetX:{type:ControlType.Number,title:\"X\",defaultValue:0,min:-50,max:50,step:1,unit:\"px\"},offsetY:{type:ControlType.Number,title:\"Y\",defaultValue:20,min:-50,max:50,step:1,unit:\"px\"},blurAmount:{type:ControlType.Number,title:\"Blur\",defaultValue:30,min:0,max:50,step:1,unit:\"px\"}}},borderRadius:{type:ControlType.Number,title:\"Border Radius\",defaultValue:16,min:0,max:2e3,step:1,unit:\"px\"},showName:{type:ControlType.Boolean,title:\"Show Name\",defaultValue:false,enabledTitle:\"Show\",disabledTitle:\"Hide\"},name:{type:ControlType.String,title:\"Name\",defaultValue:\"Image Name\",hidden:({showName})=>!showName},namePosition:{type:ControlType.Enum,title:\"Position\",options:[\"bottom-left\",\"bottom-right\",\"top-left\",\"top-right\",\"center\"],optionTitles:[\"Bottom Left\",\"Bottom Right\",\"Top Left\",\"Top Right\",\"Center\"],defaultValue:\"bottom-left\",hidden:({showName})=>!showName},nameColor:{type:ControlType.Color,title:\"Text Color\",defaultValue:\"#FFFFFF\",hidden:({showName})=>!showName},nameBackground:{type:ControlType.Color,title:\"Background\",defaultValue:\"rgba(0, 0, 0, 0.5)\",hidden:({showName})=>!showName},nameFont:{type:ControlType.Font,title:\"Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"16px\",variant:\"Semibold\",letterSpacing:\"-0.01em\",lineHeight:\"1.2em\"},hidden:({showName})=>!showName},namePadding:{type:ControlType.Number,title:\"Padding\",defaultValue:12,min:0,max:50,step:1,unit:\"px\",hidden:({showName})=>!showName},url:{type:ControlType.Link,title:\"URL\",defaultValue:\"\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ImageShadow\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"fixed\",\"framerSupportedLayoutHeight\":\"fixed\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\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