{"version":3,"file":"LogoSwitcher.DNBeLEkB.mjs","names":["useState","useMemo","__esmMin","init_npm_react_18_3_1","te","pe","init_jsx_runtime","c","ce","_e","motion","AnimatePresence","init_framer_motion_DhsWWWsN","init_framer_DxfB3JJo","addPropertyControls","useIsStaticRenderer","ControlType","LogoSwitcher","props","currentSetIndex","setCurrentSetIndex","isAnimating","setIsAnimating","isStatic","logoSets","sets","i","logos","columnsPerRow","currentLogos","interval","prev","exitDelay","switchInterval","getJustifyContent","distribute","alignment","logoSpacing","logoHeight","logoWidth","logo","index","variants","animationEffect","fadeDelay","init_LogoSwitcher"],"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\"}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