效果图
只是简单的呼吸效果,您按照需求自己拓展即可。
![在这里插入图片描述](https://img-blog.csdnimg.cn/20201128125739868.gif#pic_cener)
代码
@keyframes light{
from{
opacity: 1;
}
to{
opacity: 0.2;
}
}
使用
.view{
animation-name: light;
animation-duration: 1s;
animation-timing-function: linear;
animation-iteration-count: infinite;
animation-direction: alternate;
background: red;
}