CSS部分
* {
padding: 0;
margin: 0;
}
.box {
width: 300px;
height: 300px;
background-color: red;
margin: 200px auto;
transform: rotate(45deg) scale(.5);
animation: xd 3s infinite;
}
@keyframes xd {
25% {
transform: rotate(45deg) scale(1);
}
50% {
transform: rotate(45deg) scale(.5);
}
75% {
transform: rotate(45deg) scale(1);
}
100% {
transform: rotate(45deg) scale(.5);
}
}
.box::before {
content: '';
width: 300px;
height: 300px;
border-radius: 50%;
position: absolute;
background-color: red;
transform: translate(-150px);
}
.box::after {
content: '';
width: 300px;
height: 300px;
border-radius: 50%;
position: absolute;
background-color: red;
transform: translateY(-150px);
}
HTML部分
<div class="box"></div>

