{"version":3,"file":"TextTicker_1.DNetp2m8.mjs","names":["useRef","useState","startTransition"],"sources":["https:/framerusercontent.com/modules/GZKKSNF1fZwJgmgD8Zmh/xccP6qJ6IcHFk7e13DEX/TextTicker_1.js"],"sourcesContent":["// Text ticker component that scrolls text horizontally in a continuous loop\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useEffect,useRef,useState,startTransition}from\"react\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";import{useAnimationFrame}from\"framer-motion\";/**\n * @framerIntrinsicWidth 400\n * @framerIntrinsicHeight 50\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */export default function TextTicker(props){const{text1=\"Breaking News\",text2=\"Latest Updates\",text3=\"Important Information\",text4=\"Stay Informed\",text5=\"More Updates\",text6=\"Keep Watching\",speed=50,gap=40,textColor=\"#000000\",backgroundColor=\"#FFFFFF\",font,enableHoverEffect=true,hoverIntensity=.3}=props;const containerRef=useRef(null);const textRef=useRef(null);const[offset,setOffset]=useState(0);const[textWidth,setTextWidth]=useState(0);const[isHovered,setIsHovered]=useState(false);const isStatic=useIsStaticRenderer();useEffect(()=>{if(textRef.current){startTransition(()=>{setTextWidth(textRef.current.offsetWidth);});}},[text1,text2,text3,text4,text5,text6,font,gap]);useAnimationFrame((time,delta)=>{if(isStatic||textWidth===0)return;startTransition(()=>{setOffset(prevOffset=>{const currentSpeed=enableHoverEffect&&isHovered?speed*hoverIntensity:speed;const newOffset=prevOffset+currentSpeed*delta/1e3;return newOffset>=textWidth?0:newOffset;});});});return /*#__PURE__*/_jsx(\"div\",{ref:containerRef,style:{width:\"100%\",height:\"100%\",minHeight:\"50px\",backgroundColor,overflow:\"hidden\",position:\"relative\",display:\"flex\",alignItems:\"center\"},onMouseEnter:()=>enableHoverEffect&&startTransition(()=>setIsHovered(true)),onMouseLeave:()=>enableHoverEffect&&startTransition(()=>setIsHovered(false)),children:/*#__PURE__*/_jsxs(\"div\",{style:{display:\"flex\",position:\"absolute\",whiteSpace:\"nowrap\",willChange:\"transform\",transform:`translateX(-${offset}px)`},children:[/*#__PURE__*/_jsxs(\"div\",{ref:textRef,style:{display:\"flex\"},children:[/*#__PURE__*/_jsx(\"span\",{style:{color:textColor,...font,marginRight:gap},children:text1}),/*#__PURE__*/_jsx(\"span\",{style:{color:textColor,...font,marginRight:gap},children:text2}),/*#__PURE__*/_jsx(\"span\",{style:{color:textColor,...font,marginRight:gap},children:text3}),/*#__PURE__*/_jsx(\"span\",{style:{color:textColor,...font,marginRight:gap},children:text4}),/*#__PURE__*/_jsx(\"span\",{style:{color:textColor,...font,marginRight:gap},children:text5}),/*#__PURE__*/_jsx(\"span\",{style:{color:textColor,...font,marginRight:gap},children:text6})]}),/*#__PURE__*/_jsxs(\"div\",{style:{display:\"flex\"},children:[/*#__PURE__*/_jsx(\"span\",{style:{color:textColor,...font,marginRight:gap},children:text1}),/*#__PURE__*/_jsx(\"span\",{style:{color:textColor,...font,marginRight:gap},children:text2}),/*#__PURE__*/_jsx(\"span\",{style:{color:textColor,...font,marginRight:gap},children:text3}),/*#__PURE__*/_jsx(\"span\",{style:{color:textColor,...font,marginRight:gap},children:text4}),/*#__PURE__*/_jsx(\"span\",{style:{color:textColor,...font,marginRight:gap},children:text5}),/*#__PURE__*/_jsx(\"span\",{style:{color:textColor,...font,marginRight:gap},children:text6})]}),/*#__PURE__*/_jsxs(\"div\",{style:{display:\"flex\"},children:[/*#__PURE__*/_jsx(\"span\",{style:{color:textColor,...font,marginRight:gap},children:text1}),/*#__PURE__*/_jsx(\"span\",{style:{color:textColor,...font,marginRight:gap},children:text2}),/*#__PURE__*/_jsx(\"span\",{style:{color:textColor,...font,marginRight:gap},children:text3}),/*#__PURE__*/_jsx(\"span\",{style:{color:textColor,...font,marginRight:gap},children:text4}),/*#__PURE__*/_jsx(\"span\",{style:{color:textColor,...font,marginRight:gap},children:text5}),/*#__PURE__*/_jsx(\"span\",{style:{color:textColor,...font,marginRight:gap},children:text6})]})]})});}addPropertyControls(TextTicker,{text1:{type:ControlType.String,title:\"Text 1\",defaultValue:\"Breaking News\"},text2:{type:ControlType.String,title:\"Text 2\",defaultValue:\"Latest Updates\"},text3:{type:ControlType.String,title:\"Text 3\",defaultValue:\"Important Information\"},text4:{type:ControlType.String,title:\"Text 4\",defaultValue:\"Stay Informed\"},text5:{type:ControlType.String,title:\"Text 5\",defaultValue:\"More Updates\"},text6:{type:ControlType.String,title:\"Text 6\",defaultValue:\"Keep Watching\"},speed:{type:ControlType.Number,title:\"Speed\",defaultValue:50,min:10,max:200,step:10},enableHoverEffect:{type:ControlType.Boolean,title:\"Hover Effect\",defaultValue:true,enabledTitle:\"On\",disabledTitle:\"Off\"},hoverIntensity:{type:ControlType.Number,title:\"Hover Intensity\",defaultValue:.3,min:0,max:2,step:.1,hidden:({enableHoverEffect})=>!enableHoverEffect},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\"},backgroundColor:{type:ControlType.Color,title:\"Background\",defaultValue:\"#FFFFFF\"},font:{type:ControlType.Font,title:\"Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"15px\",variant:\"Medium\",letterSpacing:\"-0.01em\",lineHeight:\"1.3em\"}}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"TextTicker\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerIntrinsicWidth\":\"400\",\"framerContractVersion\":\"1\",\"framerIntrinsicHeight\":\"50\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./TextTicker_1.map"],"mappings":"gQAMG,SAAwB,EAAW,EAAM,CAAC,GAAK,CAAC,QAAM,gBAAgB,QAAM,iBAAiB,QAAM,wBAA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