I have a piece of SMIL (linear gradient) animation that I want to convert to CSS:
<linearGradient id={idGradient}>
<stop offset="0%" stopColor="#cfcfcf" stopOpacity={1}>
<animate attributeName="offset" values="-2; -2; 1" keyTimes="0; 0.25; 1" dur="2s" repeatCount="indefinite" />
</stop>
<stop offset="50%" stopColor="#ecebeb" stopOpacity={1}>
<animate attributeName="offset" values="-1; -1; 2" keyTimes="0; 0.25; 1" dur="2s" repeatCount="indefinite" />
</stop>
<stop offset="100%" stopColor="#cfcfcf" stopOpacity={1}>
<animate attributeName="offset" values="0; 0; 3" keyTimes="0; 0.25; 1" dur="2s" repeatCount="indefinite" />
</stop>
</linearGradient>
This is what I have been able to figure out so far in terms of CSS:
.shimmer {
background: #cfcfcf;
background-image: linear-gradient(to right, #cfcfcf 0%, #ecebeb 50%, #cfcfcf 100%);
animation-duration: 2s;
animation-iteration-count: infinite;
animation-timing-function: linear;
animation-name: placeholder
}
@keyframes placeholder {
0% { ? }
50% { ? }
100% { ? }
}
But I need help with what am I suppose to write in the animation @keyframes.
The output is suppose to look something like this

If you want use this for showing before load data, it's better that use : Skeleton React
If no then use this code