Coder Social home page Coder Social logo

savokiss / 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 2.0 0.0 3.04 MB

Udacity Optimization project

Home Page: http://savokiss.me/frontend-nanodegree-mobile-portfolio

CSS 6.35% HTML 35.01% JavaScript 58.64%

frontend-nanodegree-mobile-portfolio's Introduction

Website Performance Optimization portfolio project

性能优化课程 @ Critical Rendering Path course.

PageSpeed 链接 @ Google PageSpeed

本项目在线链接 @ http://savokiss.me/frontend-nanodegree-mobile-portfolio/

Getting started

  • 本项目不需要任何其他构建工具,直接运行 index.html 即可

Optimization Overview

Part 1: 优化 index.html 达到 pageSpeed 90分以上

  1. 将打印的 css 设置 media 为 print
  2. 移除 GoogleAnalytics 代码
  3. 根据 pageSpeed 的建议压缩过大的图片
  4. 将 pizzeria.jpg 图片增加缩略图版本以优化在首页显示的是小图的加载速度
  5. 移除不必要的字体链接

Part 2: 优化 pizza.html 的帧速

  1. 优化 updatepositions 方法以达到 滚动时保持 60 fps
  2. 优化 changePizzaSizes 方法以达到 滑块跳转 pizza 大小的实际小于 5ms
  3. (new) 优化 main.js 中的 querySelector 性能,用性能更高的 getElementById 替换 querySelector, 用 getElementsByClassName 替换 querySelectorAll
  4. (new) 优化 main.js 中 for 循环中的变量,在 for 循环外声明变量,节省内存空间
  5. (new) 优化 DOMContentLoaded 中生成 pizza 个数的算法,根据 viewport 动态生成 pizza

frontend-nanodegree-mobile-portfolio's People

Contributors

cameronwp avatar durant-udacity avatar savokiss avatar susansmith avatar safadurimo avatar walesmd avatar hkasemir avatar mrk-nguyen avatar nicolasartman avatar aaronbutler avatar

Watchers

James Cloos 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.