#frontend-nanodegree-mobile-portfolio
Udacity Front-End Web Developer Nanodegree Project 4
To build the project locally node.js must be installed first.
git clone
this repo- Go to the root of the project directory and type
npm install
to install the development dependencies - After the dependencies have installed type
gulp build
to generate thedist
files - Go to the
dist
directory and open index.html in your browser
To achieved a PageSpeed score above 90 I made the following optimizations:
- Minified and inlined CSS within the HTML file
- Minified and inlined Javascript and moved the script to the bottom of the page to prevent blocking
- Compressed images to reduce file size
- Added image
width
&height
properties to each image tag
- made minor improvements to variable declaration
- removed a String.capitalize transformation and added a CSS rule instead
- used more performant DOM element selectors
getElementById
andgetElementsByClassName
where applicable - cached the DOM element selectors that are re-used often
- moved several functions outside of the
resizePizzas
function - moved a height calculation outside of a for-loop
- added a function to use the
requestAnimationFrame
API to optimize concurrent animations http://www.paulirish.com/2011/requestanimationframe-for-smart-animating/