Creating a loading bar with a single colored element moving along a grey bar is my current project.
Unfortunately, I struggle with animating gradients in CSS. I found a solution that seems promising based on this answer: Make some gradient move endlessly in a progress bar like in Windows 7
foo {
background-color: $cGray300;
height: 10px;
background: linear-gradient(to right, $cGray300 0%, $cGray300 30%, #fed0d0 30%, #fed0d0 40%, $cGray300 40%, $cGray300 100%) repeat;
background-size: 50% 100%;
animation-name: moving-gradient;
animation-duration: 1s;
animation-iteration-count: infinite;
animation-timing-function: linear;
}
@-webkit-keyframes moving-gradient {
0% { background-position: left bottom; }
100% { background-position: right bottom; }
}
This is the outcome of my current implementation: https://i.sstatic.net/Qlp0Z.gif
However, I aim to have a larger red element that loops from the left side once it disappears on the right.