Skip to content

Instantly share code, notes, and snippets.

@atleastimtrying
Created December 29, 2012 19:09
Show Gist options
  • Save atleastimtrying/4408738 to your computer and use it in GitHub Desktop.
Save atleastimtrying/4408738 to your computer and use it in GitHub Desktop.
A nice easing equation
value = 10
targetValue = 20
speed = 0.1
loop = ->
value += (value - targetValue)* speed
requestAnimationFrame loop unless Math.abs(targetValue - value) < 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment