Skip to content

Instantly share code, notes, and snippets.

@yukulele
Forked from LeaVerou/dabblet.css
Created January 11, 2014 11:36
Show Gist options
  • Save yukulele/8369899 to your computer and use it in GitHub Desktop.
Save yukulele/8369899 to your computer and use it in GitHub Desktop.
(C)Leanest CSS spinner ever
/**
* (C)Leanest CSS spinner ever
*/
@keyframes spin {
to { transform: rotate(1turn); }
}
.progress {
position: relative;
width: 10em;
height: 10em;
font-size: 10px;
animation: spin 2s infinite steps(8);
}
.progress:before,
.progress:after,
.progress > div:before,
.progress > div:after {
content: '';
position: absolute;
left: 4.5em; /* (container width - part width)/2 */
width: 1em;
height: 3em;
border-radius: .4em;
background: #eee;
box-shadow: 0 7em #eee; /* container height - part height */
transform-origin: 50% 5em; /* container height / 2 */
}
.progress:before {
background: #555;
}
.progress:after {
transform: rotate(-45deg);
background: #777;
}
.progress > div:before {
transform: rotate(-90deg);
background: #999;
}
.progress > div:after {
transform: rotate(-135deg);
background: #bbb;
}
<div class="progress">
<div></div>
</div>
// alert('Hello world!');
{"view":"split-vertical","fontsize":"100","seethrough":"","prefixfree":"1","page":"css"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment