motion
motion copied to clipboard
When I apply the animation, it starts to slow down
Hey there!
I'm attempting to slow down the animation when hovering over a motion element.
Here's my motion instance code:
motionInstance.value = useMotion(motionElement, {
initial: {
x: 0,
},
enter: {
x: direction.value * motionElement.value.offsetWidth,
transition: {
repeat: Infinity,
duration: 5000,
ease: "linear"
}
}
})
I use motionInstance.value.stop()
when the @mouseenter event is triggered and motionInstance.value.apply("enter")
when the @mouseleave event is called.
However, each time I hover over the element, the apply method slows down the animation more and more.