Flash during page transition

Good morning everyone! Hoping someone can help me out here. My site has a lot of custom code to change the background color randomly upon refresh. But I’m having one major issue. Everytime my page transitions I get this weird flash of the original body color (or white if it doesn’t have one).

I made page transitions so that the page content is supposed to fade out and then back in on reload. I’m just trying to make the page transition seemless instead of having that flash as it changes the page.

Anyone know a code to help me out with this or what I need to change in Webflow???

Here’s my read only!