实现效果:
HTML:
html
<div class="lamp-container"></div>
css:
css
.lamp-container {
position: absolute;
top: 50%;
left: 50%;
width: 200px;
height: 200px;
-webkit-animation-timing-function: ease-in-out;
-webkit-animation-name: breathe;
-webkit-animation-duration: 1000ms;
-webkit-animation-iteration-count: infinite;
-webkit-animation-direction: alternate;
}
@-webkit-keyframes breathe {
0% {
opacity: 0.2;
background: radial-gradient(56% 56% at 51% 47%, rgba(33, 2, 2, 0) 0%, rgba(255, 4, 4, 0.31) 100%);
}
100% {
opacity: 1;
background: radial-gradient(56% 56% at 51% 47%, rgba(33, 2, 2, 0) 0%, rgba(255, 4, 4, 0.31) 100%);
}
}