Git Product home page Git Product logo

frontend-nanodegree-mobile-portfolio's Introduction

Website Performance Optimization portfolio project

Note: The original README.md is here.

The application is running on Github.

Optimizations performed on views/js/main.js

  1. Converted pizza size slider to percent width. Refactored changePizzaSize() by more efficiently computing the newwidth value, using a more efficient selector (.getElementByClassName), and brought the selector outside the for-loop.

  2. Brought the document.getElementById(“randomPizzas”) outside the for-loop for creating the random pizzas to improve page load. No effect on FPS speed.

  3. Modified updatePositions() to generate more of the phase computation outside the for-loop.

  4. Modified the code that runs when the page loads or resizes to only add background pizzas in the visible window (typically 16 - 24 depending on window height) instead of 200. Also moved the selector outside the for-loop and changed the selector to the more efficient (.getElementById instead of .querySelector). These changes include the generatePizzas() function, and adding an eventListener for window resize.

  5. A style sheet change was also made to use separate layers for the backgroud pizzas to improve the FPS response.

Build tools

I used the CodeKit build tool on this project after evaluating several build tools. Currently I am using the tool's minifier to minify the views/js/main.js file. The minified file is automatically generated after each save on Sublime. I also have the tool checking syntax with JSHint and reloading after every source code save. I have changed pizza.html before submission to use the minified JS. The build tool has a lot of capability that I am still learning to use.

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.