admin管理员组

文章数量:1401134

I have a path I wish to animate:

 <motion.path
      initial={{ pathLength: 0 }}
      transition={{ duration: 5, ease: 'easeInOut' }}
      whileInView={{ pathLength: 1 }}
      viewport={{ once: true, amount: 0.5 }}
    />

I want to start the animation when it comes in to view, and even if the user scrolls away, I want the animation to have continued regardless.

What I am getting now is the animation starts when in view, but if you scroll away, it stops, when you come back, what is left to animate is subject again to a full 5 seconds of animation, making it animate very slowly if upon first view, the line was almost animated completly.

本文标签: framer motionAnimate When In ViewOnceStack Overflow