Skip to content

Instantly share code, notes, and snippets.

@snowleo208
Created September 11, 2018 14:59
Show Gist options
  • Save snowleo208/2d10f5cb35ac48ef36c6788de5153152 to your computer and use it in GitHub Desktop.
Save snowleo208/2d10f5cb35ac48ef36c6788de5153152 to your computer and use it in GitHub Desktop.
//ease in function from https://github.com/component/ease/blob/master/index.js
const outQuad = function(n){
return n * (2 - n);
};
let easeInPercentage = +(outQuad(progress)).toFixed(2);
pos = (target === 0)? (firstPos - (firstPos * easeInPercentage)) : (firstPos + (target * easeInPercentage));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment