<div class="light"></div>
</div>
<style>
.container{
border-radius: 50%
background: #49b0fd
width: 100px
height: 100px
}
.light{
width: 100px
height: 100px
box-shadow: 0 0 2px 2px rgba(0,0,0,1)
border-radius: 50%
transform-origin: center center
position: relative
animation: linear mymove 5s infinite
}
.light:after {
position: absolute
left: -5px
top: 50%
margin-top: -5px
content: ""
width: 10px
height: 10px
background: red
border-radius: 20px
}
@keyframes mymove{
from {transform:rotate(0deg)}
to {transform:rotate(360deg)}
}
</style>
老铁,看看这段,核心的样式写出来了,具体大小就由老铁自己去试着改啦。
几个注意点:1.两个容器最好一样大。2. 光点大小变了对应的 left和margin-top也要改。3.动画时间、动画缓动也可以改
戳我获取 完整源码