I'm using anime.js to provide an animation on my homepage. However I only want this animation to occur when a user comes from an external source (not from an internal link, such as the contact page of my website).
I've discovered this method:
window.onload = function () {
if (!('hasCodeRunBefore' in localStorage)) {
// code to run
localStorage.set.single('has_code_run_before', true);
}
}
However, I feel like this will only run the animation a single time EVER for that user (as long as the information remains cached).
Is there a way to make the animation work every time the user comes to my homepage (romanrogers.co), from an external source.
Thank you