loader.css 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351
  1. @charset "UTF-8";
  2. /* mixins & extensions */
  3. @keyframes in {
  4. 0% {
  5. opacity: 0;
  6. }
  7. 100% {
  8. opacity: 1;
  9. }
  10. }
  11. @keyframes in-down {
  12. 0% {
  13. opacity: 0;
  14. transform: translate3D(0, -5px, 0);
  15. }
  16. 100% {
  17. opacity: 1;
  18. transform: translate3D(0, 0, 0);
  19. }
  20. }
  21. @keyframes in-up {
  22. 0% {
  23. opacity: 0;
  24. transform: translate3D(0, 5px, 0);
  25. }
  26. 100% {
  27. opacity: 1;
  28. transform: translate3D(0, 0, 0);
  29. }
  30. }
  31. @keyframes in-scale {
  32. 0% {
  33. opacity: 0;
  34. transform: scale3D(0.95, 0.95, 1);
  35. }
  36. 100% {
  37. opacity: 1;
  38. transform: scale3D(1, 1, 1);
  39. }
  40. }
  41. :root {
  42. --calcite-animation-timing: calc(150ms * var(--calcite-internal-duration-factor));
  43. --calcite-internal-duration-factor: var(--calcite-duration-factor, 1);
  44. --calcite-internal-animation-timing-fast: calc(100ms * var(--calcite-internal-duration-factor));
  45. --calcite-internal-animation-timing-medium: calc(200ms * var(--calcite-internal-duration-factor));
  46. --calcite-internal-animation-timing-slow: calc(300ms * var(--calcite-internal-duration-factor));
  47. }
  48. .calcite-animate {
  49. opacity: 0;
  50. animation-fill-mode: both;
  51. animation-duration: var(--calcite-animation-timing);
  52. }
  53. .calcite-animate__in {
  54. animation-name: in;
  55. }
  56. .calcite-animate__in-down {
  57. animation-name: in-down;
  58. }
  59. .calcite-animate__in-up {
  60. animation-name: in-up;
  61. }
  62. .calcite-animate__in-scale {
  63. animation-name: in-scale;
  64. }
  65. /**
  66. * Currently only used in Checkbox.
  67. */
  68. :root {
  69. --calcite-popper-transition: var(--calcite-animation-timing);
  70. }
  71. :host([hidden]) {
  72. display: none;
  73. }
  74. /**
  75. * CSS Custom Properties
  76. *
  77. * These properties can be overridden using the component's tag as selector.
  78. *
  79. * @prop --calcite-loader-font-size: when type is determinate, the font-size of the loader percentage
  80. * @prop --calcite-loader-size: the width and height of a non-inline loader
  81. * @prop --calcite-loader-size-inline: the width and height of an inline loader
  82. */
  83. :host{
  84. position: relative;
  85. margin-left: auto;
  86. margin-right: auto;
  87. display: none;
  88. align-items: center;
  89. justify-content: center;
  90. padding-top: 4rem;
  91. padding-bottom: 4rem;
  92. opacity: 1;
  93. min-height: var(--calcite-loader-size);
  94. font-size: var(--calcite-loader-font-size);
  95. stroke: var(--calcite-ui-brand);
  96. stroke-width: 3;
  97. fill: none;
  98. transform: scale(1, 1);
  99. animation: loader-color-shift 6s alternate-reverse infinite linear;
  100. }
  101. :host([scale=s]) {
  102. --calcite-loader-font-size: var(--calcite-font-size--2);
  103. --calcite-loader-size: 2rem;
  104. --calcite-loader-size-inline: 0.75rem;
  105. }
  106. :host([scale=m]) {
  107. --calcite-loader-font-size: var(--calcite-font-size-0);
  108. --calcite-loader-size: 4rem;
  109. --calcite-loader-size-inline: 1rem;
  110. }
  111. :host([scale=l]) {
  112. --calcite-loader-font-size: var(--calcite-font-size-2);
  113. --calcite-loader-size: 6rem;
  114. --calcite-loader-size-inline: 1.5rem;
  115. }
  116. :host([no-padding]){
  117. padding-top: 0px;
  118. padding-bottom: 0px;
  119. }
  120. :host{
  121. display: none;
  122. }
  123. :host([active]){
  124. display: flex;
  125. }
  126. .loader__text{
  127. display: block;
  128. text-align: center;
  129. font-size: var(--calcite-font-size--2);
  130. line-height: 1rem;
  131. color: var(--calcite-ui-text-1);
  132. margin-top: calc(var(--calcite-loader-size) + 1.5rem);
  133. }
  134. .loader__percentage{
  135. position: absolute;
  136. display: block;
  137. text-align: center;
  138. color: var(--calcite-ui-text-1);
  139. font-size: var(--calcite-loader-font-size);
  140. width: var(--calcite-loader-size);
  141. left: 50%;
  142. margin-left: calc(var(--calcite-loader-size) / 2 * -1);
  143. line-height: 0.25;
  144. transform: scale(1, 1);
  145. }
  146. .loader__svgs{
  147. position: absolute;
  148. overflow: visible;
  149. opacity: 1;
  150. width: var(--calcite-loader-size);
  151. height: var(--calcite-loader-size);
  152. left: 50%;
  153. margin-left: calc(var(--calcite-loader-size) / 2 * -1);
  154. transform: scale(1, 1);
  155. }
  156. .loader__svg{
  157. position: absolute;
  158. top: 0px;
  159. left: 0px;
  160. transform-origin: center;
  161. overflow: visible;
  162. width: var(--calcite-loader-size);
  163. height: var(--calcite-loader-size);
  164. animation-iteration-count: infinite;
  165. animation-timing-function: linear;
  166. animation-name: loader-clockwise;
  167. }
  168. @supports (display: grid) {
  169. .loader__svg--1 {
  170. animation-name: loader-offset-1;
  171. }
  172. .loader__svg--2 {
  173. animation-name: loader-offset-2;
  174. }
  175. .loader__svg--3 {
  176. animation-name: loader-offset-3;
  177. }
  178. }
  179. :host([type=determinate]){
  180. animation: none;
  181. stroke: var(--calcite-ui-border-3);
  182. }
  183. :host([type=determinate]) .loader__svg--3{
  184. animation: none;
  185. stroke: var(--calcite-ui-brand);
  186. stroke-dasharray: 150.79632;
  187. transform: rotate(-90deg);
  188. transition: all var(--calcite-internal-animation-timing-fast) linear;
  189. }
  190. :host([inline]){
  191. position: relative;
  192. margin: 0px;
  193. animation: none;
  194. stroke: currentColor;
  195. stroke-width: 2;
  196. padding-top: 0px;
  197. padding-bottom: 0px;
  198. height: var(--calcite-loader-size-inline);
  199. min-height: var(--calcite-loader-size-inline);
  200. width: var(--calcite-loader-size-inline);
  201. margin-inline-end: calc(var(--calcite-loader-size-inline) * 0.5);
  202. vertical-align: calc(var(--calcite-loader-size-inline) * -1 * 0.2);
  203. }
  204. :host([active][inline]){
  205. display: inline-block;
  206. }
  207. :host([inline]) .loader__svgs{
  208. top: 0px;
  209. left: 0px;
  210. margin: 0px;
  211. width: var(--calcite-loader-size-inline);
  212. height: var(--calcite-loader-size-inline);
  213. }
  214. :host([inline]) .loader__svg {
  215. width: var(--calcite-loader-size-inline);
  216. height: var(--calcite-loader-size-inline);
  217. }
  218. :host([complete]){
  219. opacity: 0;
  220. transform: scale(0.75, 0.75);
  221. transform-origin: center;
  222. transition: opacity var(--calcite-internal-animation-timing-medium) linear 1000ms, transform var(--calcite-internal-animation-timing-medium) linear 1000ms;
  223. }
  224. :host([complete]) .loader__svgs{
  225. opacity: 0;
  226. transform: scale(0.75, 0.75);
  227. transform-origin: center;
  228. transition: opacity calc(180ms * var(--calcite-internal-duration-factor)) linear 800ms, transform calc(180ms * var(--calcite-internal-duration-factor)) linear 800ms;
  229. }
  230. :host([complete]) .loader__percentage {
  231. color: var(--calcite-ui-brand);
  232. transform: scale(1.05, 1.05);
  233. transform-origin: center;
  234. transition: color var(--calcite-internal-animation-timing-medium) linear, transform var(--calcite-internal-animation-timing-medium) linear;
  235. }
  236. /**
  237. Segment variables
  238. - i index (1-3)
  239. - size length of the segment (0 - 100)
  240. - growth how much the segment grows during the animation
  241. (size + growth should not exceed 100)
  242. - duration how long the segment takes to rotate 360° (seconds)
  243. */
  244. .loader__svg--1 {
  245. stroke-dasharray: 27.9252444444% 139.6262222222%;
  246. animation-duration: 0.72s;
  247. }
  248. @keyframes loader-offset-1 {
  249. 0% {
  250. stroke-dasharray: 27.9252444444% 251.3272%;
  251. stroke-dashoffset: 0;
  252. }
  253. 50% {
  254. stroke-dasharray: 139.6262222222% 139.6262222222%;
  255. stroke-dashoffset: -83.7757333333%;
  256. }
  257. 100% {
  258. stroke-dasharray: 27.9252444444% 251.3272%;
  259. stroke-dashoffset: -279.2524444444%;
  260. }
  261. }
  262. .loader__svg--2 {
  263. stroke-dasharray: 55.8504888889% 139.6262222222%;
  264. animation-duration: 0.96s;
  265. }
  266. @keyframes loader-offset-2 {
  267. 0% {
  268. stroke-dasharray: 55.8504888889% 223.4019555556%;
  269. stroke-dashoffset: 0;
  270. }
  271. 50% {
  272. stroke-dasharray: 139.6262222222% 139.6262222222%;
  273. stroke-dashoffset: -97.7383555556%;
  274. }
  275. 100% {
  276. stroke-dasharray: 55.8504888889% 223.4019555556%;
  277. stroke-dashoffset: -279.2524444444%;
  278. }
  279. }
  280. .loader__svg--3 {
  281. stroke-dasharray: 13.9626222222% 139.6262222222%;
  282. animation-duration: 1.16s;
  283. }
  284. @keyframes loader-offset-3 {
  285. 0% {
  286. stroke-dasharray: 13.9626222222% 265.2898222222%;
  287. stroke-dashoffset: 0;
  288. }
  289. 50% {
  290. stroke-dasharray: 139.6262222222% 139.6262222222%;
  291. stroke-dashoffset: -76.7944222222%;
  292. }
  293. 100% {
  294. stroke-dasharray: 13.9626222222% 265.2898222222%;
  295. stroke-dashoffset: -279.2524444444%;
  296. }
  297. }
  298. @keyframes loader-color-shift {
  299. 0% {
  300. stroke: var(--calcite-ui-brand);
  301. }
  302. 33% {
  303. stroke: var(--calcite-ui-brand-press);
  304. }
  305. 66% {
  306. stroke: var(--calcite-ui-brand-hover);
  307. }
  308. 100% {
  309. stroke: var(--calcite-ui-brand);
  310. }
  311. }
  312. @keyframes loader-clockwise {
  313. 0% {
  314. transform: rotate(0deg);
  315. }
  316. 100% {
  317. transform: rotate(360deg);
  318. }
  319. }