_slide.scss 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. @mixin transform {
  2. transform: translate3d(0, 0, 0);
  3. }
  4. @keyframes #{$rt-namespace}__slideInRight {
  5. from {
  6. transform: translate3d(110%, 0, 0);
  7. visibility: visible;
  8. }
  9. to {
  10. @include transform;
  11. }
  12. }
  13. @keyframes #{$rt-namespace}__slideInLeft {
  14. from {
  15. transform: translate3d(-110%, 0, 0);
  16. visibility: visible;
  17. }
  18. to {
  19. @include transform;
  20. }
  21. }
  22. @keyframes #{$rt-namespace}__slideInUp {
  23. from {
  24. transform: translate3d(0, 110%, 0);
  25. visibility: visible;
  26. }
  27. to {
  28. @include transform;
  29. }
  30. }
  31. @keyframes #{$rt-namespace}__slideInDown {
  32. from {
  33. transform: translate3d(0, -110%, 0);
  34. visibility: visible;
  35. }
  36. to {
  37. @include transform;
  38. }
  39. }
  40. @keyframes #{$rt-namespace}__slideOutRight {
  41. from {
  42. @include transform;
  43. }
  44. to {
  45. visibility: hidden;
  46. transform: translate3d(110%, 0, 0);
  47. }
  48. }
  49. @keyframes #{$rt-namespace}__slideOutLeft {
  50. from {
  51. @include transform;
  52. }
  53. to {
  54. visibility: hidden;
  55. transform: translate3d(-110%, 0, 0);
  56. }
  57. }
  58. @keyframes #{$rt-namespace}__slideOutDown {
  59. from {
  60. @include transform;
  61. }
  62. to {
  63. visibility: hidden;
  64. transform: translate3d(0, 500px, 0);
  65. }
  66. }
  67. @keyframes #{$rt-namespace}__slideOutUp {
  68. from {
  69. @include transform;
  70. }
  71. to {
  72. visibility: hidden;
  73. transform: translate3d(0, -500px, 0);
  74. }
  75. }
  76. .#{$rt-namespace}__slide-enter {
  77. &--top-left,
  78. &--bottom-left {
  79. animation-name: #{$rt-namespace}__slideInLeft;
  80. }
  81. &--top-right,
  82. &--bottom-right {
  83. animation-name: #{$rt-namespace}__slideInRight;
  84. }
  85. &--top-center {
  86. animation-name: #{$rt-namespace}__slideInDown;
  87. }
  88. &--bottom-center {
  89. animation-name: #{$rt-namespace}__slideInUp;
  90. }
  91. }
  92. .#{$rt-namespace}__slide-exit {
  93. &--top-left,
  94. &--bottom-left {
  95. animation-name: #{$rt-namespace}__slideOutLeft;
  96. }
  97. &--top-right,
  98. &--bottom-right {
  99. animation-name: #{$rt-namespace}__slideOutRight;
  100. }
  101. &--top-center {
  102. animation-name: #{$rt-namespace}__slideOutUp;
  103. }
  104. &--bottom-center {
  105. animation-name: #{$rt-namespace}__slideOutDown;
  106. }
  107. }