I am using CSS animation to apply a 'wobble' effect to each letter within a word. The letters are represented by SVG groups <g>
. However, in the provided example, the wobbling effect becomes more pronounced with each subsequent letter, whereas I desire a consistent 'wobble' for each individual letter. How can I achieve this consistency?
Kindly note that I have omitted the SVG source code for the sake of clarity in the question. Should you require it, you can find it in the provided example.
Thank you.
SCSS
// Logo
.logo {
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%,-50%);
z-index: 1;
width: 260px;
display: block;
// SVG
svg {
display: block;
width: 100%;
overflow: visible;
g {
fill: transparent;
transition: all 300ms ease-in-out;
@keyframes wobble {
0% { transform: rotate(0) translate3d(0, 0, 0) }
25% { transform: rotate(2deg) translate3d(1px, 0, 0) }
50% { transform: rotate(-1deg) translate3d(0, -1px, 0) }
75% { transform: rotate(1deg) translate3d(-1px, 0, 0) }
100% { transform: rotate(-2deg) translate3d(-1px, -1px, 0) }
}
animation-duration: 400ms;
animation-iteration-count: infinite;
animation-fill-mode: none;
animation-name: wobble;
animation-timing-function: ease-in-out;
path {
fill: red;
}
}
}
}