感谢网友:络擎的代码贡献
感谢文末作者
直接上代码
<!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 type="text/css">
.container{
display:flex
}
.box{
width: 100px;
height: 200px;
position: relative;
overflow: hidden;
/*background: pink;*/
}
.leftcircle{
width: 160px;
height: 160px;
border: 20px solid white;
position: absolute;
border-radius: 50%;
left: 0px;
top:0px;
border-bottom: 20px solid orange;
border-left: 20px solid orange;
transform: rotate(45deg);
animation-name:circle_left;
animation-duration: 2s;
animation-timing-function: linear;
animation-iteration-count: infinite;
}
.rightcircle {
width: 160px;
height: 160px;
border-radius: 50%;
border: 20px solid white;
position: absolute;
border-top: 20px solid orange;
border-right: 20px solid orange;
right: 0;
top: 0;
animation-name: circle_right;
animation-duration: 2s;
animation-timing-function: linear;
animation-iteration-count: infinite;
transform: rotate(-135deg);
}
@keyframes circle_right {
0% {
transform: rotate(-135deg);
}
50%,100% {
transform: rotate(45deg);
}
}
@keyframes circle_left {
0%,50% {
transform: rotate(-136deg);
}
100% {
transform: rotate(45deg);
}
}
</style>
</head>
<body>
<!-- <div class="demo"></div> -->
<div class='container'>
<div class="box">
<div class="leftcircle"></div>
</div>
<div class="box">
<div class="rightcircle"></div>
</div>
</div>
</body>
</html>
匀速滚动的核心点
animation-timing-function: linear;