_transitions.scss 6.7 KB

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