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 2.0KB

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