Yuanyuanya Posted August 3, 2021 Share Posted August 3, 2021 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 More sharing options...
OSUblake Posted August 3, 2021 Share Posted August 3, 2021 This thread should point you in the right direction. 2 Link to comment Share on other sites More sharing options...
Yuanyuanya Posted August 4, 2021 Author Share Posted August 4, 2021 Thank you so much Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now