{"version":3,"file":"RunningLine.RJewA0VO.mjs","names":["useMemo"],"sources":["https:/framerusercontent.com/modules/UnvfcEHBQX0Cev1MbLWT/rLyRf2hoS8DDZNPmxmLT/RunningLine.js"],"sourcesContent":["// Infinity running line with grey texts\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{motion}from\"framer-motion\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";import{useMemo}from\"react\";/**\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight auto\n */export default function RunningLine(props){const{texts,speed,textColor,backgroundColor,font,gap}=props;const isStatic=useIsStaticRenderer();const animationDuration=useMemo(()=>{return 60/speed;},[speed]);const repeatedText=useMemo(()=>{return Array(20).fill(texts).flat();},[texts]);const renderTexts=textArray=>{return textArray.map((text,index)=>/*#__PURE__*/_jsx(\"span\",{style:{marginRight:`${gap}px`},children:text},index));};if(isStatic){return /*#__PURE__*/_jsx(\"div\",{style:{width:\"100%\",height:\"100%\",backgroundColor,overflow:\"hidden\",display:\"flex\",alignItems:\"center\",position:\"relative\"},children:/*#__PURE__*/_jsx(\"div\",{style:{color:textColor,whiteSpace:\"nowrap\",...font,display:\"flex\"},children:renderTexts(repeatedText)})});}return /*#__PURE__*/_jsx(\"div\",{style:{width:\"100%\",height:\"100%\",backgroundColor,overflow:\"hidden\",display:\"flex\",alignItems:\"center\",position:\"relative\"},children:/*#__PURE__*/_jsx(motion.div,{style:{display:\"flex\",whiteSpace:\"nowrap\",color:textColor,...font},animate:{x:[0,-1e3]},transition:{duration:animationDuration,repeat:Infinity,ease:\"linear\"},children:renderTexts(repeatedText)})});}addPropertyControls(RunningLine,{texts:{type:ControlType.Array,title:\"Texts\",control:{type:ControlType.String,placeholder:\"Enter text...\"},defaultValue:[\"Running text\",\"Another text\",\"More text\"],maxCount:10},speed:{type:ControlType.Number,title:\"Speed\",defaultValue:1,min:.1,max:5,step:.1},textColor:{type:ControlType.Color,title:\"Text Color\",defaultValue:\"#CCCCCC\"},backgroundColor:{type:ControlType.Color,title:\"Background\",defaultValue:\"#FFFFFF\"},font:{type:ControlType.Font,title:\"Font\",defaultValue:{fontSize:\"15px\",variant:\"Medium\",letterSpacing:\"-0.01em\",lineHeight:\"1.3em\"},controls:\"extended\",defaultFontType:\"sans-serif\"},gap:{type:ControlType.Number,title:\"Text Gap\",defaultValue:20,min:0,max:100,step:1,unit:\"px\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"RunningLine\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"auto\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./RunningLine.map"],"mappings":"mOAIG,SAAwB,EAAY,EAAM,CAAC,GAAK,CAAC,QAAM,QAAM,YAAU,kBAAgB,OAAK,OAAK,EAAY,EAAS,EAAoB,EAAQ,EAAkBA,MAAoB,GAAG,EAAQ,CAAC,CAAK,CAAC,EAAQ,EAAaA,MAAoB,MAAM,EAAE,CAAC,CAAC,KAAK,CAAK,CAAC,CAAC,KAAK,EAAI,CAAC,CAAK,CAAC,EAAQ,EAAY,GAAmB,EAAU,KAAK,EAAK,IAAqB,EAAK,OAAO,CAAC,MAAM,CAAC,YAAY,GAAG,EAAI,GAAG,EAAE,SAAS,CAAI,EAAE,CAAK,CAAC,EAA0T,OAAnT,EAA8B,EAAK,MAAM,CAAC,MAAM,CAAC,MAAM,OAAO,OAAO,OAAO,kBAAgB,SAAS,SAAS,QAAQ,OAAO,WAAW,SAAS,SAAS,UAAU,EAAE,SAAsB,EAAK,MAAM,CAAC,MAAM,CAAC,MAAM,EAAU,WAAW,SAAS,GAAG,EAAK,QAAQ,MAAM,EAAE,SAAS,EAAY,CAAY,CAAC,CAAC,CAAC,CAAC,EAAuB,EAAK,MAAM,CAAC,MAAM,CAAC,MAAM,OAAO,OAAO,OAAO,kBAAgB,SAAS,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