Skip to content

Instantly share code, notes, and snippets.

@bavey
Created July 20, 2013 21:57
Show Gist options
  • Save bavey/6046563 to your computer and use it in GitHub Desktop.
Save bavey/6046563 to your computer and use it in GitHub Desktop.
A CodePen by David DeSandro. Loader dots - Lamer version of http://codepen.io/jshawl/pen/IFxBK
<div class="loader">
<div class="dot dot1"></div>
<div class="dot dot2"></div>
<div class="dot dot3"></div>
<div class="dot dot4"></div>
</div>
.loader {
position: relative;
width: 80px;
margin: 100px auto;
}
.dot {
width: 20px;
height: 20px;
border-radius: 10px;
background: #333;
position: absolute;
animation-duration: 0.5s;
animation-timing-function: ease;
animation-iteration-count: infinite;
}
.dot1, .dot2 {
left: 0;
}
.dot3 { left: 30px; }
.dot4 { left: 60px; }
@keyframes reveal {
from { transform: scale(0.001); }
to { transform: scale(1); }
}
@keyframes slide {
to { transform: translateX(30px) }
}
.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