Hey everyone, I'm in need of some assistance with my animation. I've created a button that moves right and left in a loop, but I'm encountering an issue when the mouse moves away from the button. The transition is not smooth and it jumps back to its starting position.
.hover {
padding: 20px 30px;
font-size: 20px;
font-weight: 500;
background: rgba(33, 150, 243, 1);
transition: all .6s linear;
color: #fff;
margin: 50px;
border: none;
}
.hover:hover {
animation: pulse .6s infinite alternate;
transition: all .6s linear;
}
@keyframes pulse {
0% {
transform: translate(0px)
}
100% {
transform: translate(10px)
}
}
<div>
<button class="hover">Move Right And left</button>
</div>
Any suggestions on what might be causing this issue?
Thanks for your help :)