_transitions.scss 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364
  1. @use '../settings';
  2. @mixin transition-default() {
  3. &-enter-active {
  4. transition-duration: 0.3s !important;
  5. transition-timing-function: settings.$standard-easing !important;
  6. }
  7. &-leave-active {
  8. transition-duration: 0.3s !important;
  9. transition-timing-function: settings.$standard-easing !important;
  10. }
  11. &-move {
  12. transition-duration: 0.5s !important;
  13. transition-property: transform !important;
  14. transition-timing-function: settings.$standard-easing !important;
  15. }
  16. }
  17. @mixin fade-out() {
  18. &-leave-to {
  19. opacity: 0;
  20. }
  21. &-leave-active {
  22. transition-duration: 100ms !important;
  23. }
  24. }
  25. // Component specific transitions
  26. .dialog-transition,
  27. .dialog-bottom-transition,
  28. .dialog-top-transition {
  29. &-enter-active {
  30. transition-duration: 225ms !important;
  31. transition-timing-function: settings.$decelerated-easing !important;
  32. }
  33. &-leave-active {
  34. transition-duration: 125ms !important;
  35. transition-timing-function: settings.$accelerated-easing !important;
  36. }
  37. &-enter-active,
  38. &-leave-active {
  39. transition-property: transform, opacity !important;
  40. pointer-events: none;
  41. }
  42. }
  43. .dialog-transition {
  44. &-enter-from, &-leave-to {
  45. transform: scale(0.9);
  46. opacity: 0;
  47. }
  48. &-enter-to, &-leave-from {
  49. opacity: 1;
  50. }
  51. }
  52. .dialog-bottom-transition {
  53. &-enter-from, &-leave-to {
  54. transform: translateY(calc(50vh + 50%));
  55. }
  56. }
  57. .dialog-top-transition {
  58. &-enter-from, &-leave-to {
  59. transform: translateY(calc(-50vh - 50%));
  60. }
  61. }
  62. .picker-transition,
  63. .picker-reverse-transition {
  64. @include transition-default();
  65. &-enter-from,
  66. &-leave-to {
  67. opacity: 0;
  68. }
  69. &-leave-from,
  70. &-leave-active,
  71. &-leave-to {
  72. position: absolute !important;
  73. }
  74. &-enter-active,
  75. &-leave-active {
  76. transition-property: transform, opacity !important;
  77. }
  78. }
  79. .picker-transition {
  80. @include transition-default();
  81. &-enter-from {
  82. transform: translate(0, 100%);
  83. }
  84. &-leave-to {
  85. transform: translate(0, -100%);
  86. }
  87. }
  88. .picker-reverse-transition {
  89. @include transition-default();
  90. &-enter-from {
  91. transform: translate(0, -100%);
  92. }
  93. &-leave-to {
  94. transform: translate(0, 100%);
  95. }
  96. }
  97. // Generic transitions
  98. .expand-transition {
  99. @include transition-default();
  100. &-enter-active,
  101. &-leave-active {
  102. transition-property: height !important;
  103. }
  104. }
  105. .expand-x-transition {
  106. @include transition-default();
  107. &-enter-active,
  108. &-leave-active {
  109. transition-property: width !important;
  110. }
  111. }
  112. .scale-transition {
  113. @include transition-default();
  114. @include fade-out();
  115. &-enter-from {
  116. opacity: 0;
  117. transform: scale(0);
  118. }
  119. &-enter-active,
  120. &-leave-active {
  121. transition-property: transform, opacity !important;
  122. }
  123. }
  124. .scale-rotate-transition {
  125. @include transition-default();
  126. @include fade-out();
  127. &-enter-from {
  128. opacity: 0;
  129. transform: scale(0) rotate(-45deg);
  130. }
  131. &-enter-active,
  132. &-leave-active {
  133. transition-property: transform, opacity !important;
  134. }
  135. }
  136. .scale-rotate-reverse-transition {
  137. @include transition-default();
  138. @include fade-out();
  139. &-enter-from {
  140. opacity: 0;
  141. transform: scale(0) rotate(45deg);
  142. }
  143. &-enter-active,
  144. &-leave-active {
  145. transition-property: transform, opacity !important;
  146. }
  147. }
  148. .message-transition {
  149. @include transition-default();
  150. &-enter-from, &-leave-to {
  151. opacity: 0;
  152. transform: translateY(-15px);
  153. }
  154. &-leave-from, &-leave-active {
  155. position: absolute;
  156. }
  157. &-enter-active,
  158. &-leave-active {
  159. transition-property: transform, opacity !important;
  160. }
  161. }
  162. .slide-y-transition {
  163. @include transition-default();
  164. &-enter-from, &-leave-to {
  165. opacity: 0;
  166. transform: translateY(-15px);
  167. }
  168. &-enter-active,
  169. &-leave-active {
  170. transition-property: transform, opacity !important;
  171. }
  172. }
  173. .slide-y-reverse-transition {
  174. @include transition-default();
  175. &-enter-from, &-leave-to {
  176. opacity: 0;
  177. transform: translateY(15px);
  178. }
  179. &-enter-active,
  180. &-leave-active {
  181. transition-property: transform, opacity !important;
  182. }
  183. }
  184. .scroll-y-transition {
  185. @include transition-default();
  186. &-enter-from, &-leave-to {
  187. opacity: 0;
  188. }
  189. &-enter-from {
  190. transform: translateY(-15px);
  191. }
  192. &-leave-to {
  193. transform: translateY(15px);
  194. }
  195. &-enter-active,
  196. &-leave-active {
  197. transition-property: transform, opacity !important;
  198. }
  199. }
  200. .scroll-y-reverse-transition {
  201. @include transition-default();
  202. &-enter-from, &-leave-to {
  203. opacity: 0;
  204. }
  205. &-enter-from {
  206. transform: translateY(15px);
  207. }
  208. &-leave-to {
  209. transform: translateY(-15px);
  210. }
  211. &-enter-active,
  212. &-leave-active {
  213. transition-property: transform, opacity !important;
  214. }
  215. }
  216. .scroll-x-transition {
  217. @include transition-default();
  218. &-enter-from, &-leave-to {
  219. opacity: 0;
  220. }
  221. &-enter-from {
  222. transform: translateX(-15px);
  223. }
  224. &-leave-to {
  225. transform: translateX(15px);
  226. }
  227. &-enter-active,
  228. &-leave-active {
  229. transition-property: transform, opacity !important;
  230. }
  231. }
  232. .scroll-x-reverse-transition {
  233. @include transition-default();
  234. &-enter-from, &-leave-to {
  235. opacity: 0;
  236. }
  237. &-enter-from {
  238. transform: translateX(15px);
  239. }
  240. &-leave-to {
  241. transform: translateX(-15px);
  242. }
  243. &-enter-active,
  244. &-leave-active {
  245. transition-property: transform, opacity !important;
  246. }
  247. }
  248. .slide-x-transition {
  249. @include transition-default();
  250. &-enter-from, &-leave-to {
  251. opacity: 0;
  252. transform: translateX(-15px);
  253. }
  254. &-enter-active,
  255. &-leave-active {
  256. transition-property: transform, opacity !important;
  257. }
  258. }
  259. .slide-x-reverse-transition {
  260. @include transition-default();
  261. &-enter-from, &-leave-to {
  262. opacity: 0;
  263. transform: translateX(15px);
  264. }
  265. &-enter-active,
  266. &-leave-active {
  267. transition-property: transform, opacity !important;
  268. }
  269. }
  270. .fade-transition {
  271. @include transition-default();
  272. &-enter-from, &-leave-to {
  273. opacity: 0 !important;
  274. }
  275. &-enter-active,
  276. &-leave-active {
  277. transition-property: opacity !important;
  278. }
  279. }
  280. .fab-transition {
  281. @include transition-default();
  282. &-enter-from, &-leave-to {
  283. transform: scale(0) rotate(-45deg);
  284. }
  285. &-enter-active,
  286. &-leave-active {
  287. transition-property: transform !important;
  288. }
  289. }