Skip to content

Commit f30680b

Browse files
author
Mike Wales
committed
Initial project commit.
1 parent f48c45d commit f30680b

19 files changed

+1891
-2
lines changed

README.md

Lines changed: 65 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,65 @@
1-
frontend-nanodegree-mobile-portfolio
2-
====================================
1+
## Website Performance Optimization portfolio project
2+
3+
Your challenge, if you wish to accept it (and we sure hope you will), is to optimize this online portfolio for speed! In particular, optimize the critical rendering path and make this page render as quickly as possible by applying the techniques you've picked up in the [Critical Rendering Path course](https://www.udacity.com/course/ud884).
4+
5+
To get started, check out the repository, inspect the code,
6+
7+
### Getting started
8+
9+
Some useful tips to help you get started:
10+
11+
1. Check out the repository
12+
1. To inspect the site on your phone, you can run a local server
13+
14+
```bash
15+
$> cd /path/to/your-project-folder
16+
$> python -m SimpleHTTPServer 8080
17+
```
18+
19+
1. Open a browser and visit localhost:8080
20+
1. Download and install [ngrok](https://ngrok.com/) to make your local server accessible remotely.
21+
22+
``` bash
23+
$> cd /path/to/your-project-folder
24+
$> ngrok 8080
25+
```
26+
27+
1. Copy the public URL ngrok gives you and try running it through PageSpeed Insights! [More on integrating ngrok, Grunt and PageSpeed.](http://www.jamescryer.com/2014/06/12/grunt-pagespeed-and-ngrok-locally-testing/)
28+
29+
Profile, optimize, measure... and then lather, rinse, and repeat. Good luck!
30+
31+
### Optimization Tips and Tricks
32+
* [Optimizing Performance](https://developers.google.com/web/fundamentals/performance/ "web performance")
33+
* [Analyzing the Critical Rendering Path](https://developers.google.com/web/fundamentals/performance/critical-rendering-path/analyzing-crp.html "analyzing crp")
34+
* [Optimizing the Critical Rendering Path](https://developers.google.com/web/fundamentals/performance/critical-rendering-path/optimizing-critical-rendering-path.html "optimize the crp!")
35+
* [Avoiding Rendering Blocking CSS](https://developers.google.com/web/fundamentals/performance/critical-rendering-path/render-blocking-css.html "render blocking css")
36+
* [Optimizing JavaScript](https://developers.google.com/web/fundamentals/performance/critical-rendering-path/adding-interactivity-with-javascript.html "javascript")
37+
* [Measuring with Navigation Timing](https://developers.google.com/web/fundamentals/performance/critical-rendering-path/measure-crp.html "nav timing api"). We didn't cover the Navigation Timing API in the first two lessons but it's an incredibly useful tool for automated page profiling. I highly recommend reading.
38+
* <a href="https://developers.google.com/web/fundamentals/performance/optimizing-content-efficiency/eliminate-downloads.html">The fewer the downloads, the better</a>
39+
* <a href="https://developers.google.com/web/fundamentals/performance/optimizing-content-efficiency/optimize-encoding-and-transfer.html">Reduce the size of text</a>
40+
* <a href="https://developers.google.com/web/fundamentals/performance/optimizing-content-efficiency/image-optimization.html">Optimize images</a>
41+
* <a href="https://developers.google.com/web/fundamentals/performance/optimizing-content-efficiency/http-caching.html">HTTP caching</a>
42+
43+
### Customization with Bootstrap
44+
The portfolio was built on Twitter's <a href="http://getbootstrap.com/">Bootstrap</a> framework. All custom styles are in `dist/css/portfolio.css` in the portfolio repo.
45+
46+
* <a href="http://getbootstrap.com/css/">Bootstrap's CSS Classes</a>
47+
* <a href="http://getbootstrap.com/components/">Bootstrap's Components</a>
48+
49+
### Sample Portfolios
50+
51+
Feeling uninspired by the portfolio? Here's a list of cool portfolios I found after a few minutes of Googling.
52+
53+
* <a href="http://www.reddit.com/r/webdev/comments/280qkr/would_anybody_like_to_post_their_portfolio_site/">A great discussion about portfolios on reddit</a>
54+
* <a href="http://ianlunn.co.uk/">http://ianlunn.co.uk/</a>
55+
* <a href="http://www.adhamdannaway.com/portfolio">http://www.adhamdannaway.com/portfolio</a>
56+
* <a href="http://www.timboelaars.nl/">http://www.timboelaars.nl/</a>
57+
* <a href="http://futoryan.prosite.com/">http://futoryan.prosite.com/</a>
58+
* <a href="http://playonpixels.prosite.com/21591/projects">http://playonpixels.prosite.com/21591/projects</a>
59+
* <a href="http://colintrenter.prosite.com/">http://colintrenter.prosite.com/</a>
60+
* <a href="http://calebmorris.prosite.com/">http://calebmorris.prosite.com/</a>
61+
* <a href="http://www.cullywright.com/">http://www.cullywright.com/</a>
62+
* <a href="http://yourjustlucky.com/">http://yourjustlucky.com/</a>
63+
* <a href="http://nicoledominguez.com/portfolio/">http://nicoledominguez.com/portfolio/</a>
64+
* <a href="http://www.roxannecook.com/">http://www.roxannecook.com/</a>
65+
* <a href="http://www.84colors.com/portfolio.html">http://www.84colors.com/portfolio.html</a>

css/print.css

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
@media print {
2+
* { background: transparent !important; color: black !important; text-shadow: none !important; filter:none !important; -ms-filter: none !important; }
3+
a, a:visited { color: #444 !important; text-decoration: underline; }
4+
a[href]:after { content: " (" attr(href) ")"; }
5+
tr, img { page-break-inside: avoid; }
6+
img { max-width: 100% !important; }
7+
@page { margin: 0.5cm; }
8+
p, h2, h3 { orphans: 3; widows: 3; }
9+
h2, h3{ page-break-after: avoid; }
10+
}

css/style.css

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
html {
2+
font-size: 100%;
3+
overflow-y: scroll;
4+
-webkit-tap-highlight-color: rgba(0,0,0,0);
5+
-ms-text-size-adjust: 100%;
6+
-webkit-text-size-adjust: none;
7+
}
8+
body { margin: 0; font-size: 14px; line-height: 1.61; font-weight: 400; }
9+
body, button, input, select, textarea { font-family: 'Open Sans', sans-serif; color: #333; }
10+
11+
a { color: #12C; }
12+
a:visited { color: #61C; }
13+
a:focus { outline: thin dotted; }
14+
a:hover, a:active { color: #c00; outline: 0; }
15+
16+
b, strong { font-weight: bold; }
17+
pre, code { font-family: monospace, monospace; font-size: 1em; }
18+
ul, ol { margin: 1em 0; padding: 0 0 0 20px; }
19+
img { border: 0; max-width: 100%; }
20+
21+
body { background: #fff; }
22+
header, footer, .container { max-width: 45em; margin: 0 auto; }
23+
24+
header { padding: 0 0.5em; color: #C90B0B; }
25+
header img { border-radius: 40px; float: left; }
26+
header p { font-size:1.5em; font-weight: bold; padding-left: 4em;}
27+
header p span { font-size: 0.8em; font-weight: normal;}
28+
29+
.hero { padding: 2em; background-color: #f8f8f8; font-size:1.2em;
30+
border-bottom: 1px solid #ccc;
31+
border-top: 1px solid #ccc;
32+
}
33+
34+
.content { padding: 1em 1em; }
35+
.content li { list-style-type: none; font-size: 1.1em;}
36+
li img { float:left; padding-right: 1em; }
37+
li p { font-size: 0.9em; font-style: italic; }
38+
39+
footer {
40+
padding: 0 0.5em;
41+
border-top: 1px solid #ccc;
42+
}
43+
footer span { float: right; font-style: italic; }
44+
45+
/* Smartphones (portrait) */
46+
@media only screen and (max-width: 480px) {
47+
body { font-size: 12px;}
48+
header p { padding-left: 4.5em;}
49+
}

img/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.DS_Store

img/2048.png

63.9 KB
Loading

img/cam_be_like.jpg

262 KB
Loading

img/mobilewebdev.jpg

186 KB
Loading

img/profilepic.jpg

14.1 KB
Loading

index.html

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1">
6+
<meta name="description" content=" FILL ME IN ">
7+
<meta name="author" content=" FILL ME IN ">
8+
<title>Cameron Pittman: Portfolio</title>
9+
10+
<!-- Hmm, what is the impact of web fonts on speed? Measure it... -->
11+
<link href="//fonts.googleapis.com/css?family=Open+Sans:400,700" rel="stylesheet">
12+
13+
<link href="css/style.css" rel="stylesheet">
14+
<link href="css/print.css" rel="stylesheet">
15+
16+
<script>
17+
(function(w,g){w['GoogleAnalyticsObject']=g;
18+
w[g]=w[g]||function(){(w[g].q=w[g].q||[]).push(arguments)};w[g].l=1*new Date();})(window,'ga');
19+
20+
// TODO: replace with your Google Analytics profile ID.
21+
ga('create', 'UA-XXXX-Y');
22+
ga('send', 'pageview');
23+
</script>
24+
<script src="http://www.google-analytics.com/analytics.js"></script>
25+
<script async src="js/perfmatters.js"></script>
26+
</head>
27+
28+
<body>
29+
<header>
30+
<a href="/"><img src="img/profilepic.jpg"></a>
31+
<p>Cameron Pittman<br><span>Course Developer</span></p>
32+
</header>
33+
34+
<div class="container">
35+
<div class="hero">
36+
<strong>I love web development!</strong> This is a template for a simple portfolio. I decided to use it to showcase a few Udacity courses I've taken and some teaching work, but you can use it to showcase any kind of project that you want the world to see :) <br> Contact me: [email protected]
37+
</div>
38+
39+
<div class="content">
40+
<ul>
41+
<li>
42+
<img src="https://lh4.ggpht.com/kJEnfqhPvtm4m3EneSZ4fWYGS8lW4YNhEjk6zPkyrQaBUHc-2Y_ElDic99NHI0h-UBLXVbRCjFybFvrWxdk=s100">
43+
<a href="project-2048.html">Build Your Own 2048!</a>
44+
<p>I made my own version of 2048. How cool is that!?</p>
45+
</li>
46+
47+
<li>
48+
<img src="https://lh6.ggpht.com/f_0W8h__3G99CWTjnMjD8BUKm7yp2-wJyApLtTwFoFtlal2ULf_JgHIsOQq2NiYfKOdMlXlMHDKNo5XVZLs=s100">
49+
<a href="project-webperf.html">Website Performance Optimization</a>
50+
<p>Hey... this class looks familiar.</p>
51+
</li>
52+
53+
<li>
54+
<img src="https://lh5.ggpht.com/IKdCmTWn8a2nMhlwMYzryvzRN5CUZAOBr4tDrEAbszV7TIFe9pRAInA4kkYcgTXwrifJsBEsq1agTueuu-g=s100">
55+
<a href="project-mobile.html">Mobile Web Development</a>
56+
<p>Making mobile apps isn't so hard after all.</p>
57+
</li>
58+
59+
<li>
60+
<img style="width: 100px;" src="views/images/pizzeria.jpg">
61+
<a href="views/pizza.html">Cam's Pizzeria</a>
62+
<p>Who wants a performant pizza?</p>
63+
</li>
64+
</ul>
65+
</div>
66+
67+
<footer>
68+
<p>&copy; Web Performance 2014 <span id="crp-stats"></span></p>
69+
</footer>
70+
</body>
71+
</html>

js/perfmatters.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// Measuring the Critical Rendering Path with Navigation Timing
2+
// https://developers.google.com/web/fundamentals/performance/critical-rendering-path/measure-crp
3+
4+
function logCRP() {
5+
var t = window.performance.timing,
6+
dcl = t.domContentLoadedEventStart - t.domLoading,
7+
complete = t.domComplete - t.domLoading;
8+
var stats = document.getElementById("crp-stats");
9+
stats.textContent = 'DCL: ' + dcl + 'ms, onload: ' + complete + 'ms';
10+
}
11+
12+
window.addEventListener("load", function(event) {
13+
logCRP();
14+
});

0 commit comments

Comments
 (0)