Skip to content

lastres0rt/frontend-nanodegree-mobile-portfolio

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

#Website Performance Optimization portfolio project Part of the Udacity Front-End Web Development Nanodegree

Several optimizations have been made to this portfolio to make index.html achieve at least a score of 90 according to Google PageSpeed Insights, as well as optimizing pizza.html to run at a rate of 60 fps or better.

How To Run It

Click this link for the Front-End Nanodegree Mobile Portfolio to see index.html, and then click this link for Cam's Pizzeria Page to see pizza.html.

Optimizations Made

index.html

  1. Asynchronous loading of Google WebFont (a JS file)
  2. Asynchronous loading of the Google Analytics tracker
  3. Asynchronous loading of the performance tracker
  4. Inlining of the CSS (to prevent round trips)
  5. Image optimization of large image files, specifically pizzeria.jpg

pizza.html

  1. Image optimization of large image files, specifically pizzeria.jpg
style.css
  1. The addition of will-change: transform; to the .mover class
  2. The addition of will-change: transform; to the .randomPizzaContainer class
main.js
  1. Reduced the number of pizzas needed in the background from 200 down to a dynamically-selected number based on window.innerHeight
  2. Optimized the updatePostions function to reduce the number of calculations and functions being made within the iteration loop, especially scrollTop
  3. Optimized the changePizzaSizes(size) function to reduce the number of calculations and functions being made within the iteration loop.
  4. Replaced instances of querySelector() with getElementById()
  5. Replaced instances of querySelectorAll() with getElementsByClassName()
  6. Refactored changePizzaSizes(size) to remove unnecessary functions and document calls.

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 47.3%
  • HTML 47.4%
  • CSS 5.3%