motion icon indicating copy to clipboard operation
motion copied to clipboard

When I apply the animation, it starts to slow down

Open rtkirill opened this issue 1 year ago • 0 comments

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.

rtkirill avatar Aug 30 '23 08:08 rtkirill