Last active
August 29, 2015 13:56
-
-
Save AllThingsSmitty/8893233 to your computer and use it in GitHub Desktop.
Animated spinning loader
This file contains 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="spinner bar"> | |
<div></div> | |
<div></div> | |
<div></div> | |
<div></div> | |
<div></div> | |
<div></div> | |
<div></div> | |
<div></div> | |
</div> |
This file contains 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
.container { | |
left: 50%; | |
margin: -50px; | |
position: absolute; | |
top: 50%; | |
} | |
.spinner { | |
height: 100px; | |
margin: auto; | |
position: relative; | |
width: 100px; | |
} | |
.bar div { | |
-webkit-animation: fadeit 1.05s linear infinite; | |
animation: fadeit 1.05s linear infinite; | |
background: #fff; | |
border-radius: 10px; | |
height: 30px; | |
left: 45px; | |
opacity: 0.05; | |
position: absolute; | |
top: 35px; | |
width: 10px; | |
&:nth-child(1) { | |
-webkit-animation-delay: 0.39s; | |
animation-delay: 0.39s; | |
-webkit-transform: rotate(0) translate(0, -30px); | |
-ms-transform: rotate(0) translate(0, -30px); | |
transform: rotate(0) translate(0, -30px); | |
} | |
&:nth-child(2) { | |
-webkit-animation-delay: 0.52s; | |
animation-delay: 0.52s; | |
-webkit-transform: rotate(45deg) translate(0, -30px); | |
-ms-transform: rotate(45deg) translate(0, -30px); | |
transform: rotate(45deg) translate(0, -30px); | |
} | |
&:nth-child(3) { | |
-webkit-animation-delay: 0.65s; | |
animation-delay: 0.65s; | |
-webkit-transform: rotate(90deg) translate(0, -30px); | |
-ms-transform: rotate(90deg) translate(0, -30px); | |
transform: rotate(90deg) translate(0, -30px); | |
} | |
&:nth-child(4) { | |
-webkit-animation-delay: 0.78s; | |
animation-delay: 0.78s; | |
-webkit-transform: rotate(135deg) translate(0, -30px); | |
-ms-transform: rotate(135deg) translate(0, -30px); | |
transform: rotate(135deg) translate(0, -30px); | |
} | |
&:nth-child(5) { | |
-webkit-animation-delay: 0.91s; | |
animation-delay: 0.91s; | |
-webkit-transform: rotate(180deg) translate(0, -30px); | |
-ms-transform: rotate(180deg) translate(0, -30px); | |
transform: rotate(180deg) translate(0, -30px); | |
} | |
&:nth-child(6) { | |
-webkit-animation-delay: 1.04s; | |
animation-delay: 1.04s; | |
-webkit-transform: rotate(225deg) translate(0, -30px); | |
-ms-transform: rotate(225deg) translate(0, -30px); | |
transform: rotate(225deg) translate(0, -30px); | |
} | |
&:nth-child(7) { | |
-webkit-animation-delay: 1.17s; | |
animation-delay: 1.17s; | |
-webkit-transform: rotate(270deg) translate(0, -30px); | |
-ms-transform: rotate(270deg) translate(0, -30px); | |
transform: rotate(270deg) translate(0, -30px); | |
} | |
&:nth-child(8) { | |
-webkit-animation-delay: 1.3s; | |
animation-delay: 1.3s; | |
-webkit-transform: rotate(315deg) translate(0, -30px); | |
-ms-transform: rotate(315deg) translate(0, -30px); | |
transform: rotate(315deg) translate(0, -30px); | |
} | |
} | |
@-webkit-keyframes fadeit { | |
0% { opacity: 1; } | |
100% { opacity: 0; } | |
} | |
@keyframes fadeit { | |
0% { opacity: 1; } | |
100% { opacity: 0; } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment