I'm trying to create an animation that will run infinite time every 15second. Also, I want to play the animation in this order -> 1, 2, 3, 4, 3, 2, 1 (need to animation items back) Every animation has a different delay. Can it possible with CSS? Animation delay is working only on the first iteration. When animation time is long it is easy to achieve this effect, but with 1s or smaller can't find a good way.
.container {
display: flex;
margin: 40px;
}
.item1,
.item2,
.item3,
.item4 {
width: 100px;
height: 60px;
background-color: pink;
margin: 6px;
animation: glow .7s alternate-reverse;
}
@keyframes glow {
0%,
100% {
box-shadow: 0 0 -6px -6px black;
}
50% {
box-shadow: 0 0 6px 6px black;
}
}
.item1 {
animation-delay: 1s;
}
.item2 {
animation-delay: 1.1s;
}
.item3 {
animation-delay: 1.2s;
}
.item4 {
animation-delay: 1.3s;
}
<div class='container'>
<div class='item1'></div>
<div class='item2'></div>
<div class='item3'></div>
<div class='item4'></div>
</div>