GithubHelp home page GithubHelp logo

andrewtdunn.github.io's Introduction

Website Performance Optimization portfolio project

Deployed Project

To test the Google Page Insights of a deployed project - Google Page Insights

Note: this is the development branch. The master branch only includes the contents of the dist folder.

I spent most of my time modifying the 2048 game to a star trek theme. Please play with it and let me know what you think. Its really cooler when you get to the higher levels

re: resizing pizzas. per the example in the class, just resized using percent rather than the too-complex px conversion.

I didn't do a radical redesign in the interest of time but I am working on my portfolio.

note on pizza.html. The use of the slider on the pizza resizing page is really confusing and bad ux design. There's no reason to use a slider when there are only three discrete sizes.

In main.js - optimizations per review suggestions

  • uses strict mode
  • scroll listener is refactored. Instead of calling updatePositions, it calls requestAnimateFrame(updatePositions), to update the scroll position at the start of each frame.
  • replaces document.querySelector() with document.getElementById()
  • replaces document.querySelectorAll() with document.getElementsByClassName()
  • in for loop, change assign array length to a variable. question - is this a micro-optimization? the js compiler may not care how the array length is declared
  • declares pizzaDivs outside of for loop
  • adjust sin functionality to adjust pizza movement (note: more description here of the expected behavior would have been helpful, although it is hard to describe)
  • creates elem variable outside of for loop
  • creates movingPizzas var outside of for loop
  • determines the number of rows of background pizzas by screenheight
  • updates number of rows on window resize

##Dependencies for Development

Note: I tried using gulp-concat to compress the 2048 javascript files but it altered the js functionality and the game wouldn't run. Maybe there are options which I can use to configure gulp-concat.

  • install node.js and npm install node. how to install npm on a mac. how to install npm on a pc.

  • install devDependencies. cd to main directory (which has the gulpfile). Install each of the following packages (gulp, gulp-sass, gulp-watch, autoprefixer, browser-sync, gulp-eslint, gulp-jasmine-phantom, gulp-concat, gulp-uglify, gulp-babel, gulp-imagemin, imagemin-pngquant, gulp-gh-pages) with the following npm command:

$> npm install --save-dev package_name
  • run gulp
$> gulp
  • sass should compile on change + save and reload in browser
  • html change also triggers reload
  • Edit files in the src folder not the dist folder!
  • work in development branch and push to remote repository like so:
$> git push origin development

Deploying to gh-pages

The gulp deploy command deploys the dist folder to the master branch. The master branch is served by github.io

$> gulp dist
$> gulp deploy

Testing Page Speed During Development

  1. Build dist
$> cd path/to/dist/folder
$> gulp dist
  1. Run on a local server
$> cd path/to/dist/folder
$> python -m SimpleHTTPServer 8080
  1. Download and install ngrok to make your local server accessible remotely.
$> npm install -g ngrok
$> cd dist
$> ngrok http 8080
  1. Copy the public URL ngrok gives you ("forwarding" url) and run it through PageSpeed Insights

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.