Skip to content

Instantly share code, notes, and snippets.

@sloyless
Last active May 2, 2017 17:21
Show Gist options
  • Save sloyless/64d51d994a44c94facbff15da172dd40 to your computer and use it in GitHub Desktop.
Save sloyless/64d51d994a44c94facbff15da172dd40 to your computer and use it in GitHub Desktop.
Loading dot animation CSS
@keyframes blink {
/**
* At the start of the animation the dot
* has an opacity of .2
*/
0% {
opacity: .2;
}
/**
* At 20% the dot is fully visible and
* then fades out slowly
*/
20% {
opacity: 1;
}
/**
* Until it reaches an opacity of .2 and
* the animation can start again
*/
100% {
opacity: .2;
}
}
.issue-loading span {
animation-name: blink;
animation-duration: 1.4s;
animation-iteration-count: infinite;
animation-fill-mode: both;
&:nth-child(2) {
animation-delay: .2s;
}
&:nth-child(3) {
animation-delay: .4s;
}
}
<div class="issue-loading">
Loading<span>.</span><span>.</span><span>.</span>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment