给每一个圆的旋转动画设置延迟时间,使得球体在旋转的同时像彩色
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<style>
body{
overflow: hidden; /*溢出隐藏*/
}
.circle{ /*设置圆的大小颜色位置*/
width:150px;
height: 150px;
border: 1px solid red;
margin: auto;
border-radius: 50%;
position: absolute;
left:0px;
top:0px;
right:0px;
bottom:0px;
}
@keyframes run{ /*创建动画*/
0%{
transform: rotate3d(0,0,0,0deg);
border-color: tomato;
}
25%{
border-color:green;
}
50%{
border-color: blue;
}
75%{
border-color: yellow;
}
100%{
border-color: orangered;
transform: rotate3d(1,1,1,360deg);
}
}
</style>
</head>
<body>
<!-- 动画名称 完成动画的时间(s/ms) 曲线速度 延迟时间 动画播放的次数 -->
<div class="circle" style="animation: run 2s linear 0.1s infinite;"></div>
<div class="circle" style="animation: run 2s linear 0.2s infinite;"></div>
<div class="circle" style="animation: run 2s linear 0.3s infinite;"></div>
<div class="circle" style="animation: run 2s linear 0.4s infinite;"></div>
<div class="circle" style="animation: run 2s linear 0.5s infinite;"></div>
<div class="circle" style="animation: run 2s linear 0.6s infinite;"></div>
<div class="circle" style="animation: run 2s linear 0.7s infinite;"></div>
<div class="circle" style="animation: run 2s linear 0.8s infinite;"></div>
<div class="circle" style="animation: run 2s linear 0.9s infinite;"></div>
<div class="circle" style="animation: run 2s linear 1s infinite;"> </div>
<div class="circle" style="animation: run 2s linear 1.2s infinite;"></div>
<div class="circle" style="animation: run 2s linear 1.3s infinite;"></div>
<div class="circle" style="animation: run 2s linear 1.4s infinite;"></div>
<div class="circle" style="animation: run 2s linear 1.5s infinite;"></div>
</body>
</html>
transform 3D
transform:rotateX(); 前后旋转
transform:rotateY() 左右旋转
transform:rotateZ(); 平面旋转
transform:rotate3d(x,y,z,deg); x,y,z分别代表xyz轴是否旋转
0不旋转,1旋转