简体   繁体   中英

React framer-motion delay glitch

This is the website that I've used Framer-motion on it. https://farhadf.com/

If you open it on three tabs of chrome and refresh and check the header par, you'll see that the text animation starts overlapping.

  <div className={styles.container}>
          <div className={styles.h2}>
            <motion.h2
              animate={{
                y: [-100, 0, 0, 100],
              }}
              transition={{
                duration: 2.5,
                repeatType: "loop",
                repeat: Infinity,
                repeatDelay: 5,
              }}
            >
              I develope <span style={{ color: color }}>websites</span>
            </motion.h2>
          </div>
          <div className={styles.h2}>
            <motion.h2
              animate={{
                y: [-100, 0, 0, 100],
              }}
              transition={{
                duration: 2.5,
                repeatType: "loop",
                repeat: Infinity,
                repeatDelay: 5,
                delay: 2.5,
              }}
            >
              I produce <span style={{ color: color }}>music</span>
            </motion.h2>
          </div>
          <div className={styles.h2}>
            <motion.h2
              animate={{
                y: [-100, 0, 0, 100],
              }}
              transition={{
                duration: 2.5,
                repeatType: "loop",
                repeat: Infinity,
                repeatDelay: 5,
                delay: 5,
              }}
            >
              I develope <span style={{ color: color }}>games</span>
            </motion.h2>
          </div>
          <h1>
            Hello, I’m <strong style={{ color: color }}>Farhad Faraji</strong>,
            Web Developer, Game Designer,
            <br />
            Music Producer & Audio Engineer.
          </h1>
        </div>

I would appreciate any help

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM