loader.css 1.5 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66
.loader {
  position: relative;
  width: 12.5em;
  height: 12.5em;
  transform: rotate(165deg);
}
.loader:before, .loader:after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  display: block;
  width: 2.5em;
  height: 2.5em;
  border-radius: 1.25em;
  transform: translate(-50%, -50%);
}
.loader:before {
  animation: before 2s infinite;
}
.loader:after {
  animation: after 2s infinite;
}
@keyframes before {
  0% {
    width: 2.5em;
    box-shadow: 5em -2.5em rgba(88, 163, 243, 0.75), -5em 2.5em rgba(153, 202, 255, 0.75);
 }
  35% {
    width: 12.5em;
    box-shadow: 0 -2.5em rgba(88, 163, 243, 0.75), 0 2.5em rgba(153, 202, 255, 0.75);
 }
  70% {
    width: 2.5em;
    box-shadow: -5em -2.5em rgba(88, 163, 243, 0.75), 5em 2.5em rgba(153, 202, 255, 0.75);
 }
  100% {
    box-shadow: 5em -2.5em rgba(88, 163, 243, 0.75), -5em 2.5em rgba(153, 202, 255, 0.75);
 }
}
@keyframes after {
  0% {
    height: 2.5em;
    box-shadow: 2.5em 5em rgba(224, 224, 224, 0.75), -2.5em -5em rgba(198, 200, 210, 0.75);
 }
  35% {
    height: 12.5em;
    box-shadow: 2.5em 0 rgba(224, 224, 224, 0.75), -2.5em 0 rgba(198, 200, 210, 0.75);
 }
  70% {
    height: 2.5em;
    box-shadow: 2.5em -5em rgba(224, 224, 224, 0.75), -2.5em 5em rgba(198, 200, 210, 0.75);
 }
  100% {
    box-shadow: 2.5em 5em rgba(224, 224, 224, 0.75), -2.5em -5em rgba(198, 200, 210, 0.75);
 }
}
/** * Attempt to center the whole thing! */
html, body {
  height: 100%;
}
.loader {
  position: absolute;
  top: calc(50% - 6.25em);
  left: calc(50% - 6.25em);
}