实现CSS3五连珠加载等待效果

快乐打工仔 分类:实例代码

CSS3五连珠加载等待效果属于前端实例代码,有关更多实例代码大家可以查看

加载等待效果实在非常的多,比较常见的就是旋转效果。

下面再分享一个五连珠加载等待效果,代码实例如下:

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="author" content="http://www.pipipi.net/" />
<title>犀牛前端部落</title>
<style>
.spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 11;
  width: 120px;
  margin-left: -60px;
  margin-top: -6px;
  text-align: center;
}
.spinner > div {
  width: 12px;
  height: 12px;
  background-color: #67CF22;
  border-radius: 100%;
  display: inline-block;
  -webkit-animation: bouncedelay 2.8s infinite ease-in-out;
  animation: bouncedelay 2.8s infinite ease-in-out;
  -webkit-animation-fill-mode: both;
  animation-fill-mode: both;
}
.spinner .bounce1 {
  background-color: #cd402e;
}
.spinner .bounce2 {
  -webkit-animation-delay: -0.16s;
  animation-delay: -0.16s;
  background-color: #b07da8;
}
.spinner .bounce3 {
  -webkit-animation-delay: -0.32s;
  animation-delay: -0.32s;
  background-color: #f1b428;
}
.spinner .bounce4 {
  -webkit-animation-delay: -0.48s;
  animation-delay: -0.48s;
  background-color: #06AAA2;
}
.spinner .bounce5 {
  -webkit-animation-delay: -0.64s;
  animation-delay: -0.64s;
  background-color: #FF0909;
}
@-webkit-keyframes bouncedelay {
  0% {
    -webkit-transform: translate(-400px,0);
    opacity: 0;
  }
  35%,65% {
    -webkit-transform: translate(0,0);
    opacity: 1;
  }
  100% {
    -webkit-transform: translate(400px,0);
    opacity: 0;
  }
}
@keyframes bouncedelay {
  0% {
    transform: translate(-400px,0);
    opacity: 0;
  }
  35%,65% {
    transform: translate(0,0);
    opacity: 1;
  }
  100% {
    transform: translate(400px,0);
    opacity: 0;
  }
}
</style>
</head>
<body>
  <div class="spinner">
    <div class="bounce1"></div>
    <div class="bounce2"></div>
    <div class="bounce3"></div>
    <div class="bounce4"></div>
    <div class="bounce5"></div>
  </div>
</body>
</html>

CSS3五连珠加载等待效果,这样的场景在实际项目中还是用的比较多的,关于CSS3五连珠加载等待效果就介绍到这了。

回复

我来回复
  • 暂无回复内容