Jump to content

Site Animation causing page flashing when loading

Recommended Posts

Site URL: https://steinouercreative.com/extras

Hoping someone can help.  When I try turning on a site wide animation in design, it causes the page to seemingly load twice very fast.  I tried removing all the custom code I had and the problem still persists (I have left the code off for the moment but tried adding it back piece by piece and the issue never occurred again until I turned on animations in the Site Style design).  I did a screen recording showing it happen which can be viewed here.  https://www.dropbox.com/s/zco1q8r3mvgwkt4/ScreenCapture.m4v?dl=0

Any insight on the cause and solution would be greatly appreciated.

Link to comment
  • 1 month later...
  • 5 months later...

I was having this issue on page load/page switch. The pages displayed in full for a ms before doing the fade-in site wide animation.

This is what I used to fix it (add to custom css section in settings)

body:not([data-animation-state="booted"]) > * {
  opacity: 0;
}

This waits for the 'data-animation-state' attribute to be added to body before showing any elements, essentially skipping the full display that happens before the animations are queued

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.