motion.js 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. exports.default = void 0;
  6. var _cssinjs = require("../../_util/cssinjs");
  7. const uploadAnimateInlineIn = new _cssinjs.Keyframes('uploadAnimateInlineIn', {
  8. from: {
  9. width: 0,
  10. height: 0,
  11. margin: 0,
  12. padding: 0,
  13. opacity: 0
  14. }
  15. });
  16. const uploadAnimateInlineOut = new _cssinjs.Keyframes('uploadAnimateInlineOut', {
  17. to: {
  18. width: 0,
  19. height: 0,
  20. margin: 0,
  21. padding: 0,
  22. opacity: 0
  23. }
  24. });
  25. // =========================== Motion ===========================
  26. const genMotionStyle = token => {
  27. const {
  28. componentCls
  29. } = token;
  30. const inlineCls = `${componentCls}-animate-inline`;
  31. return [{
  32. [`${componentCls}-wrapper`]: {
  33. [`${inlineCls}-appear, ${inlineCls}-enter, ${inlineCls}-leave`]: {
  34. animationDuration: token.motionDurationSlow,
  35. animationTimingFunction: token.motionEaseInOutCirc,
  36. animationFillMode: 'forwards'
  37. },
  38. [`${inlineCls}-appear, ${inlineCls}-enter`]: {
  39. animationName: uploadAnimateInlineIn
  40. },
  41. [`${inlineCls}-leave`]: {
  42. animationName: uploadAnimateInlineOut
  43. }
  44. }
  45. }, uploadAnimateInlineIn, uploadAnimateInlineOut];
  46. };
  47. var _default = exports.default = genMotionStyle;