{"version":3,"file":"ImageFlipper.DFJTPmrN.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/HcFAotVmfmeX3gayWMno/pmEF3tXcd7l4AkGv9xW7/ImageFlipper.js"],"sourcesContent":["// Flipping image frame with two replaceable images, flipping back and forth slowly\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useState,startTransition}from\"react\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";/**\n * Flipping Image Frame\n *\n * @framerIntrinsicWidth 200\n * @framerIntrinsicHeight 200\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */export default function ImageFlipper(props){const{image1={src:\"https://framerusercontent.com/images/GfGkADagM4KEibNcIiRUWlfrR0.jpg\",alt:\"Gradient 1 - Blue\"},image2={src:\"https://framerusercontent.com/images/aNsAT3jCvt4zglbWCUoFe33Q.jpg\",alt:\"Gradient 2 - Purple\"},image3={src:\"https://framerusercontent.com/images/BYnxEV1zjYb9bhWh1IwBZ1ZoS60.jpg\",alt:\"Gradient 3 - Orange\"},image4={src:\"https://framerusercontent.com/images/2uTNEj5aTl2K3NJaEFWMbnrA.jpg\",alt:\"Gradient 4 - Yellow\"},flipInterval=2,radius=8,style}=props;const[index,setIndex]=useState(0);const isStatic=useIsStaticRenderer();const images=[image1,image2,image3,image4];useEffect(()=>{if(isStatic)return;const interval=setInterval(()=>{startTransition(()=>setIndex(i=>(i+1)%images.length));},Math.max(.5,flipInterval)*1e3);return()=>clearInterval(interval);},[flipInterval,isStatic,images.length]);return /*#__PURE__*/_jsx(\"div\",{style:{...style,width:\"100%\",height:\"100%\",position:\"relative\",overflow:\"hidden\",borderRadius:radius,background:\"#fff\",boxShadow:\"0 2px 8px rgba(0,0,0,0.08)\",border:`${props.borderWidth}px solid ${props.borderColor}`},children:images.map((img,i)=>/*#__PURE__*/_jsx(\"img\",{src:img.src,alt:img.alt,style:{width:\"100%\",height:\"100%\",objectFit:\"cover\",borderRadius:radius,position:\"absolute\",top:0,left:0,opacity:index===i?1:0,transition:\"opacity 1s cubic-bezier(.68,-0.55,.27,1.55)\"}},i))});}addPropertyControls(ImageFlipper,{image1:{type:ControlType.ResponsiveImage,title:\"Image 1\"},image2:{type:ControlType.ResponsiveImage,title:\"Image 2\"},image3:{type:ControlType.ResponsiveImage,title:\"Image 3\"},image4:{type:ControlType.ResponsiveImage,title:\"Image 4\"},flipInterval:{type:ControlType.Number,title:\"Flip Interval (s)\",defaultValue:2,min:.5,max:10,step:.1,displayStepper:false},radius:{type:ControlType.Number,title:\"Radius\",defaultValue:8,min:0,max:64,step:1,displayStepper:true},borderColor:{type:ControlType.Color,title:\"Border Color\",defaultValue:\"#222222\"},borderWidth:{type:ControlType.Number,title:\"Border Width\",defaultValue:2,min:0,max:16,step:1,displayStepper:true}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ImageFlipper\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerIntrinsicHeight\":\"200\",\"framerContractVersion\":\"1\",\"framerIntrinsicWidth\":\"200\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ImageFlipper.map"],"mappings":"2LASG,SAAwB,EAAa,EAAM,CAAC,GAAK,CAAC,SAAO,CAAC,IAAI,sEAAsE,IAAI,oBAAoB,CAAC,SAAO,CAAC,IAAI,oEAAoE,IAAI,sBAAsB,CAAC,SAAO,CAAC,IAAI,uEAAuE,IAAI,sBAAsB,CAAC,SAAO,CAAC,IAAI,oEAAoE,IAAI,sBAAsB,CAAC,eAAa,EAAE,SAAO,EAAE,SAAO,EAAW,CAAC,EAAM,GAAUA,EAAS,EAAE,CAAO,EAAS,GAAqB,CAAO,EAAO,CAAC,EAAO,EAAO,EAAO,EAAO,CAAqO,OAApO,MAAc,CAAC,GAAG,EAAS,OAAO,IAAM,EAAS,gBA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