Issues with domready—animation flickering on page load.
See original GitHub issueI’m having a hard time getting around an issue that I think has to do with domready
. Each time I load my site (https://piotrf.pl) the plain keyframe CSS animations are being triggered twice, which causes an awkward flickering: https://s3-us-west-2.amazonaws.com/dropbox.piotrf.pl/Untitled.mov
Note how this flickering occurs only on server, not on hotloaded localhost. Here’s why I think domready
might be involved:
Has anyone encountered a similar issue?
Issue Analytics
- State:
- Created 6 years ago
- Comments:59 (28 by maintainers)
Top Results From Across the Web
Stop flicker - Load CSS via javascipt but before dom ready?
Sometimes when Im using jquery to add css to the page this creates a flicker effect as the page loads first without javascript, ......
Read more >How to Prevent flicker problem in css animation?
That's because the images haven't loaded, and they only start loading when the animation starts. To prevent this flickering, you can use the ......
Read more >flicker on first load - Banner Animation - GreenSock
Hi guys, I have been working on some banners over the past few days. I have setup an init() function which positions all...
Read more >Javascript 'Flicker' on page load | Community Support
I'm using a 'News Ticker' script that fades a feed of latest news stories in and out on the top of my page....
Read more >Smooth scroll issues and flashing items | Themeco Community
In addition to this, items that have loaded on the portfolio and the blog page (after the loading animation) flicker once or twice...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I have the same problem
@KyleAMathews we all win when you are awake.
In short: animations are executed twice. Once in index.html then a second time in componentindex.js:
I added console logging and can see the render is triggered just once in js (in component—src-pages-index-js-2d6cb1471a0df592f43f.js):
…E=(0,T.keyframes)(f),x=t.AboutContents=k.default.div(d,E),A=function(t){function n(){return(0,o.default)(this,n),(0,i.default)(this,t.apply(this,arguments))}return(0,u.default)(n,t),n.prototype.render=function(){return console.log(“IndexComponent triggered me during render”),e.createElement…
but well before that the animation is triggered (presumably from index.html:
Video of behaviour (chrome dev tools) at:
http://trustingcustomers.com/consolelogging.mp4
Note: console logging is not in place in the repo I mention above - and you need to do a gatsby build to see the behaviour (gatsby develop triggers it just once because of the way it serves files locally).