Looking to replace a loading spinner with this character:
֍
Here's my current setup:
.spinner::after {
animation: rotating 2s linear infinite;
content: "֍";
font-size: 60px;
display: inline-block;
font-weight: normal;
transform-origin: 50% 50%;
}
@keyframes rotating {
0% {
transform: rotate(0deg) scale(1);
color: rgba(0, 0, 0, .5);
}
50% {
transform: rotate(180deg) scale(.8);
color: rgba(0, 0, 0, .85);
}
100% {
transform: rotate(360deg);
color: rgba(0, 0, 0, .5);
}
}
<i class="spinner"></i>
Although it works, the rotation isn't perfect as it doesn't happen around the exact center of the character despite using
transform-origin: 50% 50%;
This makes the animation look subpar. Any suggestions on how to improve it?