I want to achieve an effect that rotates and brings a view to the front. It was possible in regular UI system. Where I could rotate any UI element or the canvas in Z axis. But in the UI document only 2d rotation is possible as far as I can see. I tried USS as well. But the rotation seems not working. Maybe keyframe is not supported.
Can you guys give me a solution on this?
_
AchievementElement.AddToClassList("rotate-in");
_
@keyframes rotateOut {
0% {
transform: rotate(0deg);
opacity: 1;
}
100% {
transform: rotate(-90deg);
opacity: 0;
}
}
@keyframes rotateIn {
0% {
transform: rotate(90deg);
opacity: 0;
}
100% {
transform: rotate(0deg);
opacity: 1;
}
}
.rotate-out {
animation-name: rotateOut;
animation-duration: 0.5s;
animation-timing-function: ease-in-out;
animation-fill-mode: forwards; /* Ensures the element stays rotated */
}
.rotate-in {
animation-name: rotateIn;
animation-duration: 0.5s;
animation-timing-function: ease-in-out;
animation-fill-mode: forwards; /* Ensures the element stays rotated */
}