Jump to content
Search Community

How to make the text endless?

Yuanyuanya test
Moderator Tag

Recommended Posts

I wanna make the text endless, but it looks weird.(i think 'repeat:-1' isn’t suitable here)

 

So is there any good ways to make it  look more nature.

 

import React,{useState,useEffect,useRef} from "react";
import {gsap} from "gsap/dist/gsap"

const SliderText=()=>{

    const textOne=useRef()

    useEffect(()=>{
        gsap.to([textOne.current],{
            xPercent:-100,
            duration:15,
            repeat:-1,
            ease:'none'
        })
    },[])

    return(
    <div>
        <p ref={textOne} className="text-8xl whitespace-nowrap text-secondary">ABSCSCA ABSCSCA ABSCSCA ABSCSCA ABSCSCA ABSCSCA</p>
    </div>)
}

export default SliderText

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...