Skip to content

gu1lhermelp/frontend-nanodegree-mobile-portfolio

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Image optimizations

All images were made smaller. (I used ImageMagick)

CSS and JS minification

The CSS and JS files for the index page were minified (Got the minified files from PageSpeed Insights).

index.html optimizations

  • added the media attribute to print.css so to unblock DOM creation;
  • set the google-analytics js file as async as it does not tweak the DOM.

Pizza main.js optimizations

Two optimizations were made to the main.js file, both related with forced reflow:

  • the first change was made to the changePizzaSizes function. The loop was made simpler by removing the line that queried the offsetWidth, forcing the layout to be painted just to be repainted in the next line when the width was set;
  • the second optimization was made to the updatePositions function. The loop in it was also forcing the layout to be repainted every iteration. In order to solve this, one loop was made to calculate the new position of each pizza and another loop to set the position.

Instructions to run

Open index.html on your browser.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 54.0%
  • HTML 40.5%
  • CSS 5.5%