Hi, i want to animate with TweenMax only once. it is possible to do it? the animation should be triggered only the first time that the user open the page. so if the user go into other page and then he came back the animation doesn't have to trigger.
Can I only use the sessions to do it or do some other methods exist?
See the Pen WqqZwW by damiano31 (@damiano31) on CodePen
Hello Nexal and welcome.
As SARFEX commented, this can be done using cookies or localstorage (I'd not recommend using IndexedDB for something this simple). I'd search for something like "js tell if user has visited page before" to find more information about how to do so.
Basic approach:
Check to see if a specific cookie or localstorage exists.
If it does, don't animate.
If it doesn't exist, animate whatever you want to animate and create