GithubHelp home page GithubHelp logo

dipikachadha / frontend-nanodegree-mobile-portfolio Goto Github PK

View Code? Open in Web Editor NEW

This project forked from udacity/frontend-nanodegree-mobile-portfolio

0.0 1.0 0.0 3.12 MB

CSS 17.37% HTML 30.35% JavaScript 52.29%

frontend-nanodegree-mobile-portfolio's Introduction

Website Performance Optimization portfolio project

Improvements Implemented:

Index.html

  1. Compressed and resized pizzeria.jpg.
  2. Compressed profile picture.
  3. Compressed cam_be_like.jpg.
  4. Compressed 2048.png
  5. Inlined css.
  6. Removed request for google fonts and included the the required fonts in html.
  7. Minify index.html.

views/js/main.js

  1. Refactored updatePositions function which involved removing a bunch of unnecessary calculations and simplifying the for-loop.
  2. Refactored changePizzaSizes function again removing unnecessary calculations and removed forced asynchronous layout.
  3. Minified main.js
  4. For randomPizzas querySelectorAll is replaced getElementsByClassName.
  5. Declared the pizzasDiv variable outside the loop, so only DOM call is made one.
  6. Declared the phase variable (var phase;) in the initialisation of the for loop so as to prevent it from being created every time the loop is executed.
  7. Reduced the no.of background pizzas to 24.

views/css/style.css

  1. minified css.
  2. minified bootstrap-grid.css.
  3. Added transform: translateZ() to randomPizzaContainer.
  4. Added backface-visibility: hidden; property to randomPizzaContainer.

pizza.html

  1. Minified pizza.html
  2. Compressed pizzeria.jpg

Your challenge, if you wish to accept it (and we sure hope you will), is to optimize this online portfolio for speed! In particular, optimize the critical rendering path and make this page render as quickly as possible by applying the techniques you've picked up in the Critical Rendering Path course.

To get started, check out the repository and inspect the code.

Getting started

Part 1: Optimize PageSpeed Insights score for index.html

Some useful tips to help you get started:

  1. Check out the repository
  2. To inspect the site on your phone, you can run a local server
$> cd /path/to/your-project-folder
$> python -m SimpleHTTPServer 8080
  1. Open a browser and visit localhost:8080
  2. Download and install ngrok to the top-level of your project directory to make your local server accessible remotely.
$> cd /path/to/your-project-folder
$> ./ngrok http 8080
  1. Copy the public URL ngrok gives you and try running it through PageSpeed Insights! Optional: More on integrating ngrok, Grunt and PageSpeed.

Profile, optimize, measure... and then lather, rinse, and repeat. Good luck!

Part 2: Optimize Frames per Second in pizza.html

To optimize views/pizza.html, you will need to modify views/js/main.js until your frames per second rate is 60 fps or higher. You will find instructive comments in main.js.

You might find the FPS Counter/HUD Display useful in Chrome developer tools described here: Chrome Dev Tools tips-and-tricks.

Optimization Tips and Tricks

Customization with Bootstrap

The portfolio was built on Twitter's Bootstrap framework. All custom styles are in dist/css/portfolio.css in the portfolio repo.

frontend-nanodegree-mobile-portfolio's People

Contributors

cameronwp avatar durant-udacity avatar susansmith avatar safadurimo avatar walesmd avatar hkasemir 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.