How to use the velocity-animate.RunSequence function in velocity-animate

To help you get started, we’ve selected a few velocity-animate examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github aurelia / animator-velocity / dist / native-modules / aurelia-animator-velocity.js View on Github external
return new Promise(function (resolve, reject) {
      _this2.sequenceReject = resolve;
      var last = sequence[sequence.length - 1];
      last.options = last.options || last.o || {};
      last.options.complete = function () {
        if (!_this2.sequenceReject) return;
        _this2.sequenceReject = undefined;
        dispatch(PLATFORM.global, 'sequenceDone');
        resolve();
      };
      try {
        velocity.RunSequence(sequence);
      } catch (e) {
        _this2.stopSequence(sequence);
        _this2.sequenceReject(e);
      }
    });
  };
github reactioncommerce / reaction / imports / plugins / included / product-variant / components / variantForm.js View on Github external
animateFieldFlash(fieldName) {
    const fieldRef = this.refs[`${fieldName}Input`];

    if (fieldRef) {
      const { input } = fieldRef.refs;
      const isFieldValid = this.props.validation.isFieldValid(fieldName);
      const flashColor = isFieldValid ? "#f0fff4" : "#ffeeef";

      Velocity.RunSequence([
        { e: input, p: { backgroundColor: flashColor }, o: { duration: 200 } },
        { e: input, p: { backgroundColor: "#fff" }, o: { duration: 100 } }
      ]);
    }
  }
github aurelia / animator-velocity / dist / aurelia-animator-velocity.js View on Github external
return new Promise((resolve, reject) => {
      this.sequenceReject = resolve;
      let last = sequence[sequence.length - 1];
      last.options = last.options || last.o || {};
      last.options.complete = ()=> {
        if (!this.sequenceReject) return;
        this.sequenceReject = undefined;
        dispatch(PLATFORM.global, 'sequenceDone');
        resolve();
      };
      try {
        velocity.RunSequence(sequence); //eslint-disable-line
      } catch (e) {
        this.stopSequence(sequence);
        this.sequenceReject(e);
      }
    });
  }
github aurelia / animator-velocity / src / animator.js View on Github external
return new Promise((resolve, reject) => {
      this.sequenceReject = resolve;
      let last = sequence[sequence.length - 1];
      last.options = last.options || last.o || {};
      last.options.complete = ()=> {
        if (!this.sequenceReject) return;
        this.sequenceReject = undefined;
        dispatch(PLATFORM.global, 'sequenceDone');
        resolve();
      };
      try {
        velocity.RunSequence(sequence); //eslint-disable-line
      } catch (e) {
        this.stopSequence(sequence);
        this.sequenceReject(e);
      }
    });
  }
github reactioncommerce / reaction / imports / plugins / included / product-detail-simple / client / components / productField.js View on Github external
}, () => {
        if (this._input && this._input.refs.input) {
          const { input } = this._input.refs;

          Velocity.RunSequence([
            { e: input, p: { backgroundColor: "#e2f2e2" }, o: { duration: 200 } },
            { e: input, p: { backgroundColor: "#fff" }, o: { duration: 100 } }
          ]);
        }
      });
    } else {
github aurelia / animator-velocity / dist / es2015 / aurelia-animator-velocity.js View on Github external
return new Promise((resolve, reject) => {
      this.sequenceReject = resolve;
      let last = sequence[sequence.length - 1];
      last.options = last.options || last.o || {};
      last.options.complete = () => {
        if (!this.sequenceReject) return;
        this.sequenceReject = undefined;
        dispatch(PLATFORM.global, 'sequenceDone');
        resolve();
      };
      try {
        velocity.RunSequence(sequence);
      } catch (e) {
        this.stopSequence(sequence);
        this.sequenceReject(e);
      }
    });
  }
github reactioncommerce / reaction / imports / plugins / core / ui / client / components / tags / tag.jsx View on Github external
componentWillReceiveProps(nextProps) {
    if (this._updated && this._saved && this.refs.autoSuggestInput) {
      const input = this.refs.autoSuggestInput.input;

      Velocity.RunSequence([
        { e: input, p: { backgroundColor: "#e2f2e2" }, o: { duration: 200 } },
        { e: input, p: { backgroundColor: "#fff" }, o: { duration: 100 } }
      ]);

      this._updated = false;
    }

    if ((nextProps.tag.name !== this.props.tag.name)) {
      this._updated = true;
    }
  }