Created
April 2, 2013 21:40
-
-
Save bencevans/5296460 to your computer and use it in GitHub Desktop.
CSS3 Loading with Window (Chrome)
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
/** | |
* CSS3 Loading with Window (Chrome) | |
*/ | |
body { | |
background-color: #111; | |
} | |
.container { | |
margin: 100px auto; | |
width: 30px; | |
} | |
.loader { | |
outline: 3px solid #222; | |
height: 20px; | |
width: 20px; | |
border: 4px solid #aaa; | |
border-radius: 20px; | |
transform: rotate(45deg); | |
-webkit-animation: spin 1s infinite; | |
} | |
@-webkit-keyframes spin { | |
0% { | |
border-top-color: #eee; | |
} | |
25% { | |
border-right-color: #eee; | |
} | |
50% { | |
border-bottom-color: #eee; | |
} | |
75% { | |
border-left-color: #eee; | |
} | |
} |
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="container" id="container"> | |
<div class="loader"></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
var container = document.getElementById('container'); | |
container.style.marginTop = (window.innerHeight + container.offsetHeight) / 3 + 'px'; |
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
{"view":"split-vertical","fontsize":"100","seethrough":"","prefixfree":"1","page":"result"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment