I'm trying to get text that says "Hey there!" to move in a sort of wavy fashion, similar to what you might see in an RPG. Here's the css I'm working with:
.wiggly span {
font-family: 'Montserrat', sans-serif;
font-size: 90px;
font-weight: bold;
-webkit-animation: wiggle 1.5s ease-in-out infinite;
-webkit-animation-delay: calc(0.1s * var(--i));
}
@-webkit-keyframes wiggle {
0% {
transform: translateY(0);
}
20% {
transform: translateY(-10px);
}
40% {
transform: translateY(10px);
}
60% {
transform: translateY(10px);
}
80% {
transform: translateY(-10px);
}
}
<div class="wiggly">
<span style="--i:1;">H</span>
<span style="--i:2;">e</span>
<span style="--i:3;">y</span>
<span style="--i:4;"> </span>
<span style="--i:5;">t</span>
<span style="--i:6;">h</span>
<span style="--i:7;">e</span>
<span style="--i:8;">r</span>
<span style="--i:9;">e</span>
<span style="--i:10;">!</span>
</div>
I adapted my code off of this code example and this youtube video. Any idea where I'm going wrong? Thanks!