body {
  height: 100vh;
  overflow: hidden;
  display: grid;
  place-items: center;
}

.loader {
  font-weight: bold;
  font-family: monospace;
  font-size: 30px;
  line-height: 1.2em;
  display: inline-grid;
}

.loader::after,
.loader::before {
  content: "Loading...";
  grid-area: 1/1;
  mask: linear-gradient(90deg, #000 50%, #0000 0) 0 50%/2ch 100%;
  color: #0000;
  text-shadow: 0 0 0 #000, 0 calc(var(--s, 1) * 1.2em) 0 #000;
  animation: loading 1s infinite;
}

.loader::after {
  mask-position: 1ch 50%;
  --s: -1;
}

@keyframes loading {
  80%,
  100% {
    text-shadow: 0 calc(var(--s, 1) * -1.2em) 0 #000, 0 0 0 #000;
  }
}
