_theme-perspective.scss 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. /* ------------------------------------------------------------------------------
  2. *
  3. * # Pace. Perspective theme
  4. *
  5. * Perspective css spinner theme for Pace.
  6. *
  7. * ---------------------------------------------------------------------------- */
  8. // Check if component is enabled
  9. @if $enable-pace {
  10. // Define variables
  11. $pace-show-text: true;
  12. $pace-overlay-color: $color-slate-900;
  13. $pace-loader-color: $white;
  14. $pace-loader-size: 1.5rem;
  15. // Pace theme styles
  16. // ------------------------------
  17. // Overlay
  18. .pace-running {
  19. position: fixed;
  20. top: 0;
  21. left: 0;
  22. width: 100%;
  23. height: 100%;
  24. background-color: $pace-overlay-color;
  25. // Hide all content
  26. > *:not(.pace) {
  27. opacity: 0;
  28. }
  29. }
  30. // Base
  31. .pace {
  32. position: fixed;
  33. top: 50%;
  34. left: 0;
  35. right: 0;
  36. margin-top: -($pace-loader-size / 2);
  37. pointer-events: none;
  38. user-select: none;
  39. z-index: 9999;
  40. // Change colors on light/dark backgrounds
  41. @if (lightness($pace-overlay-color) < 75) {
  42. color: $white;
  43. }
  44. }
  45. // Progress
  46. .pace-progress {
  47. width: 100% !important;
  48. }
  49. // Activity
  50. .pace-activity {
  51. position: absolute;
  52. top: 0;
  53. left: 0;
  54. right: 0;
  55. margin: auto;
  56. background-color: $pace-loader-color;
  57. animation: perspective 1.2s infinite ease-in-out;
  58. @include size($pace-loader-size);
  59. @include border-radius($border-radius-sm);
  60. }
  61. // Hide inactive
  62. .pace-inactive {
  63. display: none;
  64. }
  65. // Progress text
  66. @if $pace-show-text {
  67. .pace-progress:after {
  68. content: attr(data-progress-text);
  69. text-align: center;
  70. width: 100%;
  71. display: inline-block;
  72. white-space: nowrap;
  73. margin-top: $pace-loader-size + ($spacer / 1.5);
  74. }
  75. }
  76. // Animations
  77. @keyframes perspective {
  78. 0% { transform: perspective(7.5rem); }
  79. 50% { transform: perspective(7.5rem) rotateY(180deg); }
  80. 100% { transform: perspective(7.5rem) rotateY(180deg) rotateX(180deg); }
  81. }
  82. @-webkit-keyframes perspective {
  83. 0% { -webkit-transform: perspective(7.5rem); }
  84. 50% { -webkit-transform: perspective(7.5rem) rotateY(180deg); }
  85. 100% { -webkit-transform: perspective(7.5rem) rotateY(180deg) rotateX(180deg); }
  86. }
  87. @-moz-keyframes perspective {
  88. 0% { -moz-transform: perspective(7.5rem); }
  89. 50% { -moz-transform: perspective(7.5rem) rotateY(180deg); }
  90. 100% { -moz-transform: perspective(7.5rem) rotateY(180deg) rotateX(180deg); }
  91. }
  92. }