{"version":3,"file":"LogoSwitcher.CAtqaD3A.mjs","names":["useState","useMemo"],"sources":["https:/framerusercontent.com/modules/WZ8s8BZexJGijP7WIcZg/x6qHBua21THme88PpNCL/LogoSwitcher.js"],"sourcesContent":["// Customer logo switcher with 6 logos at a time, which fade away one by one with 0.05 sec delay, and another set of logos show up one by one, replacing previous collection. User has control to add slots and connect logos to them.\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{useState,useEffect,useMemo,startTransition}from\"react\";import{motion,AnimatePresence}from\"framer-motion\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";/**\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight auto\n */export default function LogoSwitcher(props){const{logos=[{src:\"https://framerusercontent.com/images/GfGkADagM4KEibNcIiRUWlfrR0.jpg\",alt:\"Logo 1\"},{src:\"https://framerusercontent.com/images/aNsAT3jCvt4zglbWCUoFe33Q.jpg\",alt:\"Logo 2\"},{src:\"https://framerusercontent.com/images/BYnxEV1zjYb9bhWh1IwBZ1ZoS60.jpg\",alt:\"Logo 3\"},{src:\"https://framerusercontent.com/images/2uTNEj5aTl2K3NJaEFWMbnrA.jpg\",alt:\"Logo 4\"},{src:\"https://framerusercontent.com/images/f9RiWoNpmlCMqVRIHz8l8wYfeI.jpg\",alt:\"Logo 5\"},{src:\"https://framerusercontent.com/images/GfGkADagM4KEibNcIiRUWlfrR0.jpg\",alt:\"Logo 6\"}],switchInterval=3e3,fadeDelay=50,exitDelay=50,animationEffect=\"fade\",backgroundColor=\"#FFFFFF\",logoSpacing=24,logoHeight=60,logoWidth=90,columnsPerRow=6,distribute=\"space-between\",alignment=\"center\"}=props;const[currentSetIndex,setCurrentSetIndex]=useState(0);const[isAnimating,setIsAnimating]=useState(false);const isStatic=useIsStaticRenderer();// Group logos into sets based on columnsPerRow\nconst logoSets=useMemo(()=>{const sets=[];for(let i=0;i<logos.length;i+=columnsPerRow){sets.push(logos.slice(i,i+columnsPerRow));}return sets.length>0?sets:[[]];},[logos,columnsPerRow]);const currentLogos=logoSets[currentSetIndex]||[];useEffect(()=>{if(isStatic||logoSets.length<=1)return;const interval=setInterval(()=>{startTransition(()=>{setIsAnimating(true);setTimeout(()=>{setCurrentSetIndex(prev=>(prev+1)%logoSets.length);setIsAnimating(false);},exitDelay*columnsPerRow+200)// Wait for all logos to fade out\n;});},switchInterval);return()=>clearInterval(interval);},[switchInterval,exitDelay,logoSets.length,isStatic,columnsPerRow]);const getJustifyContent=()=>{if(distribute===\"flex-start\"||distribute===\"flex-end\"){switch(alignment){case\"left\":return\"flex-start\";case\"right\":return\"flex-end\";default:return\"center\";}}return distribute;};if(isStatic){return /*#__PURE__*/_jsx(\"div\",{style:{position:\"relative\",width:\"100%\",backgroundColor,padding:\"24px 0\",display:\"flex\",justifyContent:getJustifyContent(),alignItems:\"center\",flexWrap:\"wrap\",gap:`${logoSpacing}px`,minHeight:logoHeight+48},children:currentLogos.map((logo,index)=>/*#__PURE__*/_jsx(\"div\",{style:{height:logoHeight,width:logoWidth,display:\"flex\",alignItems:\"center\",justifyContent:\"center\",overflow:\"hidden\"},children:/*#__PURE__*/_jsx(\"img\",{src:logo.src,alt:logo.alt,style:{width:\"100%\",height:\"100%\",objectFit:\"contain\",filter:\"grayscale(100%)\",opacity:.7}})},index))});}const getAnimationVariants=()=>{switch(animationEffect){case\"slide-up\":return{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:-20}};case\"slide-down\":return{initial:{opacity:0,y:-20},animate:{opacity:1,y:0},exit:{opacity:0,y:20}};case\"scale\":return{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.8}};default:return{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0}};}};const variants=getAnimationVariants();return /*#__PURE__*/_jsx(\"div\",{style:{position:\"relative\",width:\"100%\",backgroundColor,padding:\"24px 0\",display:\"flex\",justifyContent:getJustifyContent(),alignItems:\"center\",flexWrap:\"wrap\",gap:`${logoSpacing}px`,minHeight:logoHeight+48,overflow:\"hidden\"},children:/*#__PURE__*/_jsx(AnimatePresence,{mode:\"wait\",children:currentLogos.map((logo,index)=>/*#__PURE__*/_jsx(motion.div,{initial:variants.initial,animate:variants.animate,exit:variants.exit,transition:{duration:.4,delay:isAnimating?index*(exitDelay/1e3):index*(fadeDelay/1e3),ease:\"easeOut\"},style:{height:logoHeight,width:logoWidth,display:\"flex\",alignItems:\"center\",justifyContent:\"center\",overflow:\"hidden\"},children:/*#__PURE__*/_jsx(motion.img,{src:logo.src,alt:logo.alt,style:{width:\"100%\",height:\"100%\",objectFit:\"contain\",filter:\"grayscale(100%)\"},whileHover:{filter:\"grayscale(0%)\"},transition:{duration:.3}})},`${currentSetIndex}-${index}`))})});}addPropertyControls(LogoSwitcher,{logos:{type:ControlType.Array,title:\"Logos\",control:{type:ControlType.ResponsiveImage},maxCount:24,defaultValue:[{src:\"https://framerusercontent.com/images/GfGkADagM4KEibNcIiRUWlfrR0.jpg\",alt:\"Logo 1\"},{src:\"https://framerusercontent.com/images/aNsAT3jCvt4zglbWCUoFe33Q.jpg\",alt:\"Logo 2\"},{src:\"https://framerusercontent.com/images/BYnxEV1zjYb9bhWh1IwBZ1ZoS60.jpg\",alt:\"Logo 3\"},{src:\"https://framerusercontent.com/images/2uTNEj5aTl2K3NJaEFWMbnrA.jpg\",alt:\"Logo 4\"},{src:\"https://framerusercontent.com/images/f9RiWoNpmlCMqVRIHz8l8wYfeI.jpg\",alt:\"Logo 5\"},{src:\"https://framerusercontent.com/images/GfGkADagM4KEibNcIiRUWlfrR0.jpg\",alt:\"Logo 6\"}]},columnsPerRow:{type:ControlType.Number,title:\"Columns Per Row\",defaultValue:6,min:1,max:12,step:1},switchInterval:{type:ControlType.Number,title:\"Switch Interval\",defaultValue:3e3,min:1e3,max:1e4,step:500,unit:\"ms\"},fadeDelay:{type:ControlType.Number,title:\"Enter Delay\",defaultValue:50,min:10,max:200,step:10,unit:\"ms\"},exitDelay:{type:ControlType.Number,title:\"Exit Delay\",defaultValue:50,min:10,max:200,step:10,unit:\"ms\"},animationEffect:{type:ControlType.Enum,title:\"Animation Effect\",options:[\"fade\",\"slide-up\",\"slide-down\",\"scale\"],optionTitles:[\"Fade\",\"Slide Up\",\"Slide Down\",\"Scale\"],defaultValue:\"fade\"},backgroundColor:{type:ControlType.Color,title:\"Background\",defaultValue:\"#FFFFFF\"},distribute:{type:ControlType.Enum,title:\"Distribute\",options:[\"space-between\",\"flex-start\",\"flex-end\",\"space-around\"],optionTitles:[\"Space Between\",\"Start\",\"End\",\"Space Around\"],defaultValue:\"space-between\"},alignment:{type:ControlType.Enum,title:\"Alignment\",options:[\"left\",\"center\",\"right\"],optionTitles:[\"Left\",\"Center\",\"Right\"],defaultValue:\"center\",hidden:({distribute})=>distribute!==\"flex-start\"&&distribute!==\"flex-end\"},logoSpacing:{type:ControlType.Number,title:\"Logo Spacing\",defaultValue:24,min:8,max:48,step:4,unit:\"px\"},logoHeight:{type:ControlType.Number,title:\"Logo Height\",defaultValue:60,min:10,max:120,step:4,unit:\"px\"},logoWidth:{type:ControlType.Number,title:\"Logo Width\",defaultValue:90,min:60,max:180,step:4,unit:\"px\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"LogoSwitcher\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerSupportedLayoutHeight\":\"auto\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./LogoSwitcher.map"],"mappings":"+PAIG,SAAwB,EAAa,EAAM,CAAC,GAAK,CAAC,QAAM,CAAC,CAAC,IAAI,sEAAsE,IAAI,QAAQ,EAAE,CAAC,IAAI,oEAAoE,IAAI,QAAQ,EAAE,CAAC,IAAI,uEAAuE,IAAI,QAAQ,EAAE,CAAC,IAAI,oEAAoE,IAAI,QAAQ,EAAE,CAAC,IAAI,sEAAsE,IAAI,QAAQ,E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