Git Product home page Git Product logo

frontend-nanodegree-mobile-portfolio's Introduction

网站性能优化项目

你要做的是尽可能优化这个在线项目的速度。注意,请应用你之前在网站性能优化课程中学习的技术来优化关键渲染路径并使这个页面尽可能快的渲染。

开始前,请导出这个代码库并检查代码。

指南

####Part 1: 优化 index.html 的 PageSpeed Insights 得分

以下是几个帮助你顺利开始本项目的提示:

  1. 将这个代码库导出
  2. 你可以运行一个本地服务器,以便在你的手机上检查这个站点
  $> cd /你的工程目录
  $> python -m SimpleHTTPServer 8080
  1. 打开浏览器,访问 localhost:8080
  2. 下载 ngrok 并将其安装在你的工程根目录下,让你的本地服务器能够被远程访问。
  $> cd /你的工程目录
  $> ./ngrok http 8080
  1. 复制ngrok提供给你的公共URL,然后尝试通过PageSpeed Insights访问它吧!可选阅读:更多关于整合ngrok、Grunt和PageSpeed的信息。

接下来,你可以一遍又一遍的进行配置、优化、检测了!祝你好运!

####Part 2: 优化 pizza.html 的FPS (每秒帧数)

你需要编辑views/js/main.js来优化views/pizza.html,直到这个网页的FPS达到或超过60fps。你会在main.js中找到一些对此有帮助的注释。

你可以在Chrome开发者工具帮助中找到关于FPS计数器和HUD显示的有用信息。Chrome 开发者工具帮助.

一些关于优化的提示与诀窍

使用Bootstrap并定制样式

这个项目基于Twitter旗下的 Bootstrap框架 制作。所有的定制样式都在项目代码库的 dist/css/portfolio.css 中。

安装gulp构建工具

  1. 安装gulp依赖

npm install --save-dev gulp gulp-uglify jshint gulp-jshint gulp-rename npm install --save-dev gulp-plumber gulp-connect jshint-stylish gulp-csslint

  1. 安装clean-css依赖

npm install gulp-clean-css --save-dev

  1. 运行gulp命令

gulp

frontend-nanodegree-mobile-portfolio's People

Contributors

aaronbutler avatar cameronwp avatar durant-udacity avatar hkasemir avatar mrk-nguyen avatar nicolasartman avatar safadurimo avatar sunrise2075 avatar susansmith avatar walesmd 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.