Giter Club home page Giter Club logo

frontend-nanodegree-mobile-portfolio's Introduction

Website Performance Optimization

Project Overview

Project #4 of Udacity's Front-End Web Developer Nanodegree. The task was to optimize Cameron's portfolio website to get at least 90 for Mobile and Desktop PageSpeed score for index.html. Second task was to optimize views/js/main.js and views/pizza.html to render with a consistent frame-rate at 60fps when scrolling.

Preview

Live preview (non-compressed css and js files) available with GitHub Pages. Also online PageSpeed score

Local
1. Get Sources
$ git clone https://github.com/kshpikat/frontend-nanodegree-mobile-portfolio.git
2. Open the application in the browser
<path_to_app>/index.html

Part 1: How index.html was optimized for PageSpeed

  • images were optimized in Abode Photoshop to have according image size and quality
  • CSS for printing was tagged with media="print" attribute
  • CSS was minified with https://cssminifier.com/
  • main CSS file and font CSS from google was moved into index.html to reduce turnover
  • for Google Analytics and perfmatters.js scripts loading lines async attribute was added
  • Google Analytics init script was moved to the bottom of index.html
  • perfmatters.js script was minified with https://jscompress.com/
  • index.html was minified with https://www.willpeavy.com/minifier/

Part 2: Optimize Frames per Second in views/pizza.html & views/js/main.js

  • images were optimized in Abode Photoshop to have according image size and quality
  • move .mover items to the separate layer with transform: translateZ(0); to avoid re-painting
  • uses mover.style.transform = translateX() instead of changing mover.style.left to avoid re-painintg
  • get DOM selection calls and expensive calculations out of big loops
  • reduced the number of 'mover' class objects created from 200 to a smaller amount (approx 30-50) based on the browser window size.
  • used style transformX() to animate the mover class objects as it is a composite-only operation and is GPU accelerated on some browsers

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.