Google/Gmail's 3D Loader - "Current"
Google's 3D "Flipping-Circle" Loader as used in Gmail and other Google Products using pure CSS.
author(s):
Regis Gaughan, III
HTML
<div class="container">
<span class="gloader"><span></span><span></span></span>
</div>
CSS
/* Added for Demo */
.container {padding:25px; font-size:64px; text-align:center;}
/**
* Google/Gmail's 3D Loader in Pure CSS
* https://github.com/rgthree/google-loader-css
* Regis Gaughan, III <http://regisgaughan.com>
* MIT License
*
* Version: Current
* Browser Support: https://github.com/rgthree/google-loader-css/blob/master/README.md
* Demo: http://jsfiddle.net/gh/get/library/pure/rgthree/google-loader-css/tree/master/jsfiddle-current
* Usage:
* - Add this file to the <head> of your webpage
* - Within the <body>, add this snippet:
*
* <span class="gloader"><span></span><span></span></span>
*
* - The gloader uses font-size and text-align to align itself.
* For instance, if you place it within a `.container` element
* with a `font-size:48px; text-align:center;` the gloader would
* be 48px in diameter and aligned in the middle of you container
* along with other inline/inline-block elements
*
*/
.gloader {
display:inline-block; width:1em; height:1em;
position:relative; overflow:hidden; border-radius:0.5em;
-webkit-animation:base 3s steps(1) 0s infinite;
animation:base 3s steps(1) 0s infinite;
}
.gloader > * {
display:block; width:50%; height:100%;
position:absolute; top:0%; left:50%; z-index:1;
border-radius:0em 0.5em 0.5em 0em;
-webkit-transform-origin:0px 50%;
transform-origin:0px 50%;
}
.gloader > *:first-child {
z-index:2;
-webkit-transform-style:preserve-3d;
-webkit-animation:flip 3s linear 0s infinite;
transform-style:preserve-3d;
animation:flip 3s linear 0s infinite;
}
.gloader > *:last-child {
-webkit-animation:reveal 3s steps(1) 0s infinite;
animation:reveal 3s steps(1) 0s infinite;
}
/* Webkit Animations; Copy from standard animations below and add "-webkit-" prefix to keyframes and transforms */
@-webkit-keyframes base {
0% {-webkit-transform:rotate(0deg); background-color:#21aa29;}
25% {-webkit-transform:rotate(90deg); background-color:#2159d6;}
50% ...