I have tried an animation using box-shadow. If you note that red color box-shadow is repeating twice to and fro. I doubt whether it happens due to animation-direction:alternate property or due to wrong box-shadow properties. Could you please correct me on what wrong i'm doing. Hope you understand my query.
.loader{
height:20px;
width:20px;
background:#0388db;
border-radius:50%;
margin:50px;
box-sizing:border-box;
animation:boxShadow 2s linear infinite alternate;
box-shadow:0 0 3px #0388db;
}
@keyframes boxShadow{
0%{
box-shadow: -24px 0 0px -1px #0388db,24px 0 0px -1px #0388db,-24px 0 0px -2px red,24px 0 0px -2px red;
}
25%{
box-shadow: -24px 0 0px -1px #0388db,24px 0 0px -1px #0388db,-48px 0 0px -2px red,48px 0 0px -2px red;
}
50%{
box-shadow: -24px 0 0px -1px #0388db,24px 0 0px -1px #0388db,-24px 0 0px -2px red,24px 0 0px -2px red;
}
75%{
box-shadow: 0 0 0px -1px #0388db,0 0 0px -1px #0388db,0 0 0px -2px red,0 0 0px -2px red;
}
100%{
box-shadow:0 0 3px #0388db;
}
}
<div class="loader">
</div>
Please refer the working fiddle HERE