src/components/animation.js
function () {
    var config = this.config;
    var data = this.data;
    var el = this.el;
    var from;
    var isBoolean;
    var isNumber;
    var to;

    if (this.waitComponentInitRawProperty(this.updateConfigForDefault)) {
      return;
    }

    if (data.from === '') {
      // Infer from.
      from = isRawProperty(data)
        ? getRawProperty(el, data.property)
        : getComponentProperty(el, data.property);
    } else {
      // Explicit from.
      from = data.from;
    }

    to = data.to;

    isNumber = !isNaN(from || to);
    if (isNumber) {
      from = parseFloat(from);
      to = parseFloat(to);
    } else {
      from = from ? from.toString() : from;
      to = to ? to.toString() : to;
    }

    // Convert booleans to integer to allow boolean flipping.
    isBoolean = data.to === 'true' || data.to === 'false' ||
                data.to === true || data.to === false;
    if (isBoolean) {
      from = data.from === 'true' || data.from === true ? 1 : 0;
      to = data.to === 'true' || data.to === true ? 1 : 0;
    }

    this.targets.aframeProperty = from;
    config.targets = this.targets;
    config.aframeProperty = to;
    config.update = (function () {
      var lastValue;

      return function (anim) {
        var value;
        value = anim.animatables[0].target.aframeProperty;

        // Need to do a last value check for animation timeline since all the tweening
        // begins simultaenously even if the value has not changed. Also better for perf
        // anyways.
        if (value === lastValue) { return; }
        lastValue = value;

        if (isBoolean) { value = value >= 1; }

        if (isRawProperty(data)) {
          setRawProperty(el, data.property, value, data.type);
        } else {
          setComponentProperty(el, data.property, value);
        }
      };
    })();
  }
function () {
    var config = this.config;
    var data = this.data;
    var el = this.el;
    var from;
    var isBoolean;
    var isNumber;
    var to;

    if (this.waitComponentInitRawProperty(this.updateConfigForDefault)) {
      return;
    }

    if (data.from === '') {
      // Infer from.
      from = isRawProperty(data)
        ? getRawProperty(el, data.property)
        : getComponentProperty(el, data.property);
    } else {
      // Explicit from.
      from = data.from;
    }

    to = data.to;

    isNumber = !isNaN(from || to);
    if (isNumber) {
      from = parseFloat(from);
      to = parseFloat(to);
    } else {
      from = from ? from.toString() : from;
      to = to ? to.toString() : to;
    }

    // Convert booleans to integer to allow boolean flipping.
    isBoolean = data.to === 'true' || data.to === 'false' ||
                data.to === true || data.to === false;
    if (isBoolean) {
      from = data.from === 'true' || data.from === true ? 1 : 0;
      to = data.to === 'true' || data.to === true ? 1 : 0;
    }

    this.targets.aframeProperty = from;
    config.targets = this.targets;
    config.aframeProperty = to;
    config.update = (function () {
      var lastValue;

      return function (anim) {
        var value;
        value = anim.animatables[0].target.aframeProperty;

        // Need to do a last value check for animation timeline since all the tweening
        // begins simultaenously even if the value has not changed. Also better for perf
        // anyways.
        if (value === lastValue) { return; }
        lastValue = value;

        if (isBoolean) { value = value >= 1; }

        if (isRawProperty(data)) {
          setRawProperty(el, data.property, value, data.type);
        } else {
          setComponentProperty(el, data.property, value);
        }
      };
    })();
  }
function ( ) { var config = this . config ; var data = this . data ; var el = this . el ; var from ; var isBoolean ; var isNumber ; var to ; if ( this . waitComponentInitRawProperty ( this . updateConfigForDefault ) ) { return ; } if ( data . from === '' ) { // Infer from. from = isRawProperty ( data ) ? getRawProperty ( el , data . property ) : getComponentProperty ( el , data . property ) ; } else { // Explicit from. from = data . from ; } to = data . to ; isNumber = ! isNaN ( from || to ) ; if ( isNumber ) { from = parseFloat ( from ) ; to = parseFloat ( to ) ; } else { from = from ? from . toString ( ) : from ; to = to ? to . toString ( ) : to ; } // Convert booleans to integer to allow boolean flipping. isBoolean = data . to === 'true' || data . to === 'false' || data . to === true || data . to === false ; if ( isBoolean ) { from = data . from === 'true' || data . from === true ? 1 : 0 ; to = data . to === 'true' || data . to === true ? 1 : 0 ; } this . targets . aframeProperty = from ; config . targets = this . targets ; config . aframeProperty = to ; config . update = ( function ( ) { var lastValue ; return function ( anim ) { var value ; value = anim . animatables [ 0 ] . target . aframeProperty ; // Need to do a last value check for animation timeline since all the tweening // begins simultaenously even if the value has not changed. Also better for perf // anyways. if ( value === lastValue ) { return ; } lastValue = value ; if ( isBoolean ) { value = value >= 1 ; } if ( isRawProperty ( data ) ) { setRawProperty ( el , data . property , value , data . type ) ; } else { setComponentProperty ( el , data . property , value ) ; } } ; } ) ( ) ; }
Stuff property into generic `property` key.
Stuff property into generic property key .