body {
  background-color: #e8e8e8;
  height: 90vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

.loader {
  display: inline-block;
  width: 44px;
  height: 44px;
  position: relative;
  margin: 0 15px;
}

.loader::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  position: absolute;
  display: block;
  background-color: blue;
  top: 37px;
  left: 19px;
  transform: translate(-18px, -18px);
  animation: dotRect 3s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.loader.triangle::before {
  left: 21px;
  transform: translate(-10px, -18px);
  animation: dotTriangle 3s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}
.loader.triangle {
  width: 48px;
}

.loader svg {
  display: block;
  fill: none;
  stroke: black;
  stroke-width: 10px;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.loader svg circle {
  stroke-dasharray: 150 50 150 50;
  stroke-dashoffset: 75;
  animation: pathCircle 3s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.loader svg polygon {
  stroke-dasharray: 145 76 145 76;
  stroke-dashoffset: 0;
  animation: pathTriangle 3s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.loader svg rect {
  stroke-dasharray: 192 64 192 64;
  stroke-dashoffset: 0;
  animation: pathRect 3s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes pathCircle {
  25% {
    stroke-dashoffset: 125;
  }
  50% {
    stroke-dashoffset: 175;
  }
  75% {
    stroke-dashoffset: 225;
  }
  100% {
    stroke-dashoffset: 275;
  }
}

@keyframes dotRect {
  25% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(18px, -18px);
  }
  75% {
    transform: translate(0, -36px);
  }
  100% {
    transform: translate(-18px, -18px);
  }
}

@keyframes pathTriangle {
  33% {
    stroke-dashoffset: 74;
  }
  66% {
    stroke-dashoffset: 147;
  }
  100% {
    stroke-dashoffset: 221;
  }
}
@keyframes dotTriangle {
  33% {
    transform: translate(0, 0);
  }
  66% {
    transform: translate(10px, -18px);
  }
  100% {
    transform: translate(-10px, -18px);
  }
}

@keyframes pathRect {
  25% {
    stroke-dashoffset: 64;
  }
  50% {
    stroke-dashoffset: 128;
  }
  75% {
    stroke-dashoffset: 192;
  }
  100% {
    stroke-dashoffset: 256;
  }
}