anim.less 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  1. /*do not import this file except components/style/index.less*/
  2. .lz {
  3. .effect() {
  4. animation-duration: 0.2s;
  5. animation-fill-mode: both;
  6. animation-timing-function: cubic-bezier(0.55, 0, 0.55, 0.2);
  7. }
  8. &-fade-enter,
  9. &-fade-appear {
  10. opacity: 0;
  11. .effect();
  12. animation-play-state: paused;
  13. }
  14. &-fade-leave {
  15. .effect();
  16. animation-play-state: paused;
  17. }
  18. &-fade-enter&-fade-enter-active,
  19. &-fade-appear&-fade-appear-active {
  20. animation-name: amFadeIn;
  21. animation-play-state: running;
  22. }
  23. &-fade-leave&-fade-leave-active {
  24. animation-name: amFadeOut;
  25. animation-play-state: running;
  26. }
  27. @keyframes amFadeIn {
  28. 0% {
  29. opacity: 0;
  30. }
  31. 100% {
  32. opacity: 1;
  33. }
  34. }
  35. @keyframes amFadeOut {
  36. 0% {
  37. opacity: 1;
  38. }
  39. 100% {
  40. opacity: 0;
  41. }
  42. }
  43. &-slide-up-enter,
  44. &-slide-up-appear {
  45. transform: translate(0, 100%);
  46. }
  47. &-slide-up-enter,
  48. &-slide-up-appear,
  49. &-slide-up-leave {
  50. .effect();
  51. animation-play-state: paused;
  52. }
  53. &-slide-up-enter&-slide-up-enter-active,
  54. &-slide-up-appear&-slide-up-appear-active {
  55. animation-name: amSlideUpIn;
  56. animation-play-state: running;
  57. }
  58. &-slide-up-leave&-slide-up-leave-active {
  59. animation-name: amSlideUpOut;
  60. animation-play-state: running;
  61. }
  62. @keyframes amSlideUpIn {
  63. 0% {
  64. transform: translate(0, 100%);
  65. }
  66. 100% {
  67. transform: translate(0, 0);
  68. }
  69. }
  70. @keyframes amSlideUpOut {
  71. 0% {
  72. transform: translate(0, 0);
  73. }
  74. 100% {
  75. transform: translate(0, 100%);
  76. }
  77. }
  78. &&-zoom-enter,
  79. &&-zoom-leave {
  80. display: block;
  81. }
  82. &-zoom-enter,
  83. &-zoom-appear {
  84. opacity: 0;
  85. .effect();
  86. animation-timing-function: cubic-bezier(0.18, 0.89, 0.32, 1.28);
  87. animation-play-state: paused;
  88. }
  89. &-zoom-leave {
  90. .effect();
  91. animation-timing-function: cubic-bezier(0.6, -0.3, 0.74, 0.05);
  92. animation-play-state: paused;
  93. }
  94. &-zoom-enter&-zoom-enter-active,
  95. &-zoom-appear&-zoom-appear-active {
  96. animation-name: amZoomIn;
  97. animation-play-state: running;
  98. }
  99. &-zoom-leave&-zoom-leave-active {
  100. animation-name: amZoomOut;
  101. animation-play-state: running;
  102. }
  103. @keyframes amZoomIn {
  104. 0% {
  105. opacity: 0;
  106. transform-origin: 50% 50%;
  107. transform: scale(0, 0);
  108. }
  109. 100% {
  110. opacity: 1;
  111. transform-origin: 50% 50%;
  112. transform: scale(1, 1);
  113. }
  114. }
  115. @keyframes amZoomOut {
  116. 0% {
  117. opacity: 1;
  118. transform-origin: 50% 50%;
  119. transform: scale(1, 1);
  120. }
  121. 100% {
  122. opacity: 0;
  123. transform-origin: 50% 50%;
  124. transform: scale(0, 0);
  125. }
  126. }
  127. &-slide-down-enter,
  128. &-slide-down-appear {
  129. transform: translate(0, -100%);
  130. }
  131. &-slide-down-enter,
  132. &-slide-down-appear,
  133. &-slide-down-leave {
  134. .effect();
  135. animation-play-state: paused;
  136. }
  137. &-slide-down-enter&-slide-down-enter-active,
  138. &-slide-down-appear&-slide-down-appear-active {
  139. animation-name: amSlideDownIn;
  140. animation-play-state: running;
  141. }
  142. &-slide-down-leave&-slide-down-leave-active {
  143. animation-name: amSlideDownOut;
  144. animation-play-state: running;
  145. }
  146. @keyframes amSlideDownIn {
  147. 0% {
  148. transform: translate(0, -100%);
  149. }
  150. 100% {
  151. transform: translate(0, 0);
  152. }
  153. }
  154. @keyframes amSlideDownOut {
  155. 0% {
  156. transform: translate(0, 0);
  157. }
  158. 100% {
  159. transform: translate(0, -100%);
  160. }
  161. }
  162. }