I'm animating a background gradient by moving the background-position
via animation. However, the transition from the end of the animation to the start of the next cycle isn't smooth. It should appear as if it's on a continuous loop. What am I missing?
.gradient {
width: 200px;
height: 30px;
background-image: linear-gradient(
to right,
red 8.33%,
#ff9900 16.67%,
yellow 25%,
red 41.67%,
#ff9900 58.34%,
yellow 75.01%,
red 83.34%
);
-webkit-animation: flow 3s ease infinite;
-o-animation: flow 3s ease infinite;
-ms-animation: flow 3s ease infinite;
-moz-animation: flow 3s ease infinite;
animation: flow 3s ease infinite;
-webkit-animation: flow 3s ease infinite;
background-size: 400% 100%;
overflow: hidden;
}
@-webkit-keyframes flow {
0% {
background-position: -100% 50%;
}
100% {
background-position: 100% 50%;
}
}
@keyframes flow {
0% {
background-position: -100% 50%;
}
100% {
background-position: 100% 50%;
}
}
<div class="gradient" />