I have an animation of rapidly "breathing" (quickly scaling up and down) letters. My goal is to have that breathing smoothly slow down on hover, then slowly becoming faster again when the cursor leaves - right now, I am changing the animation-duration on hover, though this causes the animation to abruptly slow down, jumping to a different frame. Transitioning the animation-duration didn't work, "transition" hasn't gotten me anywhere for that fact. JavaScript solutions also welcome!
.r {
animation-name: breathe;
animation-iteration-count: infinite;
animation-timing-function: linear;
animation-duration: 0.8s;
}
.r:hover{
animation-duration: 4s;
}
@keyframes breathe{
0% {transform: scale(1)}
50% {transform: scale(1.2)}
100% {transform: scale(1)}
}