I have an idea in mind, and want some perspectives on what would make sense for the best implementation. The premise is basically slow moving objects ricocheting around inside an enclosure. Think like the game 'asteroids' but without a spaceship (and colliding with the walls instead of passing through).
Because this is to be in the background and purely aesthetic, I figure it's got to be pretty lightweight. I would use all CSS, but my question is can multiple animations be applied to an object? Say if I have a square bouncing around in a box using
---------
.square {
animation: moveX 2.05s linear 0s infinite alternate, moveY 2.4s linear 0s infinite
@keyframes moveX {
from { left: 0; } to { left: 480px; }
}
@keyframes moveY {
from { top: 0; } to { top: 280px; }
}
}
How can I get it to rotate continuously as well? Or at least create some effect that does so? If I need to put something together with javascript then that's fine, just curious whether I'm overlooking something with the CSS.