{"version":3,"file":"Counter.CZ7l0TeD.mjs","names":[],"sources":["https:/framerusercontent.com/modules/tImu65t3njqVxN1EokmF/yqsFcz266bViEy65tnNy/Counter.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,background}){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,background},children:rounded});}AnimatedCounter.defaultProps={from:0,to:15,duration:2.5,fontFamily:\"Arial\",fontWeight:700,fontSize:24,color:\"#000000\",background:\"linear-gradient(158deg, #9061F9 0%, #BF61F9 100%))\"};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:\"Arial\"},fontWeight:{type:ControlType.Number,title:\"Font Weight\",defaultValue:700},fontSize:{type:ControlType.Number,title:\"Font Size\",defaultValue:24,min:12,max:72,step:1},color:{type:ControlType.Color,title:\"Color\",defaultValue:\"#000000\"},background:{type:ControlType.Color,title:\"Background\",defaultValue:\"linear-gradient(158deg, #9061F9 0%, #BF61F9 100%))\"}});export default AnimatedCounter;\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"AnimatedCounter\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__Fram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