Skip to content

Instantly share code, notes, and snippets.

@parkji
Created June 24, 2013 08:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parkji/5848516 to your computer and use it in GitHub Desktop.
Save parkji/5848516 to your computer and use it in GitHub Desktop.
A CodePen by Ben Parker. Loading dots - Playing around with flashing dots
<div class="loading dot"></div>
@import "compass";
$on: black;
$off: #CCC;
@keyframes dots {
from {
background: $on;
}
to {
background: $off;
}
}
@keyframes rotate {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
.dot {
height: 8px;
width: 8px;
border-radius: 12px;
background: $on;
}
.loading {
animation: rotate 3s infinite linear,
dots 2000ms infinite;
display: inline-block;
position: relative;
&:before, &:after {
@extend .dot;
animation: dots 2000ms 1000ms infinite;
position: absolute;
content: '';
left: 16px;
background: $off;
}
&:before {
top: 16px;
left: 8px;
animation-delay: 1500ms;
}
}
/** Display sugar **/
body {
width: 100px;
margin: 50px auto;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment