{"version":3,"file":"Number_Animator.CE3rRfZP.mjs","names":["useRef"],"sources":["https:/framerusercontent.com/modules/3Sw7RHYdJFMzUv0MtmVP/BKunAAvSG8ddrDzFftUW/Number_Animator.js"],"sourcesContent":["/**\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight any\n */import{jsx as _jsx}from\"react/jsx-runtime\";import{animate,motion,useInView,useMotionValue,useTransform}from\"framer-motion\";import{useEffect,useRef}from\"react\";import{addPropertyControls,ControlType}from\"framer\";function AnimatedCounter({from,to,duration,fontFamily,fontWeight,fontSize,color}){const count=useMotionValue(from);const rounded=useTransform(count,latest=>{return Math.round(latest);});const ref=useRef(null);const inView=useInView(ref);// while in view animate the count\nuseEffect(()=>{if(inView){animate(count,to,{duration});}},[count,inView,to,duration]);return /*#__PURE__*/_jsx(motion.span,{ref:ref,style:{fontFamily,fontWeight,fontSize,color},children:rounded});}AnimatedCounter.defaultProps={from:0,to:15,duration:2.5,fontFamily:\"Poppins\",fontWeight:900,fontSize:36,color:\"#000000\"};addPropertyControls(AnimatedCounter,{from:{type:ControlType.Number,title:\"From\",defaultValue:0,min:0,step:1},to:{type:ControlType.Number,title:\"To\",defaultValue:15,min:0,step:1},duration:{type:ControlType.Number,title:\"Duration\",defaultValue:2.5,min:0,step:.1,displayStepper:true},fontFamily:{type:ControlType.String,title:\"Font Family\",defaultValue:\"Poppins\"},fontWeight:{type:ControlType.String,title:\"Font Weight\",defaultValue:700},fontSize:{type:ControlType.Number,title:\"Font Size\",defaultValue:36,min:12,max:72,step:1},color:{type:ControlType.Color,title:\"Color\",defaultValue:\"#000000\"}});export default AnimatedCounter;\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"AnimatedCounter\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Number_Animator.map"],"mappings":"8PAGsN,SAAS,EAAgB,CAAC,OAAK,KAAG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