The keyframes work with the following animations properties:
infinitealternate to have the animation alternate direction on completion.element {
animation-duration: 2s;
animation-name: change-color;
animation-iteration-count: infinite;
animation-direction: alternate;
// or
animation: 2s infinite alternate change-color;
}
Define state at given animation time. The keyword from/to are aliases for 0%/100%.
@keyframes change-color {
from {
background-color: red;
}
50% {
background-color: blue;
}
to {
background-color: green;
}
}