fabric
Version:
Object model for HTML5 canvas, and SVG-to-canvas parser. Backed by jsdom and node-canvas.
1 lines • 1.58 kB
Source Map (JSON)
{"version":3,"file":"ValueAnimation.mjs","sources":["../../../../src/util/animation/ValueAnimation.ts"],"sourcesContent":["import { AnimationBase } from './AnimationBase';\nimport type { ValueAnimationOptions } from './types';\n\nexport class ValueAnimation extends AnimationBase<number> {\n constructor({\n startValue = 0,\n endValue = 100,\n ...otherOptions\n }: ValueAnimationOptions) {\n super({\n ...otherOptions,\n startValue,\n byValue: endValue - startValue,\n });\n }\n\n protected calculate(timeElapsed: number) {\n const value = this.easing(\n timeElapsed,\n this.startValue,\n this.byValue,\n this.duration,\n );\n return {\n value,\n valueProgress: Math.abs((value - this.startValue) / this.byValue),\n };\n }\n}\n"],"names":["ValueAnimation","AnimationBase","constructor","_ref","startValue","endValue","otherOptions","byValue","calculate","timeElapsed","value","easing","duration","valueProgress","Math","abs"],"mappings":";;AAGO,MAAMA,cAAc,SAASC,aAAa,CAAS;EACxDC,WAAWA,CAAAC,IAAA,EAIe;IAAA,IAJd;AACVC,MAAAA,UAAU,GAAG,CAAC;AACdC,MAAAA,QAAQ,GAAG,GAAG;MACd,GAAGC;AACkB,KAAC,GAAAH,IAAA;AACtB,IAAA,KAAK,CAAC;AACJ,MAAA,GAAGG,YAAY;MACfF,UAAU;MACVG,OAAO,EAAEF,QAAQ,GAAGD;AACtB,KAAC,CAAC;AACJ,EAAA;EAEUI,SAASA,CAACC,WAAmB,EAAE;AACvC,IAAA,MAAMC,KAAK,GAAG,IAAI,CAACC,MAAM,CACvBF,WAAW,EACX,IAAI,CAACL,UAAU,EACf,IAAI,CAACG,OAAO,EACZ,IAAI,CAACK,QACP,CAAC;IACD,OAAO;MACLF,KAAK;AACLG,MAAAA,aAAa,EAAEC,IAAI,CAACC,GAAG,CAAC,CAACL,KAAK,GAAG,IAAI,CAACN,UAAU,IAAI,IAAI,CAACG,OAAO;KACjE;AACH,EAAA;AACF;;;;"}