Created
March 5, 2012 08:32
-
-
Save i2r/1977478 to your computer and use it in GitHub Desktop.
Loader
This file contains hidden or 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
| /** | |
| * Loader | |
| * Pure CSS3 animated loader with 1 element. | |
| */ | |
| html, body | |
| { | |
| min-height: 100%; | |
| } | |
| body { | |
| font: 100% 'Helvetica Neue', Arial, sans-serif; | |
| background: #f06; | |
| background: linear-gradient(45deg, #f06, yellow); | |
| padding: 6em 1em; | |
| text-align: center; | |
| } | |
| .loader { | |
| display: inline-block; | |
| width: .65em; | |
| height: .65em; | |
| margin: 1em 2em 1.4em; | |
| border-radius: 100em; | |
| animation: loading 1.1s linear 0s infinite; | |
| vertical-align: middle; | |
| } | |
| .loader_small { | |
| font-size: 8px; | |
| } | |
| .loader_big { | |
| font-size: 23px; | |
| } | |
| @keyframes loading { | |
| 0% { | |
| box-shadow: | |
| .875em -.875em 0 rgba(0,0,0,1), | |
| 0 -1.25em 0 rgba(0,0,0, .8), | |
| -.875em -.875em 0 rgba(0,0,0, .625), | |
| -1.25em 0 0 rgba(0,0,0, .5), | |
| -.875em .875em 0 rgba(0,0,0, .375), | |
| 0 1.25em 0 rgba(0,0,0, .25), | |
| .875em .875em 0 rgba(0,0,0, .125), | |
| 1.25em 0 0 rgba(0,0,0, .07); | |
| } | |
| 12.5% { | |
| box-shadow: | |
| .875em -.875em 0 rgba(0,0,0, .8), | |
| 0 -1.25em 0 rgba(0,0,0, .625), | |
| -.875em -.875em 0 rgba(0,0,0, .5), | |
| -1.25em 0 0 rgba(0,0,0, .375), | |
| -.875em .875em 0 rgba(0,0,0, .25), | |
| 0 1.25em 0 rgba(0,0,0, .125), | |
| .875em .875em 0 rgba(0,0,0, .07), | |
| 1.25em 0 0 rgba(0,0,0, 1); | |
| } | |
| 25% { | |
| box-shadow: | |
| .875em -.875em 0 rgba(0,0,0, .625), | |
| 0 -1.25em 0 rgba(0,0,0, .5), | |
| -.875em -.875em 0 rgba(0,0,0, .375), | |
| -1.25em 0 0 rgba(0,0,0, .25), | |
| -.875em .875em 0 rgba(0,0,0, .125), | |
| 0 1.25em 0 rgba(0,0,0, .07), | |
| .875em .875em 0 rgba(0,0,0, 1), | |
| 1.25em 0 0 rgba(0,0,0, .8); | |
| } | |
| 37.5% { | |
| box-shadow: | |
| .875em -.875em 0 rgba(0,0,0, .5), | |
| 0 -1.25em 0 rgba(0,0,0, .375), | |
| -.875em -.875em 0 rgba(0,0,0, .25), | |
| -1.25em 0 0 rgba(0,0,0, .125), | |
| -.875em .875em 0 rgba(0,0,0, .07), | |
| 0 1.25em 0 rgba(0,0,0,1), | |
| .875em .875em 0 rgba(0,0,0, .8), | |
| 1.25em 0 0 rgba(0,0,0, .625); | |
| } | |
| 50% { | |
| box-shadow: | |
| .875em -.875em 0 rgba(0,0,0, .375), | |
| 0 -1.25em 0 rgba(0,0,0, .25), | |
| -.875em -.875em 0 rgba(0,0,0, .125), | |
| -1.25em 0 0 rgba(0,0,0, .07), | |
| -.875em .875em 0 rgba(0,0,0,1), | |
| 0 1.25em 0 rgba(0,0,0, .8), | |
| .875em .875em 0 rgba(0,0,0, .625), | |
| 1.25em 0 0 rgba(0,0,0, .5); | |
| } | |
| 62.5% { | |
| box-shadow: | |
| .875em -.875em 0 rgba(0,0,0, .25), | |
| 0 -1.25em 0 rgba(0,0,0, .125), | |
| -.875em -.875em 0 rgba(0,0,0, .07), | |
| -1.25em 0 0 rgba(0,0,0,1), | |
| -.875em .875em 0 rgba(0,0,0, .8), | |
| 0 1.25em 0 rgba(0,0,0, .625), | |
| .875em .875em 0 rgba(0,0,0, .5), | |
| 1.25em 0 0 rgba(0,0,0, .375); | |
| } | |
| 75% { | |
| box-shadow: | |
| .875em -.875em 0 rgba(0,0,0, .125), | |
| 0 -1.25em 0 rgba(0,0,0, .07), | |
| -.875em -.875em 0 rgba(0,0,0,1), | |
| -1.25em 0 0 rgba(0,0,0, .8), | |
| -.875em .875em 0 rgba(0,0,0, .625), | |
| 0 1.25em 0 rgba(0,0,0, .5), | |
| .875em .875em 0 rgba(0,0,0, .375), | |
| 1.25em 0 0 rgba(0,0,0, .25); | |
| } | |
| 87.5% { | |
| box-shadow: | |
| .875em -.875em 0 rgba(0,0,0, .07), | |
| 0 -1.25em 0 rgba(0,0,0,1), | |
| -.875em -.875em 0 rgba(0,0,0, .8), | |
| -1.25em 0 0 rgba(0,0,0, .625), | |
| -.875em .875em 0 rgba(0,0,0, .5), | |
| 0 1.25em 0 rgba(0,0,0, .375), | |
| .875em .875em 0 rgba(0,0,0, .25), | |
| 1.25em 0 0 rgba(0,0,0, .125); | |
| } | |
| 100% { | |
| box-shadow: | |
| .875em -.875em 0 rgba(0,0,0,1), | |
| 0 -1.25em 0 rgba(0,0,0, .8), | |
| -.875em -.875em 0 rgba(0,0,0, .625), | |
| -1.25em 0 0 rgba(0,0,0, .5), | |
| -.875em .875em 0 rgba(0,0,0, .375), | |
| 0 1.25em 0 rgba(0,0,0, .25), | |
| .875em .875em 0 rgba(0,0,0, .125), | |
| 1.25em 0 0 rgba(0,0,0, .07); | |
| } | |
| } |
This file contains hidden or 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
| <!-- content to be placed inside <body>…</body> --> | |
| <span class="loader loader_big"></span> | |
| <br><br> | |
| <span class="loader"></span> | |
| <br><br> | |
| <span class="loader loader_small"></span>Loading, please wait... | |
This file contains hidden or 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","seethrough":"","prefixfree":"1","page":"css"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment