function TransitionFrames (framesToTransition, property, transitionType) {

      // determine start and end values.
      var endValue = framesToTransition[framesToTransition.length-1][property.name],
          startValue = framesToTransition[0][property.name],
          uOfMEnding = 'px';

      // parse out the number if necessary
      if (property.name === 'opacity' || property.name === 'scale')
        uOfMEnding = '';
      else if (property.name === 'rotate')
        uOfMEnding = 'deg';
      else if (property.unitOfMeasure !== 'raw') {
        endValue = parseFloat(endValue);
        startValue = parseFloat(startValue);
        if (property.unitOfMeasure === 'percent')
          uOfMEnding = '%';
        else if (property.unitOfMeasure === 'degree')
          uOfMEnding = 'deg';
      }

      // don't bother looping if the values don't need transitioning.
      if (endValue === startValue) return framesToTransition;

      // linear transition (default).
      if (!transitionType || transitionType === 'linear') {
        var increment = ((endValue - parseFloat(startValue)) / framesToTransition.length)

        for (var i=1,l=framesToTransition.length-1; i<l; i++) {
          framesToTransition[i][property.name] =
              parseFloat(framesToTransition[i][property.name])
            + (increment * i)
            + uOfMEnding;
        }

        // also add the increment to the first and last
        framesToTransition[0][property.name] += uOfMEnding;
        framesToTransition[framesToTransition.length-1][property.name] += uOfMEnding;
      }

      return framesToTransition;
    }
// Gets the incrementer value for smoothing between keyframe values.
Gets the incrementer value for smoothing between keyframe values.
Gets the incrementer value for smoothing between keyframe values .
function TransitionFrames (framesToTransition, property, transitionType) {
      var endValue = framesToTransition[framesToTransition.length-1][property.name],
          startValue = framesToTransition[0][property.name],
          uOfMEnding = 'px';
      if (property.name === 'opacity' || property.name === 'scale')
        uOfMEnding = '';
      else if (property.name === 'rotate')
        uOfMEnding = 'deg';
      else if (property.unitOfMeasure !== 'raw') {
        endValue = parseFloat(endValue);
        startValue = parseFloat(startValue);
        if (property.unitOfMeasure === 'percent')
          uOfMEnding = '%';
        else if (property.unitOfMeasure === 'degree')
          uOfMEnding = 'deg';
      }
      if (endValue === startValue) return framesToTransition;
      if (!transitionType || transitionType === 'linear') {
        var increment = ((endValue - parseFloat(startValue)) / framesToTransition.length)
        for (var i=1,l=framesToTransition.length-1; i<l; i++) {
          framesToTransition[i][property.name] =
              parseFloat(framesToTransition[i][property.name])
            + (increment * i)
            + uOfMEnding;
        }
        framesToTransition[0][property.name] += uOfMEnding;
        framesToTransition[framesToTransition.length-1][property.name] += uOfMEnding;
      }
      return framesToTransition;
    }
function TransitionFrames ( framesToTransition , property , transitionType ) { var endValue = framesToTransition [ framesToTransition . length - 1 ] [ property . name ] , startValue = framesToTransition [ 0 ] [ property . name ] , uOfMEnding = 'px' ; if ( property . name === 'opacity' || property . name === 'scale' ) uOfMEnding = '' ; else if ( property . name === 'rotate' ) uOfMEnding = 'deg' ; else if ( property . unitOfMeasure !== 'raw' ) { endValue = parseFloat ( endValue ) ; startValue = parseFloat ( startValue ) ; if ( property . unitOfMeasure === 'percent' ) uOfMEnding = '%' ; else if ( property . unitOfMeasure === 'degree' ) uOfMEnding = 'deg' ; } if ( endValue === startValue ) return framesToTransition ; if ( ! transitionType || transitionType === 'linear' ) { var increment = ( ( endValue - parseFloat ( startValue ) ) / framesToTransition . length ) for ( var i = 1 , l = framesToTransition . length - 1 ; i < l ; i ++ ) { framesToTransition [ i ] [ property . name ] = parseFloat ( framesToTransition [ i ] [ property . name ] ) + ( increment * i ) + uOfMEnding ; } framesToTransition [ 0 ] [ property . name ] += uOfMEnding ; framesToTransition [ framesToTransition . length - 1 ] [ property . name ] += uOfMEnding ; } return framesToTransition ; }
Gets the incrementer value for smoothing between keyframe values.
Gets the incrementer value for smoothing between keyframe values .
// determine start and end values. // parse out the number if necessary // don't bother looping if the values don't need transitioning. // linear transition (default). // also add the increment to the first and last