Created
June 10, 2015 09:56
-
-
Save davidgg/8195ac0cc745abc5f529 to your computer and use it in GitHub Desktop.
Simple CSS spin loading
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="spin-loading"></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
//Extracted from: http://jsfiddle.net/chadkuehn/1twpzLz8/ | |
$spin-diameter: 30px; | |
$spin-border: 5px; | |
$spin-time: 1000ms; | |
.spin-loading { | |
display: block; | |
width: $spin-diameter; | |
height: $spin-diameter; | |
@include border-radius(50%); | |
border: $spin-border solid grey; | |
border-right: $spin-border solid black; | |
border-top: $spin-border solid black; | |
-webkit-animation: spin $spin-time infinite linear; | |
animation: spin $spin-time infinite linear; | |
} | |
@-webkit-keyframes spin { | |
0% { | |
-webkit-transform: rotate(0deg); | |
transform: rotate(0deg); | |
} | |
100% { | |
-webkit-transform: rotate(359deg); | |
transform: rotate(359deg); | |
} | |
} | |
@keyframes spin { | |
0% { | |
-webkit-transform: rotate(0deg); | |
transform: rotate(0deg); | |
} | |
100% { | |
-webkit-transform: rotate(359deg); | |
transform: rotate(359deg); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment