Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Infinite rotation animation using CSS and Javascript [closed]

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.

like image 244
Anuj Kaithwas Avatar asked Aug 18 '12 13:08

Anuj Kaithwas


People also ask

Is CSS animation faster than JavaScript?

CSS has fairly good performance as it offloads animation logic onto the browser itself. This lets the browser optimize DOM interaction and memory consumption and most importantly, uses the GPU to improve performance. On the other hand, Javascript performance can range from reasonably faster to much slower than CSS.

How do I rotate an image 360 in CSS?

You have to hover on the image and you will get the 360 degree rotation effect. Fiddle doesn't work o.O Chrome inspector does not like your CSS, specifically the "transform" and "transition-property".

How do you rotate animation in CSS?

Use CSS Animations to Rotate Image Continuously We will add the CSS command to the element we wish to rotate in this example. You can adjust the 2s to slow or speed up the rotation duration and rotate to 360 degrees in animation. Output: The image will be rotated to a full 360 degrees.


1 Answers

CSS3:

@keyframes rotate360 {
  to { transform: rotate(360deg); }
}
img { animation: 2s rotate360 infinite linear; }
/* TODO: Add -vendor-prefixes for different browsers */
<img src="https://i.stack.imgur.com/qCWYU.jpg?s=64&g=1" />
like image 124
Roko C. Buljan Avatar answered Oct 20 '22 01:10

Roko C. Buljan