Try my best to increase the loading and response speed. Make the page rendering as soon as posible.
- Optimize index.html, as least 90 points to pass the PageSpeed Insights test.
- Optimize FPS for pizza.html, reach or above 60fbs.
- Compress the image size of pizzeria.jpg (From 2.3M to 4K)
- Avoid using online fonts
- Add 'media="print"' for loading print.css
- Add 'defer' prop for loading analytics.js
- Move <script> tag after loading analystics.js and add 'defer' prop
- Pick some style defines out as inner css, move loading style.css to the bottom of the page
- For pizza background moving animation: reduce the pizzas' number, break loop when the pizza's top is higher than the screen
- Optimize pizza resize control, avoid use Layout before reset style in a loop.
- Compress the top image's size (From 2.4M to 139K)
- Use getElementById or getElementByClassName to replace querySelector
- updatePositions(): Optimize the position change loop for each 'mover'
- Open PageSpeed Insights
- Paste the Link, click 'Analyze' to check the optimizing result.
- Open the live Link
- Use DevTools to check the FPS when scroll the screen, change the size setting.