根據CSS3 寫一個類似於語音助手動畫的 ,那種上下不停起伏的效果
源碼如下
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>語音助手</title>
<style type="text/css">
@keyframes yuying1{
0%{
height: 0%;
}
20%{
height: 50%;
}
50%{
height: 100%;
}
80%{
height: 50%;
}
100%{
height: 0%;
}
}
#container{
width: 200px;
height: 50px;
margin: 200px auto;
}
#container #one{
animation:yuying1 0.6s infinite 0.1s;
-webkit-animation:yuying1 0.6s infinite 0.1s;
}
#container #two{
animation:yuying1 0.6s infinite 0.2s;
-webkit-animation:yuying1 0.6s infinite 0.2s;
}
#container #three{
animation:yuying1 0.6s infinite 0.3s;
-webkit-animation:yuying1 0.6s infinite 0.3s;
}
#container #four{
animation:yuying1 0.6s infinite 0.4s;
-webkit-animation:yuying1 0.6s infinite 0.4s;
}
#container #five{
animation:yuying1 0.6s infinite 0.5s;
-webkit-animation:yuying1 0.6s infinite 0.5s;
}
#one,#two,#three,#four,#five{
width:6px;
height: 100%;
margin-left: 10px;
border-radius: 50px;
background-color: #999;
vertical-align: middle;
display: inline-block;
}
</style>
</head>
<body>
<div id="container">
<div id="one"></div>
<div id="two"></div>
<div id="three"></div>
<div id="four"></div>
<div id="five"></div>
</div>
</body>
</html>
打開網頁查看動畫效果