标题CSS3 动画的永动
标题html部分
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<link rel="stylesheet" href="css/css.css">
</head>
<body>
<div class="container">
<div class="loader">
<div class="ball">
</div>
</div>
</div>
</body>
</html>
标题css部分
*{
margin: 0;
padding: 0;
}
body{
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
background-color: #1c2f3f;
}
.loader{
position: relative;
width: 200px;
height: 200px;
border-radius: 50%;
border: 20px solid transparent;
border-bottom-color: #06c8f9;
border-right-color: #06c8f9;
transform: rotate(45deg);
animation-name: move;
animation-duration: 4s;
animation-iteration-count: infinite;
animation-timing-function: ease-in-out;
animation-direction: alternate;
}
.container{
-webkit-box-reflect:below 5px
-webkit-linear-gradient(transparent 10%,rgba(0,0,0,0.5));
}
.ball{
position: absolute;
top:0;
left: 0;
width: 200px;
height: 200px;
animation-name: reveres;
animation-duration: 4s;
animation-iteration-count: infinite;
animation-timing-function: ease-in-out;
animation-direction: alternate;
}
.ball::before{
position: absolute;
content: '';
width: 30px;
height: 30px;
bottom: 20px;
left: 26px;
border-radius: 50%;
background-color: white;
}
@keyframes move{
0%{
transform: rotate(0);
}
100%{
transform: rotate(90deg);
}
}
@keyframes reveres{
0%{
transform: rotate(0);
}
100%{
transform: rotate(-180deg);
}
}