{"version":3,"file":"CounterText.BEdUQLW5.mjs","names":["useRef"],"sources":["https:/framerusercontent.com/modules/mHW9Qn74nawyGQhZSSNn/ofz2lblYWFpxwq7HfbFl/CounterText.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,fontSize,fontWeight,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,fontSize,fontWeight,color},children:rounded});}AnimatedCounter.defaultProps={from:0,to:15,duration:2.5,fontFamily:\"Inter\",fontSize:24,fontWeight:400,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:-200,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:\"Inter\"},fontSize:{type:ControlType.Number,title:\"Font Size\",defaultValue:24,min:12,max:300,step:1},fontWeight:{type:ControlType.Number,title:\"Font Weight\",defaultValue:400,min:100,max:900,step:100},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=./CounterText.map"],"mappings":"4ZAGuN,SAAS,EAAgB,CAAC,O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