{"version":3,"file":"FrameTransitioner.DHVLxGFi.mjs","names":["useState","useRef","__esmMin","init_ssg_sandbox_shims","te","window","_e","de","init_jsx_runtime","init_npm_react_18_3_1","ce","motion","AnimatePresence","init_framer_motion_DhsWWWsN","init_framer_BCdLsbZT","addPropertyControls","ControlType","useIsStaticRenderer","FrameTransitioner","props","currentIndex","setCurrentIndex","intervalRef","isStatic","getJustifyContent","horizontalAlignment","getAlignItems","verticalAlignment","frames","startCycle","prevIndex","showTime","delay","initialTimeout","startDelay","blurAmount","scaleAmount","init_FrameTransitioner"],"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":"A,wQAKG,SAAwBkB,EAAkB,EAAM,CAAC,GAAK,CAAC,SAAO,CAAC,EAAE,QAAM,GAAG,WAAS,EAAE,aAAW,EAAE,cAAY,GAAG,aAAW,EAAE,sBAAoB,SAAS,oBAAkB,UAAUC,EAAW,CAACC,EAAaC,GAAiBrB,EAAS,CAAC,EAAQsB,EAAYrB,EAAO,IAAI,EAAQsB,EAASN,EAAoB,EAAQO,MAAsB,CAAC,OAAOC,EAAP,CAA4B,IAAI,OAAO,MAAM,aAAa,IAAI,QAAQ,MAAM,WAAW,QAAQ,MAAM,QAAS,CAAC,EAAQC,MAAkB,CAAC,OAAOC,EAAP,CAA0B,IAAI,MAAM,MAAM,aAAa,IAAI,SAAS,MAAM,WAAW,QAAQ,MAAM,QAAS,CAAC,EAGlJ,OAFtbjB,MAAc,CAAC,GAAGa,GAAUK,EAAO,QAAQ,EAAE,OAAO,IAAMC,M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