Created
January 30, 2014 23:52
-
-
Save cvan/8722664 to your computer and use it in GitHub Desktop.
CSS throbber
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
/* | |
Usage: | |
<div class="throbber"><b></b><b></b><b></b></div> | |
*/ | |
.throbber { | |
position: absolute; | |
text-align: center; | |
top: 45%; | |
width: 100%; | |
} | |
.throbber > b { | |
-webkit-animation: bouncedelay 1.4s infinite ease-in-out; | |
-moz-animation: bouncedelay 1.4s infinite ease-in-out; | |
animation: bouncedelay 1.4s infinite ease-in-out; | |
-webkit-animation-fill-mode: both; | |
animation-fill-mode: both; | |
background-color: #2babc6; | |
border-radius: 18px; | |
display: inline-block; | |
height: 18px; | |
margin: 0 5px; | |
width: 18px; | |
} | |
.throbber > b:first-child { | |
-webkit-animation-delay: -0.3s; | |
animation-delay: -0.3s; | |
} | |
.throbber > b:first-child + .bounce { | |
-webkit-animation-delay: -0.15s; | |
animation-delay: -0.15s; | |
} | |
@-webkit-keyframes bouncedelay { | |
0%, 80%, 100% { | |
-webkit-transform: scale(0.15); | |
} | |
40% { | |
-webkit-transform: scale(1); | |
} | |
} | |
@-moz-keyframes bouncedelay { | |
0%, 80%, 100% { | |
-webkit-transform: scale(0.15); | |
-webkit-transform: scale(0.15); | |
-moz-transform: scale(0.15); | |
-ms-transform: scale(0.15); | |
transform: scale(0.15); | |
} | |
40% { | |
-webkit-transform: scale(1); | |
-webkit-transform: scale(1); | |
-moz-transform: scale(1); | |
-ms-transform: scale(1); | |
transform: scale(1); | |
} | |
} | |
@-webkit-keyframes bouncedelay { | |
0%, 80%, 100% { | |
-webkit-transform: scale(0.15); | |
-webkit-transform: scale(0.15); | |
-moz-transform: scale(0.15); | |
-ms-transform: scale(0.15); | |
transform: scale(0.15); | |
} | |
40% { | |
-webkit-transform: scale(1); | |
-webkit-transform: scale(1); | |
-moz-transform: scale(1); | |
-ms-transform: scale(1); | |
transform: scale(1); | |
} | |
} | |
@-o-keyframes bouncedelay { | |
0%, 80%, 100% { | |
-webkit-transform: scale(0.15); | |
-webkit-transform: scale(0.15); | |
-moz-transform: scale(0.15); | |
-ms-transform: scale(0.15); | |
transform: scale(0.15); | |
} | |
40% { | |
-webkit-transform: scale(1); | |
-webkit-transform: scale(1); | |
-moz-transform: scale(1); | |
-ms-transform: scale(1); | |
transform: scale(1); | |
} | |
} | |
@-ms-keyframes bouncedelay { | |
0%, 80%, 100% { | |
-webkit-transform: scale(0.15); | |
-webkit-transform: scale(0.15); | |
-moz-transform: scale(0.15); | |
-ms-transform: scale(0.15); | |
transform: scale(0.15); | |
} | |
40% { | |
-webkit-transform: scale(1); | |
-webkit-transform: scale(1); | |
-moz-transform: scale(1); | |
-ms-transform: scale(1); | |
transform: scale(1); | |
} | |
} | |
@keyframes bouncedelay { | |
0%, 80%, 100% { | |
-webkit-transform: scale(0.15); | |
-webkit-transform: scale(0.15); | |
-moz-transform: scale(0.15); | |
-ms-transform: scale(0.15); | |
transform: scale(0.15); | |
} | |
40% { | |
-webkit-transform: scale(1); | |
-webkit-transform: scale(1); | |
-moz-transform: scale(1); | |
-ms-transform: scale(1); | |
transform: scale(1); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment