Coder Social home page Coder Social logo

frontend-nanodegree-mobile-portfolio's Introduction

Website Performance Optimization portfolio project

Running The Application

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/index.min.html
  2. Download and install ngrok to make your local server accessible remotely.
$> cd /path/to/your-project-folder
$> ngrok 8080
  1. Copy the public URL ngrok gives you and run it through PageSpeed Insights, accessing the index.min.html file! More on integrating ngrok, Grunt and PageSpeed.

Part 2: Optimize Frames per Second in pizza.html

Open views/pizza.html in chrome. Scroll and adjust the pizza size using the slider on the page.

Optimizations in main.js

Pizza Resize

I refactored the resize code to use smallPizza, mediumPizza and largePizza css classes instead of setting width and height on the divs directly. Resize time is under 1ms.

Scrolling

I moved an expensive scrollTop lookup/calculation out of the loop.

Other Optimizations

Grunt is being used to minimize and inline css, js, and html for both the pizza and index files. Grunt can be executed by first installing its dependencies using npm install, then grunt can be executed using the grunt command.

For both index and pizza files, .min.html and .dist.html files have been created. The .dist.html files inline and minimize css and js as appropriate. The .min.html further minimize the html files. The .min.html files should be used, the .dist.html files are just provided to make it a little more obvious what's going on.

frontend-nanodegree-mobile-portfolio's People

Contributors

durant-udacity avatar justincinmd avatar nicolasartman avatar

Watchers

 avatar  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.