Preloader HTML & CSS Style 1

Publikasi pada Preloader tanggal 11 May 2020 oleh Sugeng Sulistiyawan ‐ 1 mnt membaca

Preloader HTML & CSS Style 1

Preloader HTML & CSS Style 1.

Very Simple Loader menggunakan HTML & CSS saja Style 1.



CSS

#preloader {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background-color: #d50000;
}

#preloader > .loader {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 146px;
  padding: 16px 40px;
  transform: translate(-50%, -50%);
}

#preloader > .loader > .dot,
#preloader > .loader > .dots > span {
  width: 24px;
  height: 24px;
  background-color: #fff;
}

#preloader > .loader > .dot {
  position: absolute;
  animation: dot 1.2s infinite;
  transform: translateX(0);
}

#preloader > .loader > .dots {
  animation: dots 1.2s infinite;
  transform: translateX(32px);
}

#preloader > .loader > .dots > span {
  display: block;
  float: left;
  margin-left: 8px;
  margin-right: 8px;
}

/* animation */
@keyframes dot {
  50% {
    transform: translateX(120px);
  }
}

@keyframes dots {
  50% {
    transform: translateX(-8px);
  }
}

HTML

<div id="preloader">
  <div class="loader">
    <span class="dot"></span>
    <div class="dots">
      <span></span>
      <span></span>
      <span></span>
    </div>
  </div>
</div>

Demo & Preview:

See the Pen Preloader 1 by Sugeng Sulistiyawan (@sugeng-sulistiyawan) on CodePen.