Infinite rotation animation using CSS and Javascript

Anuj Kaithwas picture Anuj Kaithwas · Aug 18, 2012 · Viewed 25.7k times · Source

I was going thru some single page website examples and found this: http://alwayscreative.net/. I am totally amazed by the disc in the background that rotates infinitely. i have looked at some examples but none worked that way. Can anyone tell me how was that implemented. Thanks.

Answer

Roko C. Buljan picture Roko C. Buljan · Aug 18, 2012

CSS3:

@keyframes rotate360 {
  to { transform: rotate(360deg); }
}
img { animation: 2s rotate360 infinite linear; }
/* TODO: Add -vendor-prefixes for different browsers */
<img src="//placehold.it/200x200/cfc?text=Wooo!" />