Skip to content

Instantly share code, notes, and snippets.

@bencevans
Created April 2, 2013 21:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bencevans/5296460 to your computer and use it in GitHub Desktop.
Save bencevans/5296460 to your computer and use it in GitHub Desktop.
CSS3 Loading with Window (Chrome)
/**
* 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;
}
}
<div class="container" id="container">
<div class="loader"></div>
</div>
var container = document.getElementById('container');
container.style.marginTop = (window.innerHeight + container.offsetHeight) / 3 + 'px';
{"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