生活情報オンライン

ITエンジニアが役立つ情報を発信します。

待ち時間のローディングサンプル1

Windows10っぽいサンプルです。HTML5 / CSS3 のみで作成しています。画像やjavascriptは使用していませんので、とっても簡単にアプリに取り込むことが出来ます。










<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>sample</title>
<link rel="stylesheet" href="sample.css">
</head>
<body>
<div class="load-container load-animation">
  <div class="loader"></div>
</div>
</body>
</html>
@charset "utf-8";

.load-container {
    width: 200px;
    height: 200px;
    background: rgba(33, 150, 243, 1);
    position: absolute;
}
.loader,
.loader:before,
.loader:after {
  background: #ffffff;
  animation: load-animation 1s infinite ease-in-out;
  width: 11px;
  height: 44px;
}
.loader {
  color: #ffffff;
  margin: calc(50% - 22px) auto;
  transform: translateZ(0);
  animation-delay: -0.16s;
}
.loader:before,
.loader:after {
  position: absolute;
  content: "";
}
.loader:before {
  left: -16.5px;
  animation-delay: -0.32s;
}
.loader:after {
  left: 16.5px;
}
@keyframes load-animation {
  0%,
  80%,
  100% {
    box-shadow: 0 0;
    height: 44px;
  }
  40% {
    box-shadow: 0 -22px;
    height: 55px;
  }
}