Code Monkey home page Code Monkey logo

frontend-nanodegree-mobile-portfolio's Introduction

Website Performance Optimization portfolio project

The aim of this project was to

  • Optimize PageSpeed Insights score for index.html
  • Optimize Frames per Second in pizza.html

Setup

Follow the steps below to set up the project

  1. Clone or download the repo.
  2. Navigate to the project directory and run npm install to install all the node dependencies.
  3. Run grunt to apply automated optimizations like minification and image compression.
  4. The dist folder contains the production optimized version and src folder contains the development version.
  5. You can also check the app hosted on github.io.

Optimizations performed

Part 1 - Optimize PageSpeed Insights score for index.html

  1. Resized and compressed image "pizzeria.jpg" to reduce size by 99%.
  2. Moved scripts to bottom of index.html just before the </body> tag to unblock CRP.
  3. Added media query to print stylesheets to unblock rendering.
  4. Achived 50% reduction in transferred bytes by minifying and combining scripts using grunt-contrib-uglify plugin.
  5. Removed render blocking CSS using grunt-critical plugin.
  6. Used grunt-contrib-imagemin plugin to optimize and compress images. This saved 103 KB of data.

After performing these optimizations, the Page Speed score improved to 95+ for both mobile and desktop.

Part 2 - Optimize Frames per Second in pizza.html

  1. Wrap the function body inside requestAnimationFrame
  2. Fetch and assign "scrollTop" outside of the loop
  3. Reduce the number of movable pizza elements from 200 to 30, since rest of the pizza elements are outside the viewport due to fixed positioning and performance depends on the number of elements modified.

frontend-nanodegree-mobile-portfolio's People

Contributors

aaronbutler avatar cameronwp avatar durant-udacity avatar mrk-nguyen avatar nicolasartman avatar royshouvik avatar safadurimo avatar susansmith avatar walesmd avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Forkers

digideskio

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.