Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strange layering issues #24

Closed
fred-boink opened this issue Feb 15, 2021 · 4 comments
Closed

Strange layering issues #24

fred-boink opened this issue Feb 15, 2021 · 4 comments

Comments

@fred-boink
Copy link

Screen Shot 2021-02-14 at 8 58 45 PM

Not sure what is happening but the layers seem to be broken. For sure this is something I am doing but I am wondering if anyone has seen this and knows what I am doing wrong! Thanks.

@RobertBroersma
Copy link
Owner

Hi @fred-boink

I'm not entirely sure how it works, but I had this exact same issue when I was developing the big heads website.

I'm guessing you're using Next JS SSG or SSR, which prerenders a random character. Once the client hydrates this prerender, yet another random character is generated. These are not the same and that somehow causes this weird phenomenon! (causing that warning message in your console as well).

Could you try having this page not-prerendered? Or at least the character.

@fred-boink
Copy link
Author

I am using Nextjs. Ill try to get it to render only clientside. Thanks for your answer! Ill let you know how it goes.

@fred-boink
Copy link
Author

It worked! Thank you. Curious, why foes facialHairMap have 3 Noop?

@RobertBroersma
Copy link
Owner

@fred-boink Great!

When generating a random character I randomly select an array element from every available part. This means if the options were medium beard, stubble and nothing there would be a 66.7% chance of a random character having a beard. I though this would be a bit much, but I didn't want to implement a whole probability model, so I just added some extra None in there 😅 .

For the same reason I added 5 Noops to the hatMap!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants