Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flip element with css continuously without action [closed]

Tags:

css

animation

I want to flip an element continuously on the y axis from 0 to 360 degree with css without an action (button, hover).

Some script allow it one single time by adding a class, like: animate.css

And other just flip on button press (http://desandro.github.io/3dtransforms/docs/card-flip.html) or on hover (http://davidwalsh.name/demo/css-flip.php)

.img:hover {
   transform: rotateY(360deg);
   transition: transform 10s;
}

That what I tried so far, but it does only work once and only on hover...

Can you help me to get the code?

like image 291
Zoker Avatar asked Nov 11 '14 14:11

Zoker


1 Answers

Use a CSS animation with infinite.

img {
    -webkit-animation: anim 10s infinite linear;
    animation: anim 10s infinite linear;
}

@-webkit-keyframes anim {
    from {-webkit-transform: rotateY(0deg);}
    to {-webkit-transform: rotateY(360deg);}
}

@keyframes anim {
    from {transform: rotateY(0deg);}
    to {transform: rotateY(360deg);}
}
like image 186
Simon Arnold Avatar answered Sep 18 '22 18:09

Simon Arnold