{"version":3,"file":"ImageSlideshow.CfOr4Hfx.mjs","names":["useState","useRef"],"sources":["https:/framerusercontent.com/modules/vUuNX5UoICEuYb5jUFXV/U6FIvWtxfIfT85pF91nO/ImageSlideshow.js"],"sourcesContent":["// ImageSlideshow component that expands to fill parent, takes uploaded images, has speed and radius settings\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useRef,useState,startTransition}from\"react\";import{addPropertyControls,ControlType,useIsStaticRenderer,RenderTarget}from\"framer\";/**\n * ImageSlideshow\n *\n * Expands to fill parent, takes uploaded images, has speed and radius settings\n *\n * @framerIntrinsicWidth 400\n * @framerIntrinsicHeight 300\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */export default function ImageSlideshow(props){const{images=[{src:\"https://framerusercontent.com/images/GfGkADagM4KEibNcIiRUWlfrR0.jpg\",alt:\"Gradient 1 - Blue\",position:\"center center\"},{src:\"https://framerusercontent.com/images/aNsAT3jCvt4zglbWCUoFe33Q.jpg\",alt:\"Gradient 2 - Purple\",position:\"center center\"},{src:\"https://framerusercontent.com/images/BYnxEV1zjYb9bhWh1IwBZ1ZoS60.jpg\",alt:\"Gradient 3 - Orange\",position:\"center center\"}],speed=2,radius=0,style}=props;const[index,setIndex]=useState(0);const timer=useRef(null);const isStatic=useIsStaticRenderer();useEffect(()=>{if(isStatic||images.length<=1)return;if(timer.current)clearInterval(timer.current);timer.current=window.setInterval(()=>{startTransition(()=>setIndex(i=>(i+1)%images.length));},Math.max(500,speed*1e3));return()=>{if(timer.current)clearInterval(timer.current);};},[images.length,speed,isStatic]);if(!images.length)return null;if(RenderTarget.current()===RenderTarget.thumbnail){return /*#__PURE__*/_jsx(\"div\",{style:{width:\"100%\",height:\"100%\",background:\"#eee\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\"},children:\"ImageSlideshow\"});}return /*#__PURE__*/_jsx(\"div\",{style:{...style,width:\"100%\",height:\"100%\",position:\"relative\",overflow:\"hidden\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",background:\"#000\",borderRadius:radius},children:images.map((img,i)=>/*#__PURE__*/_jsx(\"img\",{src:img.src,alt:img.alt||\"ImageSlideshow image\",style:{position:\"absolute\",top:0,left:0,width:\"100%\",height:\"100%\",objectFit:\"cover\",objectPosition:img.position===\"focal-point\"&&img.focalPoint?`${img.focalPoint.x}% ${img.focalPoint.y}%`:img.position||\"center center\",opacity:i===index?1:0,transition:\"opacity 0.6s cubic-bezier(.4,0,.2,1)\",pointerEvents:i===index?\"auto\":\"none\",borderRadius:radius}},img.src))});}addPropertyControls(ImageSlideshow,{images:{type:ControlType.Array,title:\"Images\",control:{type:ControlType.Object,controls:{src:{type:ControlType.File,allowedFileTypes:[\"jpg\",\"jpeg\",\"png\",\"gif\",\"webp\",\"svg\"],title:\"Upload Image\"},alt:{type:ControlType.String,title:\"Alt Text\"},position:{type:ControlType.Enum,title:\"Position\",options:[\"center center\",\"top left\",\"top center\",\"top right\",\"center left\",\"center right\",\"bottom left\",\"bottom center\",\"bottom right\",\"focal-point\"],optionTitles:[\"Center\",\"Top Left\",\"Top Center\",\"Top Right\",\"Center Left\",\"Center Right\",\"Bottom Left\",\"Bottom Center\",\"Bottom Right\",\"Focal Point\"],defaultValue:\"center center\"},focalPoint:{type:ControlType.Object,title:\"Focal Point\",controls:{x:{type:ControlType.Number,title:\"X (%)\",min:0,max:100,defaultValue:50},y:{type:ControlType.Number,title:\"Y (%)\",min:0,max:100,defaultValue:50}},hidden:img=>img.position!==\"focal-point\"}}},maxCount:10,defaultValue:[{src:\"https://framerusercontent.com/images/GfGkADagM4KEibNcIiRUWlfrR0.jpg\",alt:\"Gradient 1 - Blue\",position:\"center center\"},{src:\"https://framerusercontent.com/images/aNsAT3jCvt4zglbWCUoFe33Q.jpg\",alt:\"Gradient 2 - Purple\",position:\"center center\"},{src:\"https://framerusercontent.com/images/BYnxEV1zjYb9bhWh1IwBZ1ZoS60.jpg\",alt:\"Gradient 3 - Orange\",position:\"center center\"}]},speed:{type:ControlType.Number,title:\"Speed (sec)\",defaultValue:2,min:1,max:10,step:.5,displayStepper:true},radius:{type:ControlType.Number,title:\"Radius\",defaultValue:0,min:0,max:64,step:1}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ImageSlideshow\",\"slots\":[],\"annotations\":{\"framerIntrinsicWidth\":\"400\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerIntrinsicHeight\":\"300\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ImageSlideshow.map"],"mappings":"4WAWG,SAAwB,EAAe,EAAM,CAAC,GAAK,CAAC,SAAO,CAAC,CAAC,IAAI,sEAAsE,IAAI,oBAAoB,SAAS,gBAAgB,CAAC,CAAC,IAAI,oEAAoE,IAAI,sBAAsB,SAAS,gBAAgB,CAAC,CAAC,IAAI,uEAAuE,IAAI,sBAAsB,SAAS,gBAAgB,CAAC,CAAC,QAAM,EAAE,SAAO,EAAE,SAAO,EAAW,CAAC,EAAM,GAAUA,EAAS,EAAE,CAAO,EAAMC,EAAO,KAAK,CAAO,EAAS,GAAqB,CAAsjB,OAArjB,MAAc,CAAI,QAAU,EAAO,QAAQ,GAA8K,OAAlK,EAAM,SAAQ,cAAc,EAAM,QAAQ,CAAC,EAAM,QAAQ,EAAO,gBAAgB,CAAC,MAAoB,EAAS,IAAI,EAAE,GAAG,EAAO,OAAO,CAAC,EAAG,KAAK,IAAI,IAAI,EAAM,IAAI,CAAC,KAAW,CAAI,EAAM,SAAQ,cAAc,EAAM,QAAQ,GAAK,CAAC,EAAO,OAAO,EAAM,EAAS,CAAC,CAAK,EAAO,OAAsB,EAAa,SAAS,GAAG,EAAa,UAA+B,EAAK,MAAM,CAAC,MAAM,CAAC,MAAM,OAAO,OAAO,OAAO,WAAW,OAAO,QAAQ,OAAO,WAAW,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