CSS 3 Animation AJAX Loaders

Rotating CSS 3 Animation AJAX Loader

This one’s pretty simple all around, but I like it. Two rounded divs, one has a gradient and spins.

Here’s the HTML for this example

<div id="loader">
    <span></span>
    <span></span>
</div>

Here’s the CSS for this example

#loader{
    height: 35px;
    margin: 50px 0 0 50px;
    position: relative;
    width: 35px;
}
#loader span{
    -webkit-border-radius: 50%;
    -moz-border-radius: 50%;
    border-radius: 50%;
    position: absolute;
    top: 0;
    left: 0;
}
#loader span:first-child{
    background: -moz-linear-gradient(top,  #0e0e0e 50%, #8e8e8e 50%); /* FF3.6+ */
    background: -webkit-gradient(linear, left top, left bottom, color-stop(50%,#0e0e0e), color-stop(50%,#8e8e8e)); /* Chrome,Safari4+ */
    background: -webkit-linear-gradient(top,  #0e0e0e 50%,#8e8e8e 50%); /* Chrome10+,Safari5.1+ */
    background: -o-linear-gradient(top,  #0e0e0e 50%,#8e8e8e 50%); /* Opera 11.10+ */
    background: -ms-linear-gradient(top,  #0e0e0e 50%,#8e8e8e 50%); /* IE10+ */
    background: linear-gradient(to bottom,  #0e0e0e 50%,#8e8e8e 50%); /* W3C */
    width:100%;
    height: 100%;
    -webkit-animation: rotateIn 10s linear infinite;
    -moz-animation: rotateIn 10s linear infinite;
    -ms-animation: rotateIn 10s linear infinite;
    -o-animation: rotateIn 10s linear infinite;
    animation: rotateIn 10s linear infinite;
}
#loader span:nth-child(2){
    background: #fff;
    height: 70%;
    width: 70%;
    top: 15%;
    left: 15%;
}
@-webkit-keyframes rotateIn {
    0% {
    -webkit-transform-origin: center center;
    -webkit-transform: rotate(-7200deg);
 
    }
 
    100% {
        -webkit-transform-origin: center center;
        -webkit-transform: rotate(0deg);
 
    }
}
@-moz-keyframes rotateIn {
    0% {
        -moz-transform-origin: center center;
        -moz-transform: rotate(-7200deg);
    }
 
    100% {
        -moz-transform-origin: center center;
        -moz-transform: rotate(0);
    }
}
@-o-keyframes rotateIn {
    0% {
        -o-transform-origin: center center;
        -o-transform: rotate(-7200deg);
    }
 
    100% {
        -o-transform-origin: center center;
        -o-transform: rotate(0);
    }
}
@keyframes rotateIn {
    0% {
        transform-origin: center center;
        transform: rotate(-7200deg);
    }
 
    100% {
        transform-origin: center center;
        transform: rotate(0);
    }
}

Post a Comment

Your email is never published nor shared. Required fields are marked *

You may use these HTML tags and attributes <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

*
*