{"version":3,"file":"FrameTransitioner.DxMXkyWM.mjs","names":["useState","useRef"],"sources":["https:/framerusercontent.com/modules/6cWeGliDfQxZFW8DAKJ5/aKnUkwgSLG7wa7o05zBV/FrameTransitioner.js"],"sourcesContent":["// Frame Carousel Component - Cycles through connected frames with customizable transitions\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{useState,useEffect,useRef,startTransition}from\"react\";import{motion,AnimatePresence}from\"framer-motion\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";/**\n * @framerDisableUnlink\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n */export default function FrameTransitioner(props){const{frames=[],delay=.5,showTime=3,blurAmount=5,scaleAmount=.9,startDelay=0,horizontalAlignment=\"center\",verticalAlignment=\"center\"}=props;const[currentIndex,setCurrentIndex]=useState(0);const intervalRef=useRef(null);const isStatic=useIsStaticRenderer();const getJustifyContent=()=>{switch(horizontalAlignment){case\"left\":return\"flex-start\";case\"right\":return\"flex-end\";default:return\"center\";}};const getAlignItems=()=>{switch(verticalAlignment){case\"top\":return\"flex-start\";case\"bottom\":return\"flex-end\";default:return\"center\";}};// Cycle through frames\nuseEffect(()=>{if(isStatic||frames.length<=1)return;const startCycle=()=>{intervalRef.current=window.setInterval(()=>{startTransition(()=>{setCurrentIndex(prevIndex=>prevIndex===frames.length-1?0:prevIndex+1);});},(showTime+delay)*1e3);};// Add initial delay before starting the cycle\nconst initialTimeout=window.setTimeout(()=>{startCycle();},startDelay*1e3);return()=>{if(intervalRef.current){clearInterval(intervalRef.current);}clearTimeout(initialTimeout);};},[frames.length,showTime,delay,startDelay,isStatic]);// Show static preview if no frames or in static mode\nif(frames.length===0){return /*#__PURE__*/_jsx(\"div\",{style:{width:\"100%\",height:\"100%\",display:\"flex\",alignItems:getAlignItems(),justifyContent:getJustifyContent(),color:\"#666\",fontSize:\"14px\",fontFamily:\"system-ui, sans-serif\"},children:\"Connect frames\"});}if(isStatic){return /*#__PURE__*/_jsx(\"div\",{style:{width:\"100%\",height:\"100%\",display:\"flex\",alignItems:getAlignItems(),justifyContent:getJustifyContent()},children:frames[0]});}return /*#__PURE__*/_jsx(\"div\",{style:{width:\"100%\",height:\"100%\",display:\"flex\",alignItems:getAlignItems(),justifyContent:getJustifyContent(),position:\"relative\",overflow:\"hidden\"},children:/*#__PURE__*/_jsx(AnimatePresence,{mode:\"wait\",children:/*#__PURE__*/_jsx(motion.div,{initial:{opacity:0,filter:`blur(${blurAmount}px)`,scale:scaleAmount},animate:{opacity:1,filter:\"blur(0px)\",scale:1},exit:{opacity:0,filter:`blur(${blurAmount}px)`,scale:scaleAmount},transition:{duration:delay,ease:\"easeInOut\"},style:{width:\"100%\",height:\"100%\",display:\"flex\",alignItems:getAlignItems(),justifyContent:getJustifyContent(),position:\"relative\"},children:/*#__PURE__*/_jsx(\"div\",{style:{display:\"flex\",alignItems:getAlignItems(),justifyContent:getJustifyContent(),width:\"100%\",height:\"100%\"},children:frames[currentIndex]})},currentIndex)})});}addPropertyControls(FrameTransitioner,{frames:{type:ControlType.Array,title:\"Frames\",control:{type:ControlType.ComponentInstance},maxCount:10,defaultValue:[]},startDelay:{type:ControlType.Number,title:\"Start Delay\",defaultValue:0,min:0,max:10,step:.1,unit:\"s\"},delay:{type:ControlType.Number,title:\"Transition Duration\",defaultValue:.5,min:.1,max:3,step:.1,unit:\"s\"},showTime:{type:ControlType.Number,title:\"Frame Display Time\",defaultValue:3,min:.5,max:10,step:.5,unit:\"s\"},blurAmount:{type:ControlType.Number,title:\"Blur Amount\",defaultValue:5,min:0,max:20,step:1,unit:\"px\"},scaleAmount:{type:ControlType.Number,title:\"Scale Amount\",defaultValue:.9,min:.5,max:1.5,step:.05},horizontalAlignment:{type:ControlType.Enum,title:\"Horizontal Alignment\",options:[\"left\",\"center\",\"right\"],optionTitles:[\"Left\",\"Center\",\"Right\"],defaultValue:\"center\",displaySegmentedControl:true},verticalAlignment:{type:ControlType.Enum,title:\"Vertical Alignment\",options:[\"top\",\"center\",\"bottom\"],optionTitles:[\"Top\",\"Center\",\"Bottom\"],defaultValue:\"center\",displaySegmentedControl:true,description:\"Follow the creator on [Twitter](https://x.com/Muhammad_maass)\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"FrameTransitioner\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"fixed\",\"framerDisableUnlink\":\"* @framerSupportedLayoutWidth fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./FrameTransitioner.map"],"mappings":"6QAKG,SAAwB,EAAkB,EAAM,CAAC,GAAK,CAAC,SAAO,EAAE,CAAC,QAAM,GAAG,WAAS,EAAE,aAAW,EAAE,cAAY,GAAG,aAAW,EAAE,sBAAoB,SAAS,oBAAkB,UAAU,EAAW,CAAC,EAAa,GAAiBA,EAAS,EAAE,CAAO,EAAYC,EAAO,KAAK,CAAO,EAAS,GAAqB,CAAO,MAAsB,CAAC,OAAO,EAAP,CAA4B,IAAI,OAAO,MAAM,aAAa,IAAI,QAAQ,MAAM,WAAW,QAAQ,MAAM,WAAkB,MAAkB,CAAC,OAAO,EAAP,CAA0B,IAAI,MAAM,MAAM,aAAa,IAAI,SAAS,MAAM,WAAW,QAAQ,MAAM,WAGxI,OAFtb,MAAc,CAAC,GAAG,GAAU,EAAO,QAAQ,EAAE,OAAO,IAAM,MAAe,CAAC,EAAY,QAAQ,EAAO,gBAAgB,CAAC,MAAoB,CAAC,EAAgB,GAAW,IAAY,EAAO,OAAO,EAAE,EAAE,EAAU,EAAE,EAAG,GAAI,EAAS,GAAO,IAAI,EACrO,EAAe,EAAO,eAAe,CAAC,GAAY,EAAG,EAAW,IAAI,CAAC,UAAU,CAAI,EAAY,SAAS,cAAc,EAAY,QAAQ,CAAE,aAAa,EAAe,GAAK,CAAC,EAAO,OAAO,EAAS,EAAM,EAAW,EAAS,CAAC,CACnO,EAAO,SAAS,EAAuB,EA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