Skip to content

Instantly share code, notes, and snippets.

@speckworks
Created June 30, 2021 23:24
Show Gist options
  • Save speckworks/7d9505a0f2e61854afe2d375b54cf1c5 to your computer and use it in GitHub Desktop.
Save speckworks/7d9505a0f2e61854afe2d375b54cf1c5 to your computer and use it in GitHub Desktop.
loading shimmer (Facebook Loading Shimmer)
<div class="card br">
<div class="wrapper">
<div class="profilePic animate din">ham de doo dee</div>
<div class="comment animate w80">whut comment</div>
<div class="box animate">whut box</div>
<div class="button animate"></div>
<div class="button animate"></div><div class="button animate"></div>
</div>
<div>
.br {
border-radius: 8px;
}
.w80 {
width: 80%;
}
.card {
border: 2px solid #fff;
box-shadow:0px 0px 10px 0 #a9a9a9;
padding: 30px 40px;
width: 80%;
margin: 50px auto;
}
.wrapper {
width: 0px;
animation: fullView 0.5s forwards cubic-bezier(0.250, 0.460, 0.450, 0.940);
display: flex;
flex-direction: column;
flex-wrap: wrap;
}
.profilePic {
height: 30vw;
width: 20vw;
flex: 1;
color: transparent;
}
.comment {
//height: 10px;
background: #777;
margin-top: 20px;
width: 40%;
flex: 1;
color: transparent;
}
.box {
height: 60vh;
background: #777;
margin-top: 20px;
width: 50%;
flex: 1 0 50%;
color: transparent;
}
@keyframes fullView {
100% {
width: 100%;
}
}
.animate {
animation : shimmer 2s infinite linear;
background: linear-gradient(to right, #eff1f3 4%, #e2e2e2 25%, #eff1f3 36%);
background-size: 1000px 100%;
}
@keyframes shimmer {
0% {
background-position: -1000px 0;
}
100% {
background-position: 1000px 0;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment