{"version":3,"file":"LogoTicker.CpCbPiEW.mjs","names":["useRef","useState","useMemo"],"sources":["https:/framerusercontent.com/modules/bBofEf9xH70WFbmXOQph/fPQYY9vWo6T9NO5c20BC/LogoTicker.js"],"sourcesContent":["// Horizontally scrolling, infinitely looping row of brand logos with edge fade, fully responsive, transparent background, evenly spaced, no text/title.\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useRef,useEffect,useState,useMemo,startTransition}from\"react\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";const defaultLogos=[{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\"}];/**\n * Infinite horizontal logo scroller with edge fade, responsive, transparent background, evenly spaced, no text/title.\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight fixed\n */export default function LogoTicker(props){const{logos=defaultLogos,logoHeight,gap,speed,edgeFade,style}=props;const isStatic=useIsStaticRenderer();const containerRef=useRef(null);const[containerWidth,setContainerWidth]=useState(0);const[totalLogoWidth,setTotalLogoWidth]=useState(0);const logoRefs=useRef([]);// Filter out logos without src\nconst validLogos=useMemo(()=>logos.filter(logo=>logo.src),[logos]);// Measure container width for animation\nuseEffect(()=>{if(!containerRef.current)return;function update(){startTransition(()=>setContainerWidth(containerRef.current.offsetWidth||0));}update();window.addEventListener(\"resize\",update);return()=>window.removeEventListener(\"resize\",update);},[]);// Measure actual logo widths\nuseEffect(()=>{if(!logoRefs.current.length||isStatic)return;function measureLogos(){let total=0;// Measure only the first set of logos (not duplicates)\nfor(let i=0;i<validLogos.length;i++){const logo=logoRefs.current[i];if(logo){total+=logo.offsetWidth;}}// Add gaps between logos\ntotal+=gap*validLogos.length;startTransition(()=>setTotalLogoWidth(total));}// Wait for images to load\nconst images=logoRefs.current.slice(0,validLogos.length);let loadedCount=0;const checkAllLoaded=()=>{loadedCount++;if(loadedCount===images.length){measureLogos();}};images.forEach(img=>{if(img&&img.complete){checkAllLoaded();}else if(img){img.addEventListener(\"load\",checkAllLoaded);}});window.addEventListener(\"resize\",measureLogos);return()=>{window.removeEventListener(\"resize\",measureLogos);images.forEach(img=>{if(img)img.removeEventListener(\"load\",checkAllLoaded);});};},[validLogos,logoHeight,gap,isStatic]);// Duplicate logos for seamless loop\nconst logoList=useMemo(()=>[...validLogos,...validLogos],[validLogos]);// Animation duration based on speed and content width\nconst duration=useMemo(()=>{// Speed: px/sec, duration = total px / speed\nif(totalLogoWidth===0)return 10// fallback\n;return totalLogoWidth/speed;},[totalLogoWidth,speed]);// Keyframes for animation\nconst animation=isStatic?undefined:{animation:`scroll ${duration}s linear infinite`};// Edge fade mask\nconst maskStyle=edgeFade?{WebkitMaskImage:\"linear-gradient(to right, transparent 0%, black 10%, black 90%, transparent 100%)\",maskImage:\"linear-gradient(to right, transparent 0%, black 10%, black 90%, transparent 100%)\"}:{};return /*#__PURE__*/_jsxs(\"div\",{ref:containerRef,style:{...style,width:\"100%\",height:logoHeight,overflow:\"hidden\",background:\"transparent\",position:\"relative\",...maskStyle,display:\"flex\",alignItems:\"center\"},\"aria-label\":\"Brand logos carousel\",role:\"region\",children:[/*#__PURE__*/_jsx(\"div\",{style:{display:\"flex\",flexDirection:\"row\",gap,alignItems:\"center\",...animation},children:logoList.map((logo,i)=>/*#__PURE__*/_jsx(\"img\",{ref:el=>{logoRefs.current[i]=el;},src:logo.src,alt:logo.alt||\"Logo\",style:{height:logoHeight,width:\"auto\",objectFit:\"contain\",display:\"block\",userSelect:\"none\",pointerEvents:\"none\",flexShrink:0},draggable:false},i))}),/*#__PURE__*/_jsx(\"style\",{children:`\n        @keyframes scroll {\n          0% { transform: translateX(0); }\n          100% { transform: translateX(-${totalLogoWidth}px); }\n        }\n      `})]});}addPropertyControls(LogoTicker,{logos:{type:ControlType.Array,title:\"Logos\",control:{type:ControlType.Object,controls:{src:{type:ControlType.File,allowedFileTypes:[\"jpg\",\"jpeg\",\"png\",\"gif\",\"webp\",\"svg\"],title:\"Image File\"},alt:{type:ControlType.String,title:\"Alt Text\",defaultValue:\"Logo\"}}},defaultValue:defaultLogos,maxCount:10},logoHeight:{type:ControlType.Number,title:\"Logo Height\",defaultValue:48,min:16,max:200,unit:\"px\"},gap:{type:ControlType.Number,title:\"Gap\",defaultValue:40,min:0,max:200,unit:\"px\"},speed:{type:ControlType.Number,title:\"Speed\",defaultValue:80,min:10,max:400,unit:\"px/sec\"},edgeFade:{type:ControlType.Boolean,title:\"Edge Fade\",defaultValue:true,enabledTitle:\"On\",disabledTitle:\"Off\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"LogoTicker\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./LogoTicker.map"],"mappings":"mOAMG,SAAwB,EAAW,EAAM,CAAC,GAAK,CAAC,QAAM,EAAa,aAAW,MAAI,QAAM,WAAS,SAAO,EAAY,EAAS,GAAqB,CAAO,EAAaA,EAAO,KAAK,CAAM,CAAC,EAAe,GAAmBC,EAAS,EAAE,CAAM,CAAC,EAAe,GAAmBA,EAAS,EAAE,CAAO,EAASD,EAAO,EAAE,CAAC,CACjT,EAAWE,MAAY,EAAM,OAAO,GAAM,EAAK,IAAI,CAAC,CAAC,EAAM,CAAC,CAClE,MAAc,CAAC,GAAG,CAAC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