_status.scss 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. @keyframes status-pulsate-main {
  2. 40% {
  3. transform: scale(1.25, 1.25);
  4. }
  5. 60% {
  6. transform: scale(1.25, 1.25);
  7. }
  8. }
  9. @keyframes status-pulsate-secondary {
  10. 10% {
  11. transform: scale(1, 1)
  12. }
  13. 30% {
  14. transform: scale(3, 3)
  15. }
  16. 80% {
  17. transform: scale(3, 3)
  18. }
  19. 100% {
  20. transform: scale(1, 1)
  21. }
  22. }
  23. @keyframes status-pulsate-tertiary {
  24. 25% {
  25. transform: scale(1, 1);
  26. }
  27. 80% {
  28. transform: scale(3, 3);
  29. opacity: 0;
  30. }
  31. 100% {
  32. transform: scale(3, 3);
  33. opacity: 0;
  34. }
  35. }
  36. //
  37. // Status
  38. //
  39. .status {
  40. --#{$prefix}status-height: #{$status-height};
  41. --#{$prefix}status-color: #{$text-secondary};
  42. --#{$prefix}status-color-rgb: #{to-rgb($text-secondary)};
  43. display: inline-flex;
  44. align-items: center;
  45. height: var(--#{$prefix}status-height);
  46. padding: .25rem .75rem;
  47. gap: .5rem;
  48. color: var(--#{$prefix}status-color);
  49. background: rgba(var(--#{$prefix}status-color-rgb), .1);
  50. font-size: $font-size-base;
  51. text-transform: none;
  52. letter-spacing: normal;
  53. border-radius: $border-radius-pill;
  54. font-weight: var(--#{$prefix}font-weight-medium);
  55. line-height: 1;
  56. margin: 0;
  57. .status-dot {
  58. background: var(--#{$prefix}status-color);
  59. }
  60. .icon {
  61. font-size: 1.25rem;
  62. }
  63. }
  64. .status-lite {
  65. border: var(--#{$prefix}border-width) var(--#{$prefix}border-style) var(--#{$prefix}border-color) !important;
  66. background: transparent !important;
  67. color: var(--#{$prefix}body-color) !important;
  68. }
  69. @each $name, $color in $theme-colors {
  70. .status-#{$name} {
  71. --#{$prefix}status-color: #{$color};
  72. --#{$prefix}status-color-rgb: #{to-rgb($color)};
  73. }
  74. }
  75. //
  76. // Status dot
  77. //
  78. .status-dot {
  79. --#{$prefix}status-dot-color: var(--#{$prefix}status-color, #{$text-secondary});
  80. --#{$prefix}status-size: #{$status-dot-size};
  81. position: relative;
  82. display: inline-block;
  83. width: var(--#{$prefix}status-size);
  84. height: var(--#{$prefix}status-size);
  85. background: var(--#{$prefix}status-dot-color);
  86. border-radius: $border-radius-pill;
  87. }
  88. .status-dot-animated {
  89. &:before {
  90. content: "";
  91. position: absolute;
  92. inset: 0;
  93. z-index: 0;
  94. background: inherit;
  95. border-radius: inherit;
  96. opacity: .6;
  97. animation: 1s linear 2s backwards infinite status-pulsate-tertiary;
  98. }
  99. }
  100. //
  101. // Status indicator
  102. //
  103. .status-indicator {
  104. --#{$prefix}status-indicator-size: 2.5rem;
  105. --#{$prefix}status-indicator-color: var(--#{$prefix}status-color, #{$text-secondary});
  106. display: block;
  107. position: relative;
  108. width: var(--#{$prefix}status-indicator-size);
  109. height: var(--#{$prefix}status-indicator-size);
  110. }
  111. .status-indicator-circle {
  112. --#{$prefix}status-circle-size: .75rem;
  113. position: absolute;
  114. left: 50%;
  115. top: 50%;
  116. margin: calc(var(--#{$prefix}status-circle-size) / -2) 0 0 calc(var(--#{$prefix}status-circle-size) / -2);
  117. width: var(--#{$prefix}status-circle-size);
  118. height: var(--#{$prefix}status-circle-size);
  119. border-radius: $border-radius-pill;
  120. background: var(--#{$prefix}status-color);
  121. &:nth-child(1) {
  122. z-index: 3;
  123. }
  124. &:nth-child(2) {
  125. z-index: 2;
  126. opacity: .1;
  127. }
  128. &:nth-child(3) {
  129. z-index: 1;
  130. opacity: .3;
  131. }
  132. }
  133. .status-indicator-animated {
  134. .status-indicator-circle {
  135. &:nth-child(1) {
  136. animation: 2s linear 1s infinite backwards status-pulsate-main;
  137. }
  138. &:nth-child(2) {
  139. animation: 2s linear 1s infinite backwards status-pulsate-secondary;
  140. }
  141. &:nth-child(3) {
  142. animation: 2s linear 1s infinite backwards status-pulsate-tertiary;
  143. }
  144. }
  145. }