I am building a web application, some HTML elements might take some time to be fetched. So I decided to render the layout of the element, without the data from the backend. But I want to indicate to the user, that the data is loading with a CSS animation. I want it to look like this, but I want the transition of the color change to be smooth so that the lighter area travels from one side to the other. Any ideas?
body {
animation: 2000ms infinite color-loading;
}
@keyframes color-loading {
0% {
background: linear-gradient(
to right,
#363644,
#282933
);
}
100% {
background: linear-gradient(
to right,
#282933,
#363644
);
}
}
I think
animation-timing-functionproperty will help you out.Also, I have checked and find your background colors are very similar, try with other color combination with
animation-timing-functionproperty and see the difference.Please refer for more detail information below link: https://www.w3schools.com/css/css3_animations.asp
Please let me know if you find any issues.