Created
June 24, 2013 08:16
-
-
Save parkji/5848516 to your computer and use it in GitHub Desktop.
A CodePen by Ben Parker. Loading dots - Playing around with flashing dots
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="loading dot"></div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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