_pace-demo.scss 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413
  1. /* ------------------------------------------------------------------------------
  2. *
  3. * # Progress (loading) bars
  4. *
  5. * Static demo of Pace themes. For demonstration purposes only. DO NOT use it in production
  6. *
  7. * ---------------------------------------------------------------------------- */
  8. // Check if component is enabled
  9. @if $enable-demo {
  10. // Dark squares for pace themes
  11. // ------------------------------
  12. .pace-demo {
  13. display: inline-block;
  14. background-color: $color-slate-800;
  15. vertical-align: middle;
  16. position: relative;
  17. line-height: 1;
  18. @include border-radius($border-radius);
  19. @include size(88px);
  20. .pace_progress {
  21. display: none;
  22. white-space: nowrap;
  23. }
  24. }
  25. // Xbox Mini theme
  26. // ------------------------------
  27. .theme_xbox {
  28. position: absolute;
  29. top: 50%;
  30. left: 0;
  31. right: 0;
  32. margin-top: -24px;
  33. // Activity
  34. .pace_activity {
  35. animation: rotation 1.5s ease-in-out infinite;
  36. margin: auto;
  37. @include size(48px);
  38. &,
  39. &:before,
  40. &:after {
  41. border: 2px solid transparent;
  42. border-top-color: $white;
  43. border-radius: $border-radius-circle;
  44. }
  45. &:before {
  46. content: "";
  47. position: absolute;
  48. top: 5px;
  49. left: 5px;
  50. right: 5px;
  51. bottom: 5px;
  52. animation: rotation ease-in-out 2s infinite;
  53. }
  54. &:after {
  55. content: "";
  56. position: absolute;
  57. top: 12px;
  58. left: 12px;
  59. right: 12px;
  60. bottom: 12px;
  61. animation: rotation ease-in-out 1s infinite;
  62. }
  63. }
  64. }
  65. // Add % text
  66. .theme_xbox_with_text {
  67. .pace_activity {
  68. margin-top: -10px;
  69. }
  70. span {
  71. display: block;
  72. margin-top: 10px;
  73. color: $white;
  74. white-space: nowrap;
  75. }
  76. }
  77. // Xbox Small theme
  78. // ------------------------------
  79. .theme_xbox_sm {
  80. @extend .theme_xbox;
  81. .pace_activity {
  82. &,
  83. &:before,
  84. &:after {
  85. border-width: 1px;
  86. }
  87. }
  88. }
  89. // Xbox theme
  90. // ------------------------------
  91. .theme_xbox_lg {
  92. @extend .theme_xbox;
  93. .pace_activity {
  94. &,
  95. &:before,
  96. &:after {
  97. border-width: 3px;
  98. }
  99. }
  100. }
  101. // Perspective theme
  102. // ------------------------------
  103. .theme_perspective {
  104. position: absolute;
  105. top: 50%;
  106. left: 0;
  107. right: 0;
  108. margin-top: -15px;
  109. .pace_activity {
  110. display: inline-block;
  111. background-color: $white;
  112. animation: perspective ease-in-out 1.2s infinite;
  113. @include size(30px);
  114. }
  115. }
  116. @keyframes perspective {
  117. 0% { transform: perspective(120px); }
  118. 50% { transform: perspective(120px) rotateY(180deg); }
  119. 100% { transform: perspective(120px) rotateY(180deg) rotateX(180deg); }
  120. }
  121. @-webkit-keyframes perspective {
  122. 0% { -webkit-transform: perspective(120px); }
  123. 50% { -webkit-transform: perspective(120px) rotateY(180deg); }
  124. 100% { -webkit-transform: perspective(120px) rotateY(180deg) rotateX(180deg); }
  125. }
  126. @-moz-keyframes perspective {
  127. 0% { -moz-transform: perspective(120px); }
  128. 50% { -moz-transform: perspective(120px) rotateY(180deg); }
  129. 100% { -moz-transform: perspective(120px) rotateY(180deg) rotateX(180deg); }
  130. }
  131. .theme_perspective_with_text {
  132. .pace_activity {
  133. margin-top: -12px;
  134. }
  135. span {
  136. display: block;
  137. margin-top: 15px;
  138. color: $white;
  139. white-space: nowrap;
  140. }
  141. }
  142. // Squares theme
  143. // ------------------------------
  144. .theme_squares {
  145. position: absolute;
  146. top: 50%;
  147. left: 0;
  148. right: 0;
  149. margin-top: -15px;
  150. // Activity
  151. .pace_activity {
  152. width: 30px;
  153. height: 30px;
  154. margin: auto;
  155. &:before,
  156. &:after {
  157. position: absolute;
  158. content: "";
  159. border: 2px solid $white;
  160. }
  161. &:before {
  162. width: 30px;
  163. height: 30px;
  164. margin-left: -15px;
  165. animation: rotation_reverse linear 2s infinite;
  166. }
  167. &:after {
  168. width: 20px;
  169. height: 20px;
  170. margin-left: -10px;
  171. margin-top: 5px;
  172. animation: rotation linear 2s infinite;
  173. }
  174. }
  175. }
  176. // Text
  177. .theme_squares_with_text {
  178. .pace_activity {
  179. margin-top: -12px;
  180. }
  181. span {
  182. display: block;
  183. margin-top: 15px;
  184. color: $white;
  185. white-space: nowrap;
  186. }
  187. }
  188. // Tail theme
  189. // ------------------------------
  190. .theme_tail {
  191. position: absolute;
  192. top: 50%;
  193. left: 0;
  194. right: 0;
  195. margin-top: -15px;
  196. // Activity
  197. .pace_activity {
  198. margin: auto;
  199. width: 30px;
  200. height: 30px;
  201. border: 3px solid transparent;
  202. border-left-color: $white;
  203. border-radius: 50%;
  204. animation: rotation linear 1.1s infinite;
  205. }
  206. }
  207. // Circle tail theme
  208. .theme_tail_circle {
  209. .pace_activity {
  210. border-color: rgba($black, 0.15);
  211. border-left-color: $white;
  212. }
  213. }
  214. // Text
  215. .theme_tail_with_text {
  216. .pace_activity {
  217. margin-top: -12px;
  218. }
  219. span {
  220. display: block;
  221. margin-top: 15px;
  222. color: $white;
  223. white-space: nowrap;
  224. }
  225. }
  226. // Corners theme
  227. // ------------------------------
  228. .theme_corners {
  229. position: absolute;
  230. top: 50%;
  231. left: 0;
  232. right: 0;
  233. margin-top: -(14px / 2);
  234. // Activity
  235. .pace_activity {
  236. display: inline-block;
  237. background-color: $white;
  238. vertical-align: middle;
  239. border-radius: 50%;
  240. animation: corners ease 1.5s infinite;
  241. @include size(14px);
  242. }
  243. }
  244. // Animation
  245. @keyframes corners {
  246. 0% { transform: scale(1) rotate(0deg); }
  247. 50% { border-radius: 0; transform: scale(2) rotate(-180deg); }
  248. 100% { transform: scale(1) rotate(-360deg); }
  249. }
  250. @-webkit-keyframes corners {
  251. 0% { -webkit-transform: scale(1) rotate(0deg); }
  252. 50% { border-radius: 0; -webkit-transform: scale(2) rotate(-180deg); }
  253. 100% { -webkit-transform: scale(1) rotate(-360deg); }
  254. }
  255. @-moz-keyframes corners {
  256. 0% { -moz-transform: scale(1) rotate(0deg); }
  257. 50% { border-radius: 0; -moz-transform: scale(2) rotate(-180deg); }
  258. 100% { -moz-transform: scale(1) rotate(-360deg); }
  259. }
  260. // Text
  261. .theme_corners_with_text {
  262. .pace_activity {
  263. margin-top: -28px;
  264. }
  265. span {
  266. display: block;
  267. margin-top: 15px;
  268. color: $white;
  269. white-space: nowrap;
  270. }
  271. }
  272. // Radar theme
  273. // ------------------------------
  274. .theme_radar {
  275. position: absolute;
  276. top: 50%;
  277. left: 0;
  278. right: 0;
  279. margin-top: -15px;
  280. // Activity
  281. .pace_activity {
  282. display: inline-block;
  283. width: 30px;
  284. height: 30px;
  285. border-radius: 50%;
  286. border: 2px solid transparent;
  287. border-top-color: $white;
  288. border-bottom-color: $white;
  289. animation: rotation linear 1.1s infinite;
  290. }
  291. }
  292. // Text
  293. .theme_radar_with_text {
  294. .pace_activity {
  295. margin-top: -12px;
  296. }
  297. span {
  298. display: block;
  299. margin-top: 15px;
  300. color: $white;
  301. white-space: nowrap;
  302. }
  303. }
  304. // Bar theme
  305. // ------------------------------
  306. // Default
  307. .theme_bar {
  308. position: relative;
  309. width: 200px;
  310. height: 5px;
  311. background-color: rgba($black, 0.4);
  312. border-radius: 100px;
  313. box-shadow: 0 0 5px rgba($white, 0.1);
  314. .pace_progress {
  315. max-width: 198px;
  316. display: block;
  317. position: absolute;
  318. left: 1px;
  319. top: 1px;
  320. height: 3px;
  321. background: #3FCF96;
  322. color: $white;
  323. line-height: 36px;
  324. border-radius: 100px;
  325. }
  326. }
  327. // Large
  328. .theme_bar_lg {
  329. @extend .theme_bar;
  330. height: 6px;
  331. .pace_progress {
  332. height: 4px;
  333. }
  334. }
  335. // Small
  336. .theme_bar_sm {
  337. @extend .theme_bar;
  338. height: 4px;
  339. .pace_progress {
  340. height: 2px;
  341. }
  342. }
  343. }