Whenever I visit Facebook, this animation shows
before post is loaded. I think they use css on group of divs to create the supposed post lines and user image with background gradient
background: -webkit-linear-gradient(left, #ccc, #fff 50%, #ccc);
However the gradient of the background of these lines changes with time. Is it possible to create this with css?
Despite it's old question here is an article telling how to do it.
JSFiddle full example
The hardest part may be the CSS animation, so I put it here:
@keyframes placeHolderShimmer{
0%{
background-position: -468px 0
}
100%{
background-position: 468px 0
}
}
.animated-background {
animation-duration: 1s;
animation-fill-mode: forwards;
animation-iteration-count: infinite;
animation-name: placeHolderShimmer;
animation-timing-function: linear;
background: #f6f7f8;
background: linear-gradient(to right, #eeeeee 8%, #dddddd 18%, #eeeeee 33%);
background-size: 800px 104px;
height: 96px;
position: relative;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With