I want to rotate a rectangle by an angle of 360 degrees (or even > 360 degrees) using CSS. The center of the rotation is "right center". If I use the following CSS code for a rotation by 180 degrees (and trigger the rotation with JavaScript) it works fine:
.animated.rotation {
-webkit-animation-duration: 9s;
animation-duration: 9s;
}
@keyframes rotation {
from {
-webkit-transform-origin: right center;
transform-origin: right center;
opacity: 1;
-webkit-animation-timing-function: linear;
}
to {
-webkit-transform-origin: right center;
transform-origin: right center;
-webkit-transform: rotate3d(0, 0, 1, 180deg);
transform: rotate3d(0, 0, 1, 180deg);
opacity: 1;
-webkit-animation-timing-function: linear;
}
}
.rotation {
animation-name: rotation;
}
However, if I replace the 180 degrees by an angle >= 360 degrees it won't work anymore. For example in the case of 360 degrees nothing happens because the starting position is equal to the end position of the rotation.
How can I implement rotations by 360 degrees or more?