Last active
September 21, 2016 13:33
-
-
Save nishinoshake/7670f594bd47fd37fc52aaf95b0d40ef to your computer and use it in GitHub Desktop.
easingを関数として使う
This file contains hidden or 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
// $.easing.easing(null, current_time, start_value, end_value, total_time); | |
// http://gsgd.co.uk/sandbox/jquery/easing/ | |
// プラグインが必要 | |
var duration = 600; | |
var startTime = (new Date()).getTime(); | |
// * | |
// * ループをRAFでまわしたりする | |
// * valueにeasingが加味された値が返る | |
// * | |
var now = (new Date()).getTime(); | |
var passedTime = now - startTime; | |
var progress = passedTime / duration; | |
var value = $.easing.easeOutSine(null, passedTime, 0, 1, duration); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment