您的位置:首页 > Web前端 > CSS

CSS3动画——五个圆球的动画及音乐播放器和Loading图标

2017-08-18 15:32 387 查看
<!DOCTYPE html>

<html lang="en">

<head>
<meta charset="UTF-8">
<title>Document</title>
<style>

.boxMove ul {

    width: 800px;

    margin: 0 auto;

}

.boxMove ul li {
/*浮动*/
float:left;
position:absolute;
list-style: none;

  

}

 ul li b {

    width: 173px;

    height: 173px;

    background: url(../images/iconlist_1.png);

    display: block;



ul li#icon_2 {
margin-left: 150px;

}

 ul li#icon_2 b {

  background-position: -175px 0;

 }

 ul li#icon_3 {

  margin-left:300px;

 }

  ul li#icon_3 b {

  background-position:-347px 0px;

 

 }

 ul li#icon_4 {

  margin-left:450px;

 }

  ul li#icon_4 b {

  background-position:-525px 0px;

 

 }

 ul li#icon_5 {

  margin-left:600px;

 }

  ul li#icon_5 b {

  background-position:-696px 0px;

 

 }

 @keyframes move01 {

  from {

  transform: translateX(-350px);

  }

  to {

  transform:translateX(0);

  }

 }

 #icon_1 {animation: move01 3s linear;

 }

 @keyframes move02 {

  from {

  transform: translateX(-500px);

  }

  to {

  transform: translateX(0);

  }

 }

 #icon_2 {

  animation: move02 3.9s linear;

 }

 @keyframes move03 {

  from {

  transform: translateX(-650px);

  }

  to {

  transform: translateX(0);

  }

 }

 #icon_3 {

  animation: move03 4.8s linear;

 }

  @keyframes move04 {

  from {

  transform: translateX(-800px);

  }

  to {

  transform: translateX(0);

  }

 }

 #icon_4 {

  animation: move03 5.7s linear;

 }

  @keyframes move05 {

  from {

  transform: translateX(-950px);

  }

  to {

  transform: translateX(0);

  }

 }

 #icon_5 {

  animation: move03 6.6s linear;

 }

 /*网易云音乐图标样式*/

 @keyframes waveMusic {

  from {

  transform: scaleY(0.4);

  }

  to {

  transform: scaleY(1);

  }

 }

 .wave-wrapper {

  width: 150px;

  height: 30px;

  margin:50px  auto;

    font-size: 16px;

    text-align: center;

 }

 .wave-wrapper .w-rect {

  background-color: #333;

  height: 100%;

  width:6px;

  display:inline-block;

  animation: waveMusic 1.2s infinite ease-in-out;

 }

 .wave-wrapper .rect1 {

  animation-delay: -1.2s;

 }

  .wave-wrapper .rect2 {

  animation-delay: -1.1s;

 }

  .wave-wrapper .rect3 {

  animation-delay: -1.0s;

 }

  .wave-wrapper .rect4{

  animation-delay: -.9s;

 }

  .wave-wrapper .rect5 {

  animation-delay: -.8s;

 }

 /*loading图标的实现*/

.circle {

  height: 200px;

  width:200px;

  border-radius: 50%;

  position: relative;

  margin:0 auto;

}

@keyframes loading {

  from {

      transform: rotate(0deg);

  }

  to {

    transform: rotate(359deg);

  }

}

.circle .loading {

   width:160px;

   height:160px;

   border-radius: 100%;

   border-right:10px solid #F0E8E8;

   border-bottom:10px solid #F0E8E8;

   border-left:10px solid green;

   border-top:10px solid green;

  animation: loading 3s infinite linear;

}

.circle .font-loading {

  text-align: center;

    position: absolute;

    top: 23%;

    left: 27%;

    color: green;

    font-size: 23px;

}

</style>

</head>

<body>

<!-- start360卫士球 -->

<div class="boxMove">
<ul>
<li id="icon_1"><b></b></li>
<li id="icon_2"><b></b></li>
<li id="icon_3"><b></b></li>
<li id="icon_4"><b></b></li>
<li id="icon_5"><b></b></li>

    </ul>  

</div>

<!-- end360卫士球 -->

<!-- start网易云音乐图标 -->

<div class="wave-wrapper">
<div class="w-rect rect1"></div>
<div class="w-rect rect2"></div>
<div class="w-rect rect3"></div>
<div class="w-rect rect4"></div>
<div class="w-rect rect5"></div>

</div>

<!-- end网易云音乐图标 -->

<!--start loading 图标 -->

<div class="circle">
<div class="loading"></div>
<p class="font-loading">loading</p>

</div>

<!--end loading 图标 -->

</body>

</html>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: