f4549ac43bad3dc1c97ffc94042d3649ee00db8b3c7ec577619ee4d38c0f820cad78222e9deadfd0bd763e6b9cee9ea478352a6c4b6f85ea3b218b1f2e19a8 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219
  1. @import "mixins/mixins";
  2. @import "common/var";
  3. @keyframes el-drawer-fade-in {
  4. 0% {
  5. opacity: 0;
  6. }
  7. 100% {
  8. opacity: 1;
  9. }
  10. }
  11. @mixin drawer-animation($direction) {
  12. @keyframes #{$direction}-drawer-in {
  13. 0% {
  14. @if $direction == ltr {
  15. transform: translate(-100%, 0px);
  16. }
  17. @if $direction == rtl {
  18. transform: translate(100%, 0px);
  19. }
  20. @if $direction == ttb {
  21. transform: translate(0px, -100%);
  22. }
  23. @if $direction == btt {
  24. transform: translate(0px, 100%);
  25. }
  26. }
  27. 100% {
  28. @if $direction == ltr {
  29. transform: translate(0px, 0px);
  30. }
  31. @if $direction == rtl {
  32. transform: translate(0px, 0px);
  33. }
  34. @if $direction == ttb {
  35. transform: translate(0px, 0px);
  36. }
  37. @if $direction == btt {
  38. transform: translate(0px, 0px);
  39. }
  40. }
  41. }
  42. @keyframes #{$direction}-drawer-out {
  43. 0% {
  44. @if $direction == ltr {
  45. transform: translate(0px, 0px);
  46. }
  47. @if $direction == rtl {
  48. transform: translate(0px, 0px);;
  49. }
  50. @if $direction == ttb {
  51. transform: translate(0px, 0px);
  52. }
  53. @if $direction == btt {
  54. transform: translate(0px, 0);
  55. }
  56. }
  57. 100% {
  58. @if $direction == ltr {
  59. transform: translate(-100%, 0px);
  60. }
  61. @if $direction == rtl {
  62. transform: translate(100%, 0px);
  63. }
  64. @if $direction == ttb {
  65. transform: translate(0px, -100%);
  66. }
  67. @if $direction == btt {
  68. transform: translate(0px, 100%);
  69. }
  70. }
  71. }
  72. }
  73. @mixin animation-in($direction) {
  74. .el-drawer__open &.#{$direction} {
  75. animation: #{$direction}-drawer-in .3s 1ms;
  76. }
  77. }
  78. @mixin animation-out($direction) {
  79. &.#{$direction} {
  80. animation: #{$direction}-drawer-out .3s;
  81. }
  82. }
  83. @include drawer-animation(rtl);
  84. @include drawer-animation(ltr);
  85. @include drawer-animation(ttb);
  86. @include drawer-animation(btt);
  87. $directions: rtl, ltr, ttb, btt;
  88. @include b(drawer) {
  89. position: absolute;
  90. box-sizing: border-box;
  91. background-color: $--dialog-background-color;
  92. display: flex;
  93. flex-direction: column;
  94. box-shadow: 0 8px 10px -5px rgba(0, 0, 0, 0.2),
  95. 0 16px 24px 2px rgba(0, 0, 0, 0.14),
  96. 0 6px 30px 5px rgba(0, 0, 0, 0.12);
  97. overflow: hidden;
  98. outline: 0;
  99. @each $direction in $directions {
  100. @include animation-out($direction);
  101. @include animation-in($direction);
  102. }
  103. &__wrapper {
  104. position: fixed;
  105. top: 0;
  106. right: 0;
  107. bottom: 0;
  108. left: 0;
  109. overflow: hidden;
  110. margin: 0;
  111. }
  112. &__header {
  113. align-items: center;
  114. color: rgb(114, 118, 123);
  115. display: flex;
  116. margin-bottom: 32px;
  117. padding: $--dialog-padding-primary;
  118. padding-bottom: 0;
  119. & > :first-child {
  120. flex: 1;
  121. }
  122. }
  123. &__title {
  124. margin: 0;
  125. flex: 1;
  126. line-height: inherit;
  127. font-size: 1rem;
  128. }
  129. &__close-btn {
  130. border: none;
  131. cursor: pointer;
  132. font-size: $--font-size-extra-large;
  133. color: inherit;
  134. background-color: transparent;
  135. }
  136. &__body {
  137. flex: 1;
  138. overflow: auto;
  139. & > * {
  140. box-sizing: border-box;
  141. }
  142. }
  143. &.ltr, &.rtl {
  144. height: 100%;
  145. top: 0;
  146. bottom: 0;
  147. }
  148. &.ttb, &.btt {
  149. width: 100%;
  150. left: 0;
  151. right: 0;
  152. }
  153. &.ltr {
  154. left: 0;
  155. }
  156. &.rtl {
  157. right: 0;
  158. }
  159. &.ttb {
  160. top: 0;
  161. }
  162. &.btt {
  163. bottom: 0;
  164. }
  165. }
  166. .el-drawer__container {
  167. position: relative;
  168. left: 0;
  169. right: 0;
  170. top: 0;
  171. bottom: 0;
  172. height: 100%;
  173. width: 100%;
  174. }
  175. .el-drawer-fade-enter-active {
  176. animation: el-drawer-fade-in .3s;
  177. }
  178. .el-drawer-fade-leave-active {
  179. animation: el-drawer-fade-in .3s reverse;
  180. }