Skip to content

Instantly share code, notes, and snippets.

@SindhujaD
Created January 6, 2014 00:09
Show Gist options
  • Select an option

  • Save SindhujaD/8275999 to your computer and use it in GitHub Desktop.

Select an option

Save SindhujaD/8275999 to your computer and use it in GitHub Desktop.
A Pen by David DeSandro.
<div class="loader">
<div class="dot dot1"></div>
<div class="dot dot2"></div>
<div class="dot dot3"></div>
<div class="dot dot4"></div>
</div>
/* change font size to change size */
.loader {
font-size: 20px;
position: relative;
width: 4em;
height: 1em;
margin: 100px auto;
}
.dot {
width: 1em;
height: 1em;
border-radius: 0.5em;
background: #333;
position: absolute;
animation-duration: 0.5s;
animation-timing-function: ease;
animation-iteration-count: infinite;
}
.dot1, .dot2 {
left: 0;
}
.dot3 { left: 1.5em; }
.dot4 { left: 3em; }
@keyframes reveal {
from { transform: scale(0.001); }
to { transform: scale(1); }
}
@keyframes slide {
to { transform: translateX(1.5em) }
}
.dot1 {
animation-name: reveal;
}
.dot2, .dot3 {
animation-name: slide;
}
.dot4 {
animation-name: reveal;
animation-direction: reverse; /* thx @HugoGiraudel */
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment