You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

256 lines
6.9 KiB

  1. //============== toast
  2. $ax5toast-z-index: 2000;
  3. // 0:left,top / 1:right,top / 2:right,bottom / 3:left,bottom
  4. $ax5toast-container-width: auto !default;
  5. $ax5toast-container-padding: 10px !default;
  6. $ax5toast-box-model: border-box !default;
  7. $ax5toast-border: 1px solid rgb(255/2, 255/2, 255/2) !default;
  8. $ax5toast-box-shadow: 0px 0px 5px 0px rgba(0, 0, 0, 0.175) !default;
  9. $ax5toast-body-padding: 6px !default;
  10. $ax5toast-border-radius: 8px !default;
  11. $ax5toast-opacity: 0.9 !default;
  12. $ax5toast-box-margin: 5px 0px 5px 0px !default;
  13. $ax5toast-icon-size: 24px;
  14. $ax5toast-easing: $ease-in-out-quint;
  15. $ax5toast-easing-time: 0.3s;
  16. //** Border color for elements within toast
  17. $ax5toast-default-text: #282828 !default;
  18. $ax5toast-default-bg: #fff !default;
  19. $ax5toast-default-color: $body-color !default;
  20. $ax5toast-primary-text: $brand-primary !default;
  21. $ax5toast-primary-bg: #fff !default;
  22. $ax5toast-primary-color: $brand-primary !default;
  23. $ax5toast-success-text: $brand-success !default;
  24. $ax5toast-success-bg: #fff !default;
  25. $ax5toast-success-color: $brand-success !default;
  26. $ax5toast-info-text: $brand-info !default;
  27. $ax5toast-info-bg: #fff !default;
  28. $ax5toast-info-color: $brand-info !default;
  29. $ax5toast-warning-text: #fff !default;
  30. $ax5toast-warning-bg: $brand-warning !default;
  31. $ax5toast-warning-color: $brand-warning !default;
  32. $ax5toast-danger-text: #fff !default;
  33. $ax5toast-danger-bg: $brand-warning !default;
  34. $ax5toast-danger-color: $brand-danger !default;
  35. @mixin ax-toast() {
  36. box-sizing: $ax5toast-box-model;
  37. border: $ax5toast-border;
  38. opacity: $ax5toast-opacity;
  39. @include ax-border-radius($ax5toast-border-radius);
  40. box-shadow: $ax5toast-box-shadow;
  41. position: relative;
  42. margin: $ax5toast-box-margin;
  43. }
  44. @mixin ax-toast-section() {
  45. display: table;
  46. padding: $ax5toast-body-padding;
  47. .ax-toast-icon {
  48. display: table-cell;
  49. padding: $ax5toast-body-padding;
  50. text-align: left;
  51. font-size: $ax5toast-icon-size;
  52. width: $ax5toast-icon-size;
  53. vertical-align: middle;
  54. }
  55. .ax-toast-body {
  56. display: table-cell;
  57. padding: $ax5toast-body-padding;
  58. text-align: left;
  59. vertical-align: middle;
  60. }
  61. .ax-toast-buttons {
  62. display: table-cell;
  63. padding: $ax5toast-body-padding;
  64. text-align: right;
  65. vertical-align: middle;
  66. button {
  67. &:not(:last-child) {
  68. margin-right: 3px;
  69. }
  70. }
  71. }
  72. .ax-toast-close {
  73. display: table-cell;
  74. padding: $ax5toast-body-padding;
  75. text-align: right;
  76. vertical-align: top;
  77. text-decoration: none;
  78. cursor: pointer;
  79. }
  80. }
  81. @mixin toast-variant($text-color, $bg-color, $color) {
  82. background: $bg-color;
  83. color: $text-color;
  84. .ax-toast-icon {
  85. color: $color;
  86. }
  87. .ax-toast-close {
  88. color: $text-color;
  89. }
  90. }
  91. @include keyframes(ax-toast-bottom) {
  92. from {
  93. @include transform(translateY(-100px) scale(0.7));
  94. }
  95. to {
  96. //@include opacity($mask-bg-opacity);
  97. @include transform(translateY(0px) scale(1))
  98. }
  99. }
  100. @include keyframes(ax-toast-top) {
  101. from {
  102. @include transform(translateY(100px) scale(0.7));
  103. }
  104. to {
  105. //@include opacity($mask-bg-opacity);
  106. @include transform(translateY(0px) scale(1))
  107. }
  108. }
  109. @include keyframes(ax-toast-removed-bottom) {
  110. from {
  111. @include transform(translateY(0px));
  112. opacity: 1.0;
  113. }
  114. to {
  115. @include transform(translateY(10px) scale(0.7));
  116. opacity: 0.0;
  117. }
  118. }
  119. @include keyframes(ax-toast-removed-top) {
  120. from {
  121. @include transform(translateY(0px));
  122. opacity: 1.0;
  123. }
  124. to {
  125. @include transform(translateY(-10px) scale(0.7));
  126. opacity: 0.0;
  127. }
  128. }
  129. @include keyframes(ax-toast-destroy) {
  130. from {
  131. @include transform(scale(1));
  132. opacity: 1.0;
  133. }
  134. to {
  135. @include transform(scale(1.5));
  136. opacity: 0.0;
  137. }
  138. }
  139. // mixins --------------------------------------------- end
  140. .ax5-ui-toast-container {
  141. z-index: $ax5toast-z-index;
  142. position: fixed;
  143. width: $ax5toast-container-width;
  144. padding: $ax5toast-container-padding;
  145. box-sizing: border-box;
  146. *,
  147. *:before,
  148. *:after {
  149. box-sizing: border-box;
  150. }
  151. .ax5-ui-toast {
  152. @include ax-toast();
  153. @include ax-toast-section();
  154. @include transition(all $ax5toast-easing-time ease-in-out);
  155. @include toast-variant($ax5toast-default-text, $ax5toast-default-bg, $ax5toast-default-color);
  156. &.primary {
  157. @include toast-variant($ax5toast-primary-text, $ax5toast-primary-bg, $ax5toast-primary-color);
  158. }
  159. &.success {
  160. @include toast-variant($ax5toast-success-text, $ax5toast-success-bg, $ax5toast-success-color);
  161. }
  162. &.info {
  163. @include toast-variant($ax5toast-info-text, $ax5toast-info-bg, $ax5toast-info-color);
  164. }
  165. &.warning {
  166. @include toast-variant($ax5toast-warning-text, $ax5toast-warning-bg, $ax5toast-warning-color);
  167. }
  168. &.danger {
  169. @include toast-variant($ax5toast-danger-text, $ax5toast-danger-bg, $ax5toast-danger-color);
  170. }
  171. }
  172. &.bottom-left {
  173. left: 0;
  174. bottom: 0;
  175. .ax5-ui-toast {
  176. @include animation(ax-toast-top $ax5toast-easing-time $ax5toast-easing);
  177. &.removed {
  178. @include animation(ax-toast-removed-bottom $ax5toast-easing-time ease forwards);
  179. }
  180. &.destroy {
  181. @include animation(ax-toast-destroy $ax5toast-easing-time ease forwards);
  182. }
  183. }
  184. }
  185. &.bottom-right {
  186. right: 0;
  187. bottom: 0;
  188. .ax5-ui-toast {
  189. @include animation(ax-toast-top $ax5toast-easing-time $ax5toast-easing);
  190. &.removed {
  191. @include animation(ax-toast-removed-bottom $ax5toast-easing-time ease forwards);
  192. }
  193. &.destroy {
  194. @include animation(ax-toast-destroy $ax5toast-easing-time ease forwards);
  195. }
  196. }
  197. }
  198. &.top-left {
  199. left: 0;
  200. top: 0;
  201. .ax5-ui-toast {
  202. @include animation(ax-toast-bottom $ax5toast-easing-time $ax5toast-easing);
  203. &.removed {
  204. @include animation(ax-toast-removed-top $ax5toast-easing-time ease forwards);
  205. }
  206. &.destroy {
  207. @include animation(ax-toast-destroy $ax5toast-easing-time ease forwards);
  208. }
  209. }
  210. }
  211. &.top-right {
  212. right: 0;
  213. top: 0;
  214. .ax5-ui-toast {
  215. @include animation(ax-toast-bottom $ax5toast-easing-time $ax5toast-easing);
  216. &.removed {
  217. @include animation(ax-toast-removed-top $ax5toast-easing-time ease forwards);
  218. }
  219. &.destroy {
  220. @include animation(ax-toast-destroy $ax5toast-easing-time ease forwards);
  221. }
  222. }
  223. }
  224. }