#Issue with ClientRouter and Canvas scripts

19 messages · Page 1 of 1 (latest)

hardy cargo
#

What's happening:
Using ClientRouter and navigating to a route and getting back to the root ( / ) the Canvas effect of appearing cells doesn't render even thought the script seem to be working.

#

The image you see bellow is a link to the /projects/redis page which has nothing inside of it and on the top you can see the canvas with the orange cells

#

if you enter to the page and get back to the root ( / ) page you can see that the canvas effect is not working and it had slide down to the projects section

#

After entering the link card and getting back to the root

#

You can see that behind the card is the Canvas element

#

The Details:
Both of the existing canvas on the page are wrapped by a CanvasProvider Component which the only thing it does is look for thue canvas with the ID canvas-effect and execute a function that sets up the effect of the appearing orange cells ( they can also be gray ).

#

It wraps two component which are the Hero and the Projects in the page respectively and at the bottom of those components is the Canvas component which just applies a gradient to the canvas, and the canvas itself

#

If you wanna see it, the relevant files are

  • src/components/Canvas/Canvas.astro,
  • src/components/Canvas/CanvasProvider.astro,
  • src/pages/index
tranquil burrow
#

Hi @hardy cargo 👋 sorry for the late response.

#

i'm not able to reproduce the broken canvas.
I checked out https://github.com/dyxgou/portfolio.git and switched to the page-transition branch.
In dev as well as with build, the squares still blink when i come back from the redix page.
What am I possibly doing wrong?

#

ah, that version does not use the ClientRouter.

hardy cargo
hardy cargo
hardy cargo