optimized index.html, js, css and img are in /dist. Run gulp default task
use localhost:[portnumber]/dist/index.html
Screenshots of pagespeed are in root project directory. mobile-result.png & desktop-result.png
Used ngrok and page speed insights for testing and checking and finally came to this.. Finalized files in /dist.
- removed the link to google font while it was render blocking
- added font ref to style.css
- read this article
- used this script and added custom script to observe the font
- minified it online here and added it inline in index.html
- used css minifier and inlined total css in the head
- made google analytics script async by changing the script
- made perfmatters.js script async
- added media="print" to print.css to remove it from crp
- minified print.css via gulp task
- minified the html via htmlmin as a gulp task
- optimized images with gulp task
- root images show my result with ngrok. It might be faster with github pages
- testing inline script vs references
- test and work with http cashing.
- started with tracing what causes low frame rate
- noticed updatePositions() was slow on scrolling
- made some modifications to the script. In a way that some dom calls and other calculations aren't called at each scroll event (which is expensive)
- saved timeline data
- refreshed the browser , started recording and scrolled many times.
- i noticed a lot of recalculate style and was because of the scroll event and DOM manipulation however some frame rates were closer to 30 than to 60 so i needed more investigation
- added native styles to css and removed from main.js
- used transform to position the .mover element (only transform not specific browser implementations). + added some css
- moved dom manipultation out of loops
- investigated the timeline data again and noticed i was more close to 60fps. However in some details were i was not i noticed 2 paints happening for big sizes. I tried some things but did not find a solution for that problem. 11 recreate the event after domContentLoaded for adding the images.