效果图:
html代码:
<div class="taiji">
<div class="top"></div>
<div class="bottom"></div>
</div>
css代码:
body{
margin:0;
background-color:#ddd;
}
.taiji{
display:flex;
align-items:center;
height:400px;
width:400px;
margin:100px auto;
border-radius:50%;
background:linear-gradient(black 50%,white 50%);
animation:player1 1s infinite linear;
}
.top,.bottom{
width:200px;
height:200px;
border-radius:50%;
animation:player s infinite alternate linear;
}
.top{
background:radial-gradient(black 25%,white 25%);
transform-origin:0 50%;
}
.bottom{
background:radial-gradient(white 25%,black 25%);
transform-origin:100% 50%;
animation-delay:-1s;
}
@keyframes player{
from{
transform:scale(0.5);
}
to{
transform:scale(1.5);
}
}
@keyframes player1{
from{
transform:rotate(0);
}
to{
transform:rotate(360deg);
}