easing.js 786 B

12345678910111213141516171819202122232425262728293031
  1. define(function(require, exports, module) {
  2. "use strict";
  3. //easing
  4. var Easing = {
  5. "linear": [0, 0, 1, 1],
  6. "ease": [.25, .1, .25, 1],
  7. "ease-in":[.42,0,1,1],
  8. "ease-out": [0, 0, .58, 1],
  9. "ease-in-out": [.42, 0, .58, 1],
  10. "quadratic": [0.33, 0.66, 0.66, 1],
  11. "circular": [0.1, 0.57, 0.1, 1],
  12. "bounce": [.71, 1.35, .47, 1.41],
  13. format: function(easing) {
  14. if (!easing) return;
  15. if (typeof easing === "string" && this[easing]) {
  16. return this[easing] instanceof Array ? [" cubic-bezier(", this[easing], ") "].join("") : this[easing];
  17. }
  18. if (easing instanceof Array) {
  19. return [" cubic-bezier(", easing, ") "].join("");
  20. }
  21. return easing;
  22. }
  23. }
  24. if (typeof module == 'object' && module.exports) {
  25. module.exports = Easing;
  26. }
  27. /** ignored by jsdoc **/
  28. else {
  29. return Easing;
  30. }
  31. });