{
  "version": 3,
  "sources": ["ssg:https://framerusercontent.com/modules/pztmAAX1SQ57Lrk4XXUt/paP7RjOiDInNJWlKm4Ta/Smoothcounter.js"],
  "sourcesContent": ["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import*as React from\"react\";import{motion}from\"framer-motion\";import{addPropertyControls,ControlType}from\"framer\";// Code component provided by Eleveight Supply. All rights reserved 2024.\n/**\n * @framerDisableUnlink\n *\n * @framerSupportedLayoutWidth 100%\n * @framerSupportedLayoutHeight 100%\n */export default function SmoothCounter(props){const{start,end,font,fontProps,trigger,lineHeight,transition,label,labelPosition,loop,loopDelay,padding,useMask}=props;const{Color,Size,letterSpacing,verticalSpacing}=fontProps;const computedLineHeight=lineHeight||(verticalSpacing===0?Size*.9:Size);const computedDigitWidth=Size*.65;const formatNumber=value=>value.toString().split(\"\");const[displayNumber,setDisplayNumber]=React.useState(formatNumber(start));const[hasAnimated,setHasAnimated]=React.useState(false);const numberRef=React.useRef(null);const memoizedDigits=React.useMemo(()=>formatNumber(start),[start]);React.useEffect(()=>{if(trigger===\"inView\"){const observer=new IntersectionObserver(entries=>{entries.forEach(entry=>{if(entry.isIntersecting&&!hasAnimated){setDisplayNumber(formatNumber(end));setHasAnimated(true);}});},{threshold:.1});if(numberRef.current){observer.observe(numberRef.current);}return()=>{if(numberRef.current){observer.unobserve(numberRef.current);}};}else{setDisplayNumber(formatNumber(end));}},[end,hasAnimated,trigger]);const renderScrollingDigits=targetChars=>{const computedPunctuationWidth=computedDigitWidth*.65;return targetChars.map((char,index)=>{// Compute margins as before.\nconst marginRight=index<targetChars.length-1?`${letterSpacing}px`:\"0px\";const marginLeft=letterSpacing<0&&index>0?`${letterSpacing}px`:\"0px\";if(/\\d/.test(char)){const targetDigit=parseInt(char,10);return /*#__PURE__*/_jsx(\"div\",{style:{position:\"relative\",height:`${computedLineHeight}px`,overflow:\"visible\",width:`${computedDigitWidth}px`,display:\"inline-flex\",justifyContent:\"center\",marginRight,marginLeft,willChange:\"transform\",letterSpacing:\"0px\"},children:/*#__PURE__*/_jsx(motion.div,{initial:{translateY:0},animate:{translateY:`-${targetDigit*(computedLineHeight+verticalSpacing)}px`},transition:{...transition,repeat:loop?Infinity:0,repeatType:\"mirror\",repeatDelay:loopDelay},style:{display:\"flex\",flexDirection:\"column\",willChange:\"transform\"},children:Array.from({length:10}).map((_,i)=>/*#__PURE__*/_jsx(\"div\",{style:{height:`${computedLineHeight}px`,display:\"flex\",alignItems:\"center\",justifyContent:\"center\",fontSize:`${Size}px`,lineHeight:`${computedLineHeight}px`,color:Color,...font,marginBottom:verticalSpacing>0?`${verticalSpacing}px`:\"0px\",letterSpacing:\"0px\"},children:i},i))},`${index}-${targetDigit}`)},index);}else{return /*#__PURE__*/_jsx(\"div\",{style:{height:`${computedLineHeight}px`,width:`${computedPunctuationWidth}px`,display:\"inline-flex\",alignItems:\"center\",justifyContent:\"center\",fontSize:`${Size}px`,lineHeight:`${computedLineHeight}px`,color:Color,...font,marginRight,marginLeft,letterSpacing:\"0px\"},children:char},index);}});};const dynamicStyle={fontSize:`${Size}px`,fontFeatureSettings:\"'tnum'\",fontVariantNumeric:\"lining-nums\",display:\"inline-flex\",flexDirection:\"row\",lineHeight:`${computedLineHeight}px`,color:Color,...font,userSelect:\"none\",letterSpacing:\"px\"};const outerContainerStyle={position:\"relative\",display:\"inline-block\",overflow:\"hidden\",paddingTop:useMask?`${padding}px`:\"0px\",paddingBottom:useMask?`${padding}px`:\"0px\",...useMask&&{WebkitMaskImage:`linear-gradient(to bottom, transparent 5%, black 25%, black 75%, transparent 95%)`,maskImage:`linear-gradient(to bottom, transparent 5%, black 25%, black 75%, transparent 95%)`}};return /*#__PURE__*/_jsx(\"div\",{style:outerContainerStyle,children:/*#__PURE__*/_jsxs(\"div\",{ref:numberRef,style:dynamicStyle,children:[labelPosition===\"Before\"&&label,renderScrollingDigits(displayNumber),labelPosition===\"After\"&&label]})});}SmoothCounter.defaultProps={start:\"00\",end:\"1,234\",font:{family:\"Inter\",weight:400,style:\"normal\",fontSize:40},fontProps:{Color:\"#929292\",Size:40,letterSpacing:-2,verticalSpacing:0},trigger:\"onAppear\",transition:{type:\"tween\",ease:[.5,.02,.16,.99],duration:3.2},label:\"\",labelPosition:\"After\",loop:false,loopDelay:0,padding:7,useMask:false};addPropertyControls(SmoothCounter,{font:{type:ControlType.Font,title:\"Font\",defaultValue:\"Inter\"},fontProps:{type:ControlType.Object,title:\"Font Props\",controls:{Color:{type:ControlType.Color,title:\"Color\",defaultValue:\"#929292\"},Size:{type:ControlType.Number,title:\"Size\",defaultValue:40,min:8,max:500,step:1,displayStepper:true},letterSpacing:{type:ControlType.Number,title:\"Letter\",defaultValue:-2,min:-50,max:100,step:1,displayStepper:true},verticalSpacing:{type:ControlType.Number,title:\"Line\",defaultValue:0,min:0,max:50,step:1,displayStepper:true}}},start:{type:ControlType.String,title:\"Start\",defaultValue:SmoothCounter.defaultProps.start},end:{type:ControlType.String,title:\"End\",defaultValue:SmoothCounter.defaultProps.end},trigger:{type:ControlType.Enum,title:\"Trigger\",options:[\"onAppear\",\"inView\"],optionTitles:[\"On Appear\",\"In View\"],defaultValue:\"onAppear\",displaySegmentedControl:true,segmentedControlDirection:\"vertical\"},transition:{type:ControlType.Transition,title:\"Transition\",defaultValue:{type:\"tween\",ease:[.5,.02,.16,.99],duration:3.2}},label:{type:ControlType.String,title:\"Label\",defaultValue:\"\",placeholder:\"ex: %,+,etc...\"},labelPosition:{type:ControlType.SegmentedEnum,title:\"Label\",options:[\"Before\",\"After\"],optionTitles:[\"Before\",\"After\"],defaultValue:\"After\"},loop:{type:ControlType.Boolean,title:\"Loop\",defaultValue:false,enabledTitle:\"Yes\",disabledTitle:\"No\"},loopDelay:{type:ControlType.Number,title:\"Delay\",defaultValue:0,min:0,max:10,step:.1,unit:\"s\",hidden:({loop})=>!loop},useMask:{type:ControlType.Boolean,title:\"Gradient\",defaultValue:SmoothCounter.defaultProps.useMask,enabledTitle:\"Yes\",disabledTitle:\"No\"},padding:{type:ControlType.Number,title:\"Cut-off\",defaultValue:SmoothCounter.defaultProps.padding,min:0,max:100,step:1,displayStepper:true,hidden:({useMask})=>!useMask}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"SmoothCounter\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"100%\",\"framerSupportedLayoutWidth\":\"100%\",\"framerDisableUnlink\":\"*\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Smoothcounter.map"],
  "mappings": "mGAMkB,SAARA,EAA+BC,EAAM,CAAC,GAAK,CAAC,MAAAC,EAAM,IAAAC,EAAI,KAAAC,EAAK,UAAAC,EAAU,QAAAC,EAAQ,WAAAC,EAAW,WAAAC,EAAW,MAAAC,EAAM,cAAAC,EAAc,KAAAC,EAAK,UAAAC,EAAU,QAAAC,EAAQ,QAAAC,CAAO,EAAEb,EAAW,CAAC,MAAAc,EAAM,KAAAC,EAAK,cAAAC,EAAc,gBAAAC,CAAe,EAAEb,EAAgBc,EAAmBZ,IAAaW,IAAkB,EAAEF,EAAK,GAAGA,GAAYI,EAAmBJ,EAAK,IAAUK,EAAaC,GAAOA,EAAM,SAAS,EAAE,MAAM,EAAE,EAAO,CAACC,EAAcC,CAAgB,EAAQC,EAASJ,EAAanB,CAAK,CAAC,EAAO,CAACwB,EAAYC,CAAc,EAAQF,EAAS,EAAK,EAAQG,EAAgBC,EAAO,IAAI,EAAQC,EAAqBC,EAAQ,IAAIV,EAAanB,CAAK,EAAE,CAACA,CAAK,CAAC,EAAQ8B,EAAU,IAAI,CAAC,GAAG1B,IAAU,SAAS,CAAC,IAAM2B,EAAS,IAAI,qBAAqBC,GAAS,CAACA,EAAQ,QAAQC,GAAO,CAAIA,EAAM,gBAAgB,CAACT,IAAaF,EAAiBH,EAAalB,CAAG,CAAC,EAAEwB,EAAe,EAAI,EAAG,CAAC,CAAE,EAAE,CAAC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OAAO,MAAM,QAAQ,aAAa,GAAG,YAAY,gBAAgB,EAAE,cAAc,CAAC,KAAKA,EAAY,cAAc,MAAM,QAAQ,QAAQ,CAAC,SAAS,OAAO,EAAE,aAAa,CAAC,SAAS,OAAO,EAAE,aAAa,OAAO,EAAE,KAAK,CAAC,KAAKA,EAAY,QAAQ,MAAM,OAAO,aAAa,GAAM,aAAa,MAAM,cAAc,IAAI,EAAE,UAAU,CAAC,KAAKA,EAAY,OAAO,MAAM,QAAQ,aAAa,EAAE,IAAI,EAAE,IAAI,GAAG,KAAK,GAAG,KAAK,IAAI,OAAO,CAAC,CAAC,KAAAzC,CAAI,IAAI,CAACA,CAAI,EAAE,QAAQ,CAAC,KAAKyC,EAAY,QAAQ,MAAM,WAAW,aAAapD,EAAc,aAAa,QAAQ,aAAa,MAAM,cAAc,IAAI,EAAE,QAAQ,CAAC,KAAKoD,EAAY,OAAO,MAAM,UAAU,aAAapD,EAAc,aAAa,QAAQ,IAAI,EAAE,IAAI,IAAI,KAAK,EAAE,eAAe,GAAK,OAAO,CAAC,CAAC,QAAAc,CAAO,IAAI,CAACA,CAAO,CAAC,CAAC",
  "names": ["SmoothCounter", "props", "start", "end", "font", "fontProps", "trigger", "lineHeight", "transition", "label", "labelPosition", "loop", "loopDelay", "padding", "useMask", "Color", "Size", "letterSpacing", "verticalSpacing", "computedLineHeight", "computedDigitWidth", "formatNumber", "value", "displayNumber", "setDisplayNumber", "ye", "hasAnimated", "setHasAnimated", "numberRef", "pe", "memoizedDigits", "se", "ue", "observer", "entries", "entry", "renderScrollingDigits", "targetChars", "computedPunctuationWidth", "char", "index", "marginRight", "marginLeft", "targetDigit", "p", "motion", "_", "i", "dynamicStyle", "outerContainerStyle", "u", "addPropertyControls", "ControlType"]
}
