目录
一:大数据热点图
<style>
body {
background-color: #333;
}
.map {
position: relative;
width: 747px;
height: 616px;
background: url(../media/map.png) no-repeat;
margin: 0 auto;
}
.a {
position: absolute;
top: 230px;
right: 195px;
color: white;
}
.dot {
position: absolute;
width: 6px;
height: 6px;
background-color: #09f;
border-radius: 50%;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.a1,
.a2,
.a3 {
position: absolute;
width: 4px;
height: 4px;
border-radius: 50%;
box-shadow: 0 0 12px #009dfd;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
/* animation: name duration timing-function delay iteration-count direction fill-mode; */
animation: aa 1.3s linear infinite;
}
.a2 {
animation-delay: 0.4s;
}
.a3 {
animation-delay: 0.8s;
}
@keyframes aa {
0% {}
70% {
width: 40px;
height: 40px;
opacity: 1;
}
100% {
width: 70px;
height: 70px;
opacity: 0;
}
}
</style>
</head>
<body>
<div class="map">
<div class="a">
<div class="dot"></div>
<div class="a1"> </div>
<div class="a2"></div>
<div class="a3"></div>
</div>
</div>
</body>
二.速度曲线steps()步长
打印机效果:逐字打出
<style>
div {
overflow: hidden;
font-size: 20px;
width: 0;
height: 30px;
background-color: pink;
/* 让我们的文字强制一行内显示 */
white-space: nowrap;
/* steps 就是分几步来完成我们的动画 有了steps 就不要在写 ease 或者linear 了 */
animation: w 4s steps(10) forwards;
}
@keyframes w {
0% {
width: 0;
}
100% {
width: 200px;
}
}
</style>
</head>
<body>
<div>世纪佳缘我在这里等你</div>
</body>
三:奔跑的小熊
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
.black {
position: absolute;
height: 300px;
background-image: url(../media/bg2.png);
opacity: 0.2;
width: 1520px;
overflow: hidden;
animation: ss 10s infinite linear;
}
.s {
position: relative;
overflow: hidden;
height: 500px;
background: url(../media/bg1.png) repeat-x;
animation: ss 5s infinite linear;
}
.box {
top: 234px;
position: absolute;
width: 200px;
height: 100px;
background: url(../media/bear.png) no-repeat;
animation: aa 0.3s steps(8) infinite, bb 3s forwards;
}
@keyframes aa {
0% {
background-position: 0 0;
}
100% {
background-position: -1600px 0;
}
}
@keyframes bb {
0% {
left: 0;
}
100% {
left: 50%;
/* margin-left: -100px; */
transform: translateX(-50%);
}
}
@keyframes ss {
0% {
background-position: 0 0;
}
100% {
background-position: -3840px 0;
}
}
</style>
</head>
<body>
<div class="black">
</div>
<div class="s">
<div class="box">
</div>
</div>
</body>
</html>