Last active
August 29, 2015 14:23
-
-
Save dmy3k/6213cbd1112c2a8131a9 to your computer and use it in GitHub Desktop.
Zero element CSS 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
.loading { | |
position: relative; | |
} | |
.loading:before { | |
content: ""; | |
display: block; | |
position: absolute; | |
top: 0; | |
left: 0; | |
bottom: 0; | |
right: 0; | |
background: rgba(255,255,255,0.75); | |
z-index: 1010; | |
} | |
.loading:after { | |
content: ""; | |
display: block; | |
position: absolute; | |
top: 50%; | |
left: 50%; | |
width: 42px; | |
height: 42px; | |
margin: -21px 0 0 -21px; | |
z-index: 1020; | |
background: url("loader.svg"); | |
background-size: contain; | |
background-position: 50% 50%; | |
-webkit-animation-name: spin; | |
-webkit-animation-duration: 600ms; | |
-webkit-animation-iteration-count: infinite; | |
-webkit-animation-timing-function: linear; | |
-moz-animation-name: spin; | |
-moz-animation-duration: 600ms; | |
-moz-animation-iteration-count: infinite; | |
-moz-animation-timing-function: linear; | |
-ms-animation-name: spin; | |
-ms-animation-duration: 600ms; | |
-ms-animation-iteration-count: infinite; | |
-ms-animation-timing-function: linear; | |
} | |
@-moz-keyframes spin { | |
from { -moz-transform: rotate(0deg); } | |
to { -moz-transform: rotate(360deg); } | |
} | |
@-webkit-keyframes spin { | |
from { -webkit-transform: rotate(0deg); } | |
to { -webkit-transform: rotate(360deg); } | |
} | |
@keyframes spin { | |
from {transform:rotate(0deg);} | |
to {transform:rotate(360deg);} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment