html,
body {
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: #000;
}

.loader {
  width: 150px;
  height: 150px;
  position: relative;
}

.loader span {
  position: absolute;
  box-sizing: border-box;
  border: 10px solid dimgray;
  border-radius: 2px;
}
.loader span:nth-child(1) {
  width: 100%;
  height: 100%;
}
.loader span:nth-child(2) {
  width: 70%;
  height: 70%;
  margin: 15%;
}
.loader span:nth-child(3) {
  width: 40%;
  height: 40%;
  margin: 30%;
}

.loader span::before,
.loader span::after {
  position: absolute;
  content: "";
  width: 10px;
  height: calc(50% + 10px);
  background-color: gold;
}
.loader span::before {
  top: -10px;
  left: -10px;
}
.loader span::after {
  bottom: -10px;
  right: -10px;
}

/* add animation */
@keyframes rotating {
  from {
    transform: rotateY(0);
  }
  to {
    transform: rotateY(360deg);
  }
}
.loader span {
  animation: rotating linear infinite;
}
.loader span:nth-child(1) {
  animation-duration: 4s;
}
.loader span:nth-child(2) {
  animation-duration: 2s;
}
.loader span:nth-child(3) {
  animation-duration: 1s;
}

.loader span:nth-child(1) {
  z-index: 3;
}
.loader span:nth-child(2) {
  z-index: 2;
}
.loader span:nth-child(3) {
  z-index: 1;
}
