-
-
Save ahstro/e00dac8750bd6f89a970 to your computer and use it in GitHub Desktop.
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
/** | |
* (C)Leanest CSS spinner ever | |
*/ | |
@keyframes spin { | |
to { transform: rotate(1turn); } | |
} | |
.spinner { | |
position: relative; | |
display: inline-block; | |
width: 5em; | |
height: 5em; | |
margin: 0 .5em; | |
font-size: 12px; | |
text-indent: 999em; | |
overflow: hidden; | |
animation: spin 1s infinite steps(8); | |
} | |
.small.spinner { | |
font-size: 6px; | |
} | |
.large.spinner { | |
font-size: 24px; | |
} | |
.spinner:before, | |
.spinner:after, | |
.spinner > div:before, | |
.spinner > div:after { | |
content: ''; | |
position: absolute; | |
top: 0; | |
left: 2.25em; /* (container width - part width)/2 */ | |
width: .5em; | |
height: 1.5em; | |
border-radius: .2em; | |
background: #eee; | |
box-shadow: 0 3.5em #eee; /* container height - part height */ | |
transform-origin: 50% 2.5em; /* container height / 2 */ | |
} | |
.spinner:before { | |
background: #555; | |
} | |
.spinner:after { | |
transform: rotate(-45deg); | |
background: #777; | |
} | |
.spinner > div:before { | |
transform: rotate(-90deg); | |
background: #999; | |
} | |
.spinner > div:after { | |
transform: rotate(-135deg); | |
background: #bbb; | |
} |
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="small progress"><div>Loading…</div></div> | |
<div class="progress"><div>Loading…</div></div> | |
<div class="large progress"><div>Loading…</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
// alert('Hello world!'); |
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":"css"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment