Code Monkey home page Code Monkey logo

frontend-nanodegree-mobile-portfolio's Introduction

frontend-nanodegree-mobile-portfolio

Udacity FrontEnd Nanodegree Project

Website Performance Optimization portfolio project - Solution

Part 1 Solution: Optimize PageSpeed Insights score for index.html

Following optimisation methods are applied to reduce CRP. Build tool gulp is used for this purpose.

Minimize Number of Bytes

Minimize the use of rendering block resources (CSS)

  • Minify and Inline CSS using critical plugin.

  • Media Queries on [link] tag to unblock rendering in print.css

Minimize use of parser blocking JS

  • Defer java script execustion using async attribute.

  • Google webfont is loaded asynchronously using JS.

Part 2 Solution: Optimize Frames per Second in pizza.html- Improve site scrolling perfo

###Change Pizza Size To increase Response time, I have declared new variable newWidth in function changePizzaSizes and hard coded width of small, medium and large Pizzas. So when the slider changes I am assaigning newWidth to all random Pizzas according to the newWidth. Removed unnessary fuction determineDx.

###Scrolling Pizzas##

Orignally 200 pizzas were being created no matter how many were to be displayed on screen. So changed to create only 24 pizzas in DOMContentLoaded.

  1. To achieve 60FPS while scrolling, I have done following optimisation in updatePositions function

  2. All mover pizza selected using getElementsByClassName rather than querySelectorAll.

  3. Calculated and cache length variable outside of the for loop.

  4. In Original code there was Force synchronised Layout happening as scollTop causes Layout to run inside the loop and that gets invalidated in style.left property assiagnment, also scollTop always same and there is no reason that calculation should exists inside the loop. So I decided to move the srollTop calculation outside the for loop and uses ScrollTop value from previous frame, which gave me good performance improvement in Javascript part of the frame.

  5. Since I reduced number of pizza to 24, browser has to apply recalculated style only for those 24 pizzas rather than 200 pizzas. That imp

Part 3 How to run the application:

  1. Check out the repository
$> git clone https://github.com/anoopmundathan/frontend-nanodegree-mobile-portfolio.git
$> cd frontend-nanodegree-mobile-portfolio
$> npm install
$> gulp
$> python -m SimpleHTTPServer 8080
  1. Open a browser and visit localhost:8080
  2. Download and install ngrok to make your local server accessible remotely.
$> cd frontend-nanodegree-mobile-portfolio
$> ngrok http 8080

frontend-nanodegree-mobile-portfolio's People

Contributors

anoopmundathan avatar durant-udacity avatar safadurimo avatar walesmd avatar susansmith avatar mrk-nguyen avatar nicolasartman avatar aaronbutler avatar

Watchers

James Cloos avatar

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.