motion.less 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. @import (reference) '../../style/themes/index';
  2. @drawer-prefix-cls: ~'@{ant-prefix}-drawer';
  3. .panel-motion {
  4. &-enter,
  5. &-appear,
  6. &-leave {
  7. &-start {
  8. transition: none;
  9. }
  10. &-active {
  11. transition: all @animation-duration-slow;
  12. }
  13. }
  14. }
  15. .@{drawer-prefix-cls} {
  16. // ======================== Mask ========================
  17. &-mask-motion {
  18. &-enter,
  19. &-appear,
  20. &-leave {
  21. &-active {
  22. transition: all @animation-duration-slow;
  23. }
  24. }
  25. &-enter,
  26. &-appear {
  27. opacity: 0;
  28. &-active {
  29. opacity: 1;
  30. }
  31. }
  32. &-leave {
  33. opacity: 1;
  34. &-active {
  35. opacity: 0;
  36. }
  37. }
  38. }
  39. // ======================= Panel ========================
  40. &-panel-motion {
  41. // Left
  42. &-left {
  43. .panel-motion();
  44. &-enter,
  45. &-appear {
  46. &-start {
  47. transform: translateX(-100%) !important;
  48. }
  49. &-active {
  50. transform: translateX(0);
  51. }
  52. }
  53. &-leave {
  54. transform: translateX(0);
  55. &-active {
  56. transform: translateX(-100%);
  57. }
  58. }
  59. }
  60. // Right
  61. &-right {
  62. .panel-motion();
  63. &-enter,
  64. &-appear {
  65. &-start {
  66. transform: translateX(100%) !important;
  67. }
  68. &-active {
  69. transform: translateX(0);
  70. }
  71. }
  72. &-leave {
  73. transform: translateX(0);
  74. &-active {
  75. transform: translateX(100%);
  76. }
  77. }
  78. }
  79. // Top
  80. &-top {
  81. .panel-motion();
  82. &-enter,
  83. &-appear {
  84. &-start {
  85. transform: translateY(-100%) !important;
  86. }
  87. &-active {
  88. transform: translateY(0);
  89. }
  90. }
  91. &-leave {
  92. transform: translateY(0);
  93. &-active {
  94. transform: translateY(-100%);
  95. }
  96. }
  97. }
  98. // Bottom
  99. &-bottom {
  100. .panel-motion();
  101. &-enter,
  102. &-appear {
  103. &-start {
  104. transform: translateY(100%) !important;
  105. }
  106. &-active {
  107. transform: translateY(0);
  108. }
  109. }
  110. &-leave {
  111. transform: translateY(0);
  112. &-active {
  113. transform: translateY(100%);
  114. }
  115. }
  116. }
  117. }
  118. }