CSS 3 Animation AJAX Loaders

Growing Circle CSS 3 Animation AJAX Loader

This one uses animation delay to trigger the growth of the spans one right after another.

I was having trouble getting the spans to line up correctly and form a circle so I created a stroked circle in Photoshop and used it as a background image to get the spans positioned properly and looking right.

Here’s the HTML for this example

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

Here’s the CSS for this example

#loader2{
    clear: both;
    height: 100px;
    margin: 100px 0 0 50px;
    width: 100px;
    position: relative;
}
#loader2 span{
    background: #000;
    -webkit-border-radius: 100%;
    -moz-border-radius: 100%;
    border-radius: 100%;
    display: block;
    float: left;
    height: 5px;
    width:5px;
    position: absolute;
}
#loader2 span:nth-child(1){
    top: 0;
    left:49%;
    -webkit-animation: growSize 2s linear infinite;
    -moz-animation: growSize 2s linear infinite;
    -ms-animation: growSize 2s linear infinite;
    -o-animation: growSize 2s linear infinite;
    animation: growSize 2s linear infinite;
 
}
#loader2 span:nth-child(2){
    top: 14%;
    left:80%;
    -webkit-animation: growSize 2s linear infinite;
    -webkit-animation-delay: .25s;
    -moz-animation: growSize 2s linear infinite;
    -moz-animation-delay: .25s;
    -ms-animation: growSize 2s linear infinite;
    -ms-animation-delay: .25s;
    -o-animation: growSize 2s linear infinite;
    -o-animation-delay: .25s;
    animation: growSize 2s linear infinite;
    animation-delay: .25s;
}
#loader2 span:nth-child(3){
    top: 45%;
    left:95%;
    -webkit-animation: growSize 2s linear infinite;
    -webkit-animation-delay: .5s;
    -moz-animation: growSize 2s linear infinite;
    -moz-animation-delay: .5s;
    -ms-animation: growSize 2s linear infinite;
    -ms-animation-delay: .5s;
    -o-animation: growSize 2s linear infinite;
    -o-animation-delay: .5s;
    animation: growSize 2s linear infinite;
    animation-delay: .5s;
}
#loader2 span:nth-child(4){
    top: 80%;
    left:81%;
    -webkit-animation: growSize 2s linear infinite;
    -webkit-animation-delay: .75s;
    -moz-animation: growSize 2s linear infinite;
    -moz-animation-delay: .75s;
    -ms-animation: growSize 2s linear infinite;
    -ms-animation-delay: .75s;
    -o-animation: growSize 2s linear infinite;
    -o-animation-delay: .75s;
    animation: growSize 2s linear infinite;
    animation-delay: .75s;
}
#loader2 span:nth-child(5){
    top: 95%;
    left:49%;
    -webkit-animation: growSize 2s linear infinite;
    -webkit-animation-delay: 1s;
    -moz-animation: growSize 2s linear infinite;
    -moz-animation-delay: 1s;
    -ms-animation: growSize 2s linear infinite;
    -ms-animation-delay: 1s;
    -o-animation: growSize 2s linear infinite;
    -o-animation-delay: 1s;
    animation: growSize 2s linear infinite;
    animation-delay: 1s;
}
#loader2 span:nth-child(6){
    top: 80%;
    left:13%;
    -webkit-animation: growSize 2s linear infinite;
    -webkit-animation-delay: 1.25s;
    -moz-animation: growSize 2s linear infinite;
    -moz-animation-delay: 1.25s;
    -ms-animation: growSize 2s linear infinite;
    -ms-animation-delay: 1.25s;
    -o-animation: growSize 2s linear infinite;
    -o-animation-delay: 1.25s;
    animation: growSize 2s linear infinite;
    animation-delay: 1.25s;
}
#loader2 span:nth-child(7){
    top: 45%;
    left:0%;
    -webkit-animation: growSize 2s linear infinite;
    -webkit-animation-delay: 1.5s;
    -moz-animation: growSize 2s linear infinite;
    -moz-animation-delay: 1.5s;
    -ms-animation: growSize 2s linear infinite;
    -ms-animation-delay: 1.5s;
    -o-animation: growSize 2s linear infinite;
    -o-animation-delay: 1.5s;
    animation: growSize 2s linear infinite;
    animation-delay: 1.5s;
}
#loader2 span:nth-child(8){
    top: 14%;
    left:14%;
    -webkit-animation: growSize 2s linear infinite;
    -webkit-animation-delay: 1.75s;
    -moz-animation: growSize 2s linear infinite;
    -moz-animation-delay: 1.75s;
    -ms-animation: growSize 2s linear infinite;
    -ms-animation-delay: 1.75s;
    -o-animation: growSize 2s linear infinite;
    -o-animation-delay: 1.75s;
    animation: growSize 2s linear infinite;
    animation-delay: 1.75s;
}
@-webkit-keyframes growSize {
    0% {
        -webkit-transform-origin: center center;
        -webkit-transform: scale(1);
        opacity:1;
    }
    10% {
        -webkit-transform: scale(3);
        opacity:.2;
    }
    50% {
        -webkit-transform: scale(1);
        opacity:.2;
    }
    100% {
        opacity:1;
    }
}
@-moz-keyframes growSize {
    0% {
        -moz-transform-origin: center center;
        -moz-transform: scale(1);
        opacity:1;
    }
    10% {
        -moz-transform: scale(3);
        opacity:.2;
    }
    50% {
        -moz-transform: scale(1);
        opacity:.2;
    }
    100% {
        opacity:1;
    }
}
@-o-keyframes growSize {
    0% {
        -o-transform-origin: center center;
        -o-transform: scale(1);
        opacity:1;
    }
    10% {
        -o-transform: scale(3);
        opacity:.2;
    }
    50% {
        -o-transform: scale(1);
        opacity:.2;
    }
    100% {
        opacity:1;
    }
}
@keyframes growSize {
    0% {
        transform-origin: center center;
        transform: scale(1);
        opacity:1;
    }
    10% {
        transform: scale(3);
        opacity:.2;
    }
    50% {
        transform: scale(1);
        opacity:.2;
    }
    100% {
        opacity:1;
    }
}

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>

*
*