I want to make an animated svg logo using css animation with keyframes. The animation works well, but I can not find a way to properly time the keyframes.
I want to achieve the below timeline:
- step 1: 4 seconds pause (the original image should be shown),
- step 2: 2 seconds animation (one full circle of horizontal rotation),
- step 3: 4 seconds pause (the original image should be shown),
- step 4: 2 seconds animation (one full circle of vertical rotation),
- step 5: repeat step 1-4 infinitely.
I have the below svg code:
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 20">
<defs><style>
.txtme {
transform-origin: center;
animation: anime 12s linear 3s infinite;
}
@keyframes anime {
33% { transform: rotate3d(0, 1, 0, 360deg); }
66% { transform: rotate3d(1, 0, 0, 360deg); }
}
</style></defs>
<text class="txtme" fill="#000" x="25%" y="50%" style="font-family:sans-serif;">MyLogo</text>
</svg>
Could you please help me how could I achieve the above timeline using css keyframes.