Hello GSAP community,
I'm working on a React project where I'm attempting to create a smooth page transition with GSAP and React Router. The specific effect I aim to achieve is this: when a user clicks on a button (which is text with a background image), I'd like the image within the text to grow and eventually become the background image of the new route.
Here's the scenario in detail:
- I have a list of clickable project cards on the homepage, each with text over a background image.
- when clicking one of these text elements, I would like the background image to expand, filling the entire screen and then transitioning into the background of the next page
So far, I have tried animating the scale of the element . However, I am running into two main issues:
1. The `scale` property does not seem to be the correct approach for making the image become the background smoothly.
2. The transition to the other route comes off as abrupt and I'm struggling to integrate the animation seamlessly into the page change.
I would greatly appreciate any advice on how to create a seamless transition where the clipped background image expands to fill the screen and serves as a connector between the two routes.
Here's a link to a current sample of the project on CodeSandbox: Codesandbox Exemple