Permalink
Browse files

Rotation, made all times work in milliseconds

  • Loading branch information...
Koen Bok
Koen Bok committed Apr 25, 2013
1 parent 5b1e121 commit 8f0ef3f839b64b719de05022f0195f6d33611ec3
Showing with 8 additions and 7 deletions.
  1. +8 −7 src/animation.coffee
View
@@ -30,7 +30,7 @@ class Animation extends EventEmitter
AnimationProperties: [
"view", "properties", "curve", "time",
"origin", "tolerance", "precision", "modifiers"
"debug", "profile"
"debug", "profile", "callback"
]
AnimatableCSSProperties: {
opacity: "",
@@ -40,7 +40,7 @@ class Animation extends EventEmitter
AnimatableMatrixProperties: [
"x", "y", "z",
"scaleX", "scaleY", "scaleZ", # "scale",
"rotateX", "rotateY", "rotateZ", # "rotate"
"rotationX", "rotationY", "rotationZ", # "rotation"
]
constructor: (args) ->
@@ -92,7 +92,7 @@ class Animation extends EventEmitter
# Calculate the curve values
@curveValues = @_parseCurve @curve
@totalTime = @curveValues.length / @precision
@totalTime = (@curveValues.length / @precision) * 1000
########################################################
@@ -108,8 +108,8 @@ class Animation extends EventEmitter
propertiesB.scaleX = propertiesB.scale
propertiesB.scaleY = propertiesB.scale
if propertiesB.rotate
propertiesB.rotateZ = propertiesB.rotate
if propertiesB.rotation
propertiesB.rotationZ = propertiesB.rotation
@propertiesA = {}
@propertiesB = {}
@@ -149,7 +149,7 @@ class Animation extends EventEmitter
#{@keyFrameAnimationCSS}
.#{@animationName} {
-webkit-animation-duration: #{@totalTime}s;
-webkit-animation-duration: #{@totalTime / 1000}s;
-webkit-animation-name: #{@animationName};
-webkit-animation-timing-function: linear;
-webkit-animation-fill-mode: both;
@@ -164,7 +164,7 @@ class Animation extends EventEmitter
if @debug
endTime = new Date().getTime() - startTime
console.log "Animation[#{@animationId}].setupTime = #{endTime}ms"
console.log "Animation[#{@animationId}].totalTime = #{utils.round @totalTime, 2}ms"
console.log "Animation[#{@animationId}].totalTime = #{utils.round @totalTime, 0}ms"
console.profileEnd @animationName if @profile
@@ -242,6 +242,7 @@ class Animation extends EventEmitter
@view._matrix = endMatrix
@view.style = endStyles
@callback? @
@emit "end"
_css: ->

0 comments on commit 8f0ef3f

Please sign in to comment.