This is a project from Udacity's Front-End Web Developer Nanodegree.
Click here. This site is optimized to achieve a score over 90/100 for the analysis from PageSpeed Insights.
In the portfolio page, you can find the link to the pizza page, which is optimized to achieve 60 FPS when scrolling the page and less than 5 ms when resizing pizzas on the page.
- inline style.css and print.css
- add "async" to script tags
- comment out google font
- resize images to reduce bytes
- move code involving layout out of for loops to avoid forced synchronous layouts (FSL)
- add randomPizzaContainers to avoid repeating work
- redesign the algorithm for changing pizza sizes to avoid FSL and save unnessesary work
- add "use strict"
- replace querySelectorAll by getElementsByClassName
- replace querySelector by getElementById
- save *.length in for loop conditions in var len
- move declaration of pizzasDiv, elem, and movingPizzas1 outside the loop