Ohm-Management - Projektarbeit B-ME
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

easing-patterns.js 1.7KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. // linear
  2. export var linear = function linear(t) {
  3. return t;
  4. };
  5. // accelerating from zero velocity
  6. export var easeInQuad = function easeInQuad(t) {
  7. return t * t;
  8. };
  9. // decelerating to zero velocity
  10. export var easeOutQuad = function easeOutQuad(t) {
  11. return t * (2 - t);
  12. };
  13. // acceleration until halfway, then deceleration
  14. export var easeInOutQuad = function easeInOutQuad(t) {
  15. return t < 0.5 ? 2 * t * t : -1 + (4 - 2 * t) * t;
  16. };
  17. // accelerating from zero velocity
  18. export var easeInCubic = function easeInCubic(t) {
  19. return t * t * t;
  20. };
  21. // decelerating to zero velocity
  22. export var easeOutCubic = function easeOutCubic(t) {
  23. return --t * t * t + 1;
  24. };
  25. // acceleration until halfway, then deceleration
  26. export var easeInOutCubic = function easeInOutCubic(t) {
  27. return t < 0.5 ? 4 * t * t * t : (t - 1) * (2 * t - 2) * (2 * t - 2) + 1;
  28. };
  29. // accelerating from zero velocity
  30. export var easeInQuart = function easeInQuart(t) {
  31. return t * t * t * t;
  32. };
  33. // decelerating to zero velocity
  34. export var easeOutQuart = function easeOutQuart(t) {
  35. return 1 - --t * t * t * t;
  36. };
  37. // acceleration until halfway, then deceleration
  38. export var easeInOutQuart = function easeInOutQuart(t) {
  39. return t < 0.5 ? 8 * t * t * t * t : 1 - 8 * --t * t * t * t;
  40. };
  41. // accelerating from zero velocity
  42. export var easeInQuint = function easeInQuint(t) {
  43. return t * t * t * t * t;
  44. };
  45. // decelerating to zero velocity
  46. export var easeOutQuint = function easeOutQuint(t) {
  47. return 1 + --t * t * t * t * t;
  48. };
  49. // acceleration until halfway, then deceleration
  50. export var easeInOutQuint = function easeInOutQuint(t) {
  51. return t < 0.5 ? 16 * t * t * t * t * t : 1 + 16 * --t * t * t * t * t;
  52. };
  53. //# sourceMappingURL=easing-patterns.js.map