How to use the velocity function in velocity

To help you get started, we’ve selected a few velocity 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 gooy / aurelia-animator-velocity / dist / es6 / animator.js View on Github external
stop(element, clearQueue){
    Velocity(element,'stop',clearQueue);
    this.isAnimating = false;
    return this;
  }
github gooy / aurelia-animator-velocity / src / animator.js View on Github external
reverse(element){
    Velocity(element,'reverse');
    return this;
  }
github ember-animation / ember-animated / addon / growable.js View on Github external
_adaptDimension: function(elt, dimension, have, want) {
    if (have[dimension] === want[dimension]) {
      return Promise.resolve();
    }
    var target = {};
    target['outer'+capitalize(dimension)] = [
      want[dimension],
      have[dimension],
    ];
    return Velocity(elt[0], target, {
      duration: this._durationFor(have[dimension], want[dimension]),
      queue: false,
      easing: this.get('growEasing') || this.constructor.prototype.growEasing
    });
  },
github gooy / aurelia-animator-velocity / src / animator.js View on Github external
rewind(element){
    Velocity(name,'rewind');
    return this;
  }
github gooy / aurelia-animator-velocity / src / animator.js View on Github external
//resolve selectors
    if(typeof element === "string") element = this.container.querySelectorAll(element);

    //if nothing was found or no element was passed resolve the promise immediatly
    if(!element || element.length === 0) return Promise.resolve(element);

    if(!silent) dispatch(element,"animateBegin");

    if(typeof nameOrProps === "string"){
      nameOrProps =  this.resolveEffectAlias(nameOrProps);
      //if(!nameOrProps) Promise.reject(new Error(`effect alias ${nameOrProps} not found`));
    }

    //try to run the animation
    var opts = Object.assign({},this.options,options,overrides);
    var p = Velocity(element, nameOrProps, opts);

    //reject the promise if Velocity didn't return a Promise due to invalid arguments
    if(!p) return Promise.reject(new Error("invalid element used for animator.animate"));
    return p;
  }
github gooy / aurelia-animator-velocity / dist / es6 / animator.js View on Github external
rewind(element){
    Velocity(name,'rewind');
    return this;
  }
github gooy / aurelia-animator-velocity / src / animator.js View on Github external
stop(element, clearQueue){
    Velocity(element,'stop',clearQueue);
    this.isAnimating = false;
    return this;
  }