UNPKG

@visactor/vrender-animate

Version:

This module provides a graph-based animation system for VRender.

26 lines (24 loc) 1 kB
import { Step } from "../step"; export class ACustomAnimate extends Step { constructor(customFrom, customTo, duration, easing, params) { super("customAnimate", customTo, duration, easing), this.type = "customAnimate", this.customFrom = customFrom, this.params = params, this.from = customFrom, this.to = customTo; } update(end, ratio, out) { if (this.onStart(), !this.props || !this.propKeys) return; const easedRatio = this.easing(ratio); this.onUpdate(end, easedRatio, out), this.syncAttributeUpdate(); } setProps(props) { this.props = props, this.propKeys = Object.keys(props), this.animate.reSyncProps(); } } export class AComponentAnimate extends ACustomAnimate { completeBind(animator) { this.setStartTime(0), this._animator && this._animator.start(), this.setDuration(animator.getDuration()); } stop() { this._animator && this._animator.stop(); } } //# sourceMappingURL=custom-animate.js.map