Created
July 23, 2013 07:54
-
-
Save zhangj/6060601 to your computer and use it in GitHub Desktop.
A CodePen by Jane. CSS loading animation
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
| <h1 data-content="Loading...">Loading...</h1> |
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
| @import "compass"; | |
| @mixin keyframes($name) { | |
| @-webkit-keyframes #{$name} { | |
| @content; | |
| } | |
| @-moz-keyframes #{$name} { | |
| @content; | |
| } | |
| @-ms-keyframes #{$name} { | |
| @content; | |
| } | |
| @keyframes #{$name} { | |
| @content; | |
| } | |
| } | |
| @mixin animate($animation) { | |
| -webkit-animation: #{$animation}; | |
| -moz-animation: #{$animation}; | |
| -ms-animation: #{$animation}; | |
| animation: #{$animation}; | |
| } | |
| html { | |
| height: 100%; | |
| } | |
| body { | |
| display: -webkit-box; | |
| display: -moz-box; | |
| display: -ms-flexbox; | |
| display: -webkit-flex; | |
| display: flex; | |
| -webkit-box-align: center; | |
| -moz-box-align: center; | |
| -ms-flex-align: center; | |
| -webkit-align-items: center; | |
| align-items: center; | |
| -webkit-box-pack: center; | |
| -moz-box-pack: center; | |
| -ms-flex-pack: center; | |
| -webkit-justify-content: center; | |
| justify-content: center; | |
| margin: 0; | |
| height: 100%; | |
| width: 100%; | |
| background-image: radial-gradient(circle farthest-corner at center, #003F7A 0%, #000 100%); | |
| } | |
| h1 { | |
| color: hsla(0,0%,100%,.3); | |
| font: 900 800% Baskerville, 'Palatino Linotype', Palatino, serif; | |
| } | |
| @include keyframes (loading) { | |
| from { max-width: 0; } | |
| } | |
| h1:before { | |
| content: attr(data-content); | |
| position: absolute; | |
| overflow: hidden; | |
| max-width: 100%; | |
| color: hsla(0,0%,100%,.6); | |
| @include animate(loading 10s linear infinite); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Impressive, however, there is noticeable amount of nonresponsive elements that are not adaptive to mobile environments