Created
January 30, 2020 01:15
-
-
Save worc/c84b341886656933965b33dd557e17bf to your computer and use it in GitHub Desktop.
hm....
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var e = this.velocity | |
, t = Date.now() | |
, n = t - this.lastFrame; | |
this.lastFrame = t, | |
e *= n / 16, | |
this.rotation = this.rotation + e; | |
var r = "rotate(" + this.rotation + "deg)"; | |
this.$el.css({ | |
"-webkit-transform": r, | |
"-moz-transform": r, | |
transform: r | |
}), | |
this._requestAnimation = window.requestAnimationFrame(this._update.bind(this)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment