{"version":3,"file":"LogoSwitcher.eNB0-F0B.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,SAAS,CAAC,CAAC,IAAI,oEAAoE,IAAI,SAAS,CAAC,CAAC,IAAI,uEAAuE,IAAI,SAAS,CAAC,CAAC,IAAI,oEAAoE,IAAI,SAAS,CAAC,CAAC,IAAI,sEAAsE,IAAI,SAAS,CAAC,C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