{"version":3,"file":"MarqueeText.DmmS2zbs.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/QPfb7g8bcgGCTPCXW4Mt/wX0D10rqkqoyfAnzzZJP/MarqueeText.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{motion}from\"framer-motion\";import{useEffect,useState,startTransition}from\"react\";/**\n * Horizontal scrolling text component with customizable speed and gap\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight auto\n */export default function MarqueeText(props){const{text=\"Scrolling Text • \",speed=50,gap=40,textColor=\"#000000\",font}=props;const[containerWidth,setContainerWidth]=useState(0);const[textWidth,setTextWidth]=useState(0);useEffect(()=>{if(typeof window===\"undefined\")return;const measureText=()=>{const canvas=document.createElement(\"canvas\");const context=canvas.getContext(\"2d\");if(!context)return;context.font=`${font.fontWeight||400} ${font.fontSize||\"15px\"} ${font.fontFamily||\"Inter\"}`;const metrics=context.measureText(text);startTransition(()=>setTextWidth(metrics.width+gap));};measureText();},[text,font,gap]);const duration=textWidth/speed;return /*#__PURE__*/_jsx(\"div\",{style:{...props.style,position:\"relative\",width:\"100%\",overflow:\"hidden\",display:\"flex\",alignItems:\"center\"},children:/*#__PURE__*/_jsx(motion.div,{style:{display:\"flex\",whiteSpace:\"nowrap\",gap:`${gap}px`},animate:{x:[0,-textWidth]},transition:{duration:duration,repeat:Infinity,ease:\"linear\",repeatType:\"loop\"},children:[...Array(20)].map((_,i)=>/*#__PURE__*/_jsx(\"span\",{style:{color:textColor,...font},children:text},i))})});}addPropertyControls(MarqueeText,{text:{type:ControlType.String,title:\"Text\",defaultValue:\"Scrolling Text • \"},speed:{type:ControlType.Number,title:\"Speed\",defaultValue:50,min:10,max:200,step:10},gap:{type:ControlType.Number,title:\"Gap\",defaultValue:40,min:0,max:200,step:10,unit:\"px\"},textColor:{type:ControlType.Color,title:\"Text Color\",defaultValue:\"#000000\"},font:{type:ControlType.Font,title:\"Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"32px\",variant:\"Semibold\",letterSpacing:\"-0.03em\",lineHeight:\"1em\"}}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"MarqueeText\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"auto\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./MarqueeText.map"],"mappings":"uPAKG,SAAwB,EAAY,EAAM,CAAC,GAAK,CAAC,OAAK,oBAAoB,QAAM,GAAG,MAAI,GAAG,YAAU,UAAU,QAAM,EAAW,CAAC,EAAe,GAAmBA,EAAS,EAAE,CAAM,CAAC,EAAU,GAAcA,EAAS,EAAE,CAAC,MAAc,CAAW,IAAS,aAAyC,CAA+C,IAAM,EAAvC,SAAS,cAAc,SAAS,CAAsB,WAAW,KAAK,CAAC,GAAG,CAAC,EAAQ,OAAO,EAAQ,KAAK,GAAG,EAAK,YAAY,IAAI,GAAG,EAAK,UAAU,OAAO,GAAG,EAAK,YAAY,UAAU,IAAM,EAAQ,EAAQ,YAAY,EAAK,CAAC,MAAoB,EAAa,EAAQ,MAAM,EAAI,CAAC,IAAgB,EAAG,CAAC,EAAK,EAAK,EAAI,CAAC,CAAC,IAAM,EAAS,EAAU,EAAM,OAAoB,EAAK,MAAM,CAAC,MAAM,CAAC,GAAG,EAAM,MAAM,SAAS,WAAW,MAAM,OAAO,SAAS,SAAS,QAAQ,OAAO,WAAW,SAAS,CAAC,SAAsB,EAAK,EAAO,IAAI,CAAC,MAAM,CAAC,QAAQ,OAAO,WAAW,SAAS,IAAI,GAAG,EAAI,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAE,CAAC,EAAU,CAAC,CAAC,WAAW,CAAU,WAAS,OAAO,IAAS,KAAK,SAAS,WAAW,OAAO,CAAC,SAAS,CAAC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