{"version":3,"file":"NumberCounter.CZ7aEYlI.mjs","names":["useState","useRef","useMemo"],"sources":["https:/framerusercontent.com/modules/wRJRoNJPKbcShwGZyitG/Ig4P9vfjyXpBIystTltU/NumberCounter.js"],"sourcesContent":["// Number counter from 1 to 5000 with speed, font style, color, size adjustments\n// Starts from 1 and repeats after reaching the end\n// Configurable starting and ending numbers\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useState,useRef,startTransition,useMemo}from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n */export default function NumberCounter(props){const{startNumber=1,endNumber=5e3,speed=50,color=\"#000000\",useGradient=false,gradientStartColor=\"#000000\",gradientEndColor=\"#555555\",gradientDirection=\"90deg\",font,style}=props;const[currentNumber,setCurrentNumber]=useState(startNumber);const intervalRef=useRef(null);useEffect(()=>{if(intervalRef.current!==null&&typeof window!==\"undefined\"){clearInterval(intervalRef.current);}startTransition(()=>setCurrentNumber(startNumber));if(typeof window!==\"undefined\"){intervalRef.current=window.setInterval(()=>{startTransition(()=>{setCurrentNumber(prev=>{if(prev>=endNumber){return startNumber;}return prev+1;});});},speed);}return()=>{if(intervalRef.current!==null&&typeof window!==\"undefined\"){clearInterval(intervalRef.current);}};},[startNumber,endNumber,speed]);const textStyle=useMemo(()=>{if(useGradient){return{backgroundImage:`linear-gradient(${gradientDirection}, ${gradientStartColor}, ${gradientEndColor})`,WebkitBackgroundClip:\"text\",WebkitTextFillColor:\"transparent\",color:\"transparent\"};}return{color:color};},[useGradient,gradientStartColor,gradientEndColor,gradientDirection,color]);return /*#__PURE__*/_jsx(\"div\",{style:{...style,position:\"relative\",width:\"max-content\",minWidth:\"max-content\",...textStyle,...font},children:currentNumber});}addPropertyControls(NumberCounter,{startNumber:{type:ControlType.Number,title:\"Start Number\",defaultValue:100,min:0,max:1e4,step:1,displayStepper:true},endNumber:{type:ControlType.Number,title:\"End Number\",defaultValue:1e3,min:1,max:1e4,step:1,displayStepper:true},speed:{type:ControlType.Number,title:\"Speed\",defaultValue:50,min:.1,max:1e3,step:.1,unit:\"ms\"},color:{type:ControlType.Color,title:\"Color\",defaultValue:\"#000000\"},useGradient:{type:ControlType.Boolean,title:\"Use Gradient\",defaultValue:false,enabledTitle:\"On\",disabledTitle:\"Off\"},gradientStartColor:{type:ControlType.Color,title:\"Gradient Start\",defaultValue:\"#000000\",hidden:props=>!props.useGradient},gradientEndColor:{type:ControlType.Color,title:\"Gradient End\",defaultValue:\"#555555\",hidden:props=>!props.useGradient},gradientDirection:{type:ControlType.Enum,title:\"Gradient Dir\",options:[\"0deg\",\"90deg\",\"180deg\",\"270deg\"],optionTitles:[\"Top to Bottom\",\"Left to Right\",\"Bottom to Top\",\"Right to Left\"],defaultValue:\"90deg\",hidden:props=>!props.useGradient},font:{type:ControlType.Font,title:\"Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"40px\",variant:\"Bold\",letterSpacing:\"-0.04em\",lineHeight:\"1em\"}}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"NumberCounter\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"auto\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"auto\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./NumberCounter.map"],"mappings":"qNAMG,SAAwB,EAAc,EAAM,CAAC,GAAK,CAAC,cAAY,EAAE,YAAU,IAAI,QAAM,GAAG,QAAM,UAAU,cAAY,GAAM,qBAAmB,UAAU,mBAAiB,UAAU,oBAAkB,QAAQ,OAAK,SAAO,EAAW,CAAC,EAAc,GAAkBA,EAAS,EAAY,CAAO,EAAYC,EAAO,KAAK,CAAC,OAAkB,EAAY,UAAU,MAAa,IAAS,QAAa,cAAc,EAAY,QAAQ,CAAE,MAAoB,EAAiB,EAAY,CAAC,CAAW,IAAS,SAAa,EAAY,QAAQ,EA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