2

Possible Duplicate:
CSS3 Continous Rotate Animation (Just like a loading sundial)

I have this simple GIF loading circle. Is it possible something like this can be coded with just CSS3? Any help is much appreciated.

jsFiddle

Community
  • 1
  • 1
James
  • 323
  • 1
  • 3
  • 10

1 Answers1

2

HTML:

<div class="arc-hider"></div>

CSS:

@-webkit-keyframes rotate { 
    from { -webkit-transform: rotate(0deg) }
    to { -webkit-transform: rotate(360deg) }
}
@-moz-keyframes rotate { 
    from { -moz-transform: rotate(0deg) }
    to { -moz-transform: rotate(360deg) }
}
@-o-keyframes rotate { 
    from { -o-transform: rotate(0deg) }
    to { -o-transform: rotate(180deg) }
}
@-ms-keyframes rotate { 
    from { -ms-transform: rotate(0deg) }
    to { -ms-transform: rotate(360deg) }
}
.arc-hider {
    width: 30px;
    height: 30px;
    border-radius: 60px;
    border: 6px solid #36669F;
    position: absolute;
    left: 45%;
    z-index: 5;
    clip: rect(0px 21px 21px 0px);
    -webkit-animation: rotate 2s linear infinite 0s;-moz-animation: rotate 2s linear infinite 0s;-o-animation: rotate 2s linear infinite 0s;-ms-animation: rotate 2s linear infinite 0s;
    animation: rotate 2s linear infinite 0s;
}
​

Should do the trick

Live Demo | Source

extramaster
  • 2,635
  • 2
  • 23
  • 28