{"version":3,"file":"FrameTransitioner.B2VFMoPS.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":"wQAKG,SAAwB,EAAkB,EAAM,CAAC,GAAK,CAAC,SAAO,CAAC,EAAE,QAAM,GAAG,WAAS,EAAE,aAAW,EAAE,cAAY,GAAG,aAAW,EAAE,sBAAoB,SAAS,oBAAkB,UAAU,EAAW,CAAC,EAAa,GAAiBA,EAAS,CAAC,EAAQ,EAAYC,EAAO,IAAI,EAAQ,EAAS,EAAoB,EAAQ,MAAsB,CAAC,OAAO,EAAP,CAA4B,IAAI,OAAO,MAAM,aAAa,IAAI,QAAQ,MAAM,WAAW,QAAQ,MAAM,QAAS,CAAC,EAAQ,MAAkB,CAAC,OAAO,EAAP,CAA0B,IAAI,MAAM,MAAM,aAAa,IAAI,SAAS,MAAM,WAAW,QAAQ,MAAM,QAAS,CAAC,EAGlJ,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,CAAC,CAAE,CAAC,CAAE,GAAG,EAAS,GAAO,GAAG,CAAE,EACtO,EAAe,EAAO,eAAe,CAAC,EAAW,CAAE,EAAE,EAAW,GAAG,EAAE,UAAU,CAAI,EAAY,SAAS,cAAc,EAAY,OAAO,EAAG,aAAa,CAAc,CAAE,CAAE,EAAE,CAAC,EAAO,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