Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
preload project images, fade out between page transitions and early u…
…pdate of navigation selection
- Loading branch information
Caolan McMahon
committed
Feb 15, 2012
1 parent
ed1b12f
commit 240257f
Showing
5 changed files
with
160 additions
and
116 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,43 @@ | ||
var events = require('duality/events'), | ||
dutils = require('duality/utils'), | ||
utils = require('./utils'); | ||
|
||
|
||
function preload(url) { | ||
var img = new Image(); | ||
img.src = url; | ||
return img; | ||
} | ||
|
||
events.on('init', function () { | ||
// preload avatar for about page | ||
var avatar_image = new Image(); | ||
var md5 = 'c911321821c4d7bd1b9bbadf91aa6f2e'; | ||
avatar_image.src = "http://www.gravatar.com/avatar/" + md5 + "?size=92"; | ||
preload("http://www.gravatar.com/avatar/" + md5 + "?size=92"); | ||
|
||
// preload project images | ||
var baseURL = dutils.getBaseURL(); | ||
preload(baseURL + "/static/kan.so.png"); | ||
preload(baseURL + "/static/medicmobile.png"); | ||
preload(baseURL + "/static/northwest.png"); | ||
preload(baseURL + "/static/githubprofile.png"); | ||
}); | ||
|
||
events.on('afterResponse', function (info, req, res) { | ||
utils.highlightPage(); | ||
utils.disqus_num_replies(); | ||
}); | ||
|
||
events.on('beforeResource', function (info, req) { | ||
if (!req.initial_hit) { | ||
if (req.type === 'show' && req.name === 'about') { | ||
$('#navigation li').removeClass('selected'); | ||
$('#nav_about').addClass('selected'); | ||
} | ||
else { | ||
$('#navigation li').removeClass('selected'); | ||
$('#nav_blog').addClass('selected'); | ||
} | ||
//$('#main').css({visibility: 'hidden'}); | ||
$('#main').css({opacity: 0}); | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,108 +1,110 @@ | ||
{{{include "navigation.html"}}} | ||
|
||
<div id="about"> | ||
<!-- | ||
<h1>Ay-up</h1> | ||
<h1>Ow-do</h1> | ||
--> | ||
<div class="row"> | ||
<div class="span4"> | ||
<!-- Note: this image is pre-loaded in base.html template, changes to src should be made there too --> | ||
<img class="paper" id="avatar" alt="Me" src="http://www.gravatar.com/avatar/c911321821c4d7bd1b9bbadf91aa6f2e?size=160" /> | ||
<div id="main"> | ||
<div id="about"> | ||
<!-- | ||
<h1>Ay-up</h1> | ||
<h1>Ow-do</h1> | ||
--> | ||
<div class="row"> | ||
<div class="span4"> | ||
<!-- Note: this image is pre-loaded in base.html template, changes to src should be made there too --> | ||
<img class="paper" id="avatar" alt="Me" src="http://www.gravatar.com/avatar/c911321821c4d7bd1b9bbadf91aa6f2e?size=160" /> | ||
</div> | ||
<div class="span6 aboutme"> | ||
<h1>Hello!</h1> | ||
<p> | ||
I'm a British software developer based in | ||
<a href="http://maps.google.com/maps?q=Vancouver+BC&hnear=Vancouver,+Greater+Vancouver+Regional+District,+British+Columbia,+Canada&t=h&z=5">Vancouver, BC</a>. | ||
I specialise in decentralised systems using | ||
<a href="http://kan.so">CouchApps</a>. I also maintain a number | ||
of open-source projects including | ||
<a href="https://github.com/caolan/nodeunit">Nodeunit</a>, | ||
<a href="https://github.com/caolan/async">Async</a> and | ||
<a href="http://kan.so">Kanso</a>. | ||
</p> | ||
</div> | ||
</div> | ||
<div class="span6 aboutme"> | ||
<h1>Hello!</h1> | ||
<p> | ||
I'm a British software developer based in | ||
<a href="http://maps.google.com/maps?q=Vancouver+BC&hnear=Vancouver,+Greater+Vancouver+Regional+District,+British+Columbia,+Canada&t=h&z=5">Vancouver, BC</a>. | ||
I specialise in decentralised systems using | ||
<a href="http://kan.so">CouchApps</a>. I also maintain a number | ||
of open-source projects including | ||
<a href="https://github.com/caolan/nodeunit">Nodeunit</a>, | ||
<a href="https://github.com/caolan/async">Async</a> and | ||
<a href="http://kan.so">Kanso</a>. | ||
</p> | ||
<div class="row contact"> | ||
<div class="span10"> | ||
<p> | ||
You can get in touch with me via | ||
<a href="http://twitter.com/caolan">Twitter</a> or on | ||
<a href="https://github.com/caolan">GitHub</a>. | ||
You can also email me at firstname dot lastname at gmail dot com. | ||
</p> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="row contact"> | ||
<div class="span10"> | ||
<p> | ||
You can get in touch with me via | ||
<a href="http://twitter.com/caolan">Twitter</a> or on | ||
<a href="https://github.com/caolan">GitHub</a>. | ||
You can also email me at firstname dot lastname at gmail dot com. | ||
</p> | ||
</div> | ||
</div> | ||
<div class="row project"> | ||
<div class="span4"> | ||
<a href="http://kan.so"> | ||
<img class="paper" src="{{baseURL}}/static/kan.so.png" /> | ||
</a> | ||
<div class="row project"> | ||
<div class="span4"> | ||
<a href="http://kan.so"> | ||
<img class="paper" src="{{baseURL}}/static/kan.so.png" /> | ||
</a> | ||
</div> | ||
<div class="span6"> | ||
<h2><a href="http://kan.so">Kanso</a></h2> | ||
<p> | ||
I'm the creator of Kanso, a developer platform for writing CouchApps. | ||
It includes advanced build-tools and encourages people to share code and | ||
applications. For me, this is all about user sovereignty and data ownership. | ||
</p> | ||
</div> | ||
</div> | ||
<div class="span6"> | ||
<h2><a href="http://kan.so">Kanso</a></h2> | ||
<p> | ||
I'm the creator of Kanso, a developer platform for writing CouchApps. | ||
It includes advanced build-tools and encourages people to share code and | ||
applications. For me, this is all about user sovereignty and data ownership. | ||
</p> | ||
<div class="row project"> | ||
<div class="span4"> | ||
<a href="http://medicmobile.org"> | ||
<img class="paper" src="{{baseURL}}/static/medicmobile.png" /> | ||
</a> | ||
</div> | ||
<div class="span6"> | ||
<h2><a href="http://medicmobile.org">Medic Mobile</a></h2> | ||
<p> | ||
I also work with Medic Mobile, a nonprofit organisation using open-source | ||
to create connected, coordinated health systems in the developing world. | ||
Medic Mobile have found a natural fit with Kanso and helped nurture the | ||
project from an early stage. | ||
</p> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="row project"> | ||
<div class="span4"> | ||
<a href="http://medicmobile.org"> | ||
<img class="paper" src="{{baseURL}}/static/medicmobile.png" /> | ||
</a> | ||
</div> | ||
<div class="span6"> | ||
<h2><a href="http://medicmobile.org">Medic Mobile</a></h2> | ||
<p> | ||
I also work with Medic Mobile, a nonprofit organisation using open-source | ||
to create connected, coordinated health systems in the developing world. | ||
Medic Mobile have found a natural fit with Kanso and helped nurture the | ||
project from an early stage. | ||
</p> | ||
<div class="row project"> | ||
<div class="span4"> | ||
<a href="http://en.wikipedia.org/wiki/Northwest_Territories"> | ||
<img class="paper" src="{{baseURL}}/static/northwest.png" /> | ||
</a> | ||
</div> | ||
<div class="span6"> | ||
<h2><a href="http://en.wikipedia.org/wiki/Northwest_Territories">North-West Territories</a></h2> | ||
<p> | ||
Kanso has also found a natural home among remote communities in the North. | ||
Collaborating with First Nations and the Government we've worked on projects | ||
to overcome unreliable and slow connections in order to make the most of | ||
traditional knowledge. | ||
</p> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="row project"> | ||
<div class="span4"> | ||
<a href="http://en.wikipedia.org/wiki/Northwest_Territories"> | ||
<img class="paper" src="{{baseURL}}/static/northwest.png" /> | ||
</a> | ||
<div class="row project"> | ||
<div class="span4"> | ||
<a href="https://github.com/caolan"> | ||
<img class="paper" src="{{baseURL}}/static/githubprofile.png" /> | ||
</a> | ||
</div> | ||
<div class="span6"> | ||
<h2><a href="http://github.com/caolan">Node.js</a></h2> | ||
<p> | ||
Alongside my work on Kanso and projects wishing to implement decentralised | ||
systems, I also maintain a number of other open-source libraries including | ||
some well-known Node.js modules. Perhaps the most popular being | ||
<a href="https://github.com/caolan/async">Async</a> and | ||
<a href="https://github.com/caolan/nodeunit">Nodeunit</a>. | ||
</p> | ||
</div> | ||
</div> | ||
<div class="span6"> | ||
<h2><a href="http://en.wikipedia.org/wiki/Northwest_Territories">North-West Territories</a></h2> | ||
<p> | ||
Kanso has also found a natural home among remote communities in the North. | ||
Collaborating with First Nations and the Government we've worked on projects | ||
to overcome unreliable and slow connections in order to make the most of | ||
traditional knowledge. | ||
</p> | ||
</div> | ||
</div> | ||
<div class="row project"> | ||
<div class="span4"> | ||
<a href="https://github.com/caolan"> | ||
<img class="paper" src="{{baseURL}}/static/githubprofile.png" /> | ||
</a> | ||
</div> | ||
<div class="span6"> | ||
<h2><a href="http://github.com/caolan">Node.js</a></h2> | ||
<p> | ||
Alongside my work on Kanso and projects wishing to implement decentralised | ||
systems, I also maintain a number of other open-source libraries including | ||
some well-known Node.js modules. Perhaps the most popular being | ||
<a href="https://github.com/caolan/async">Async</a> and | ||
<a href="https://github.com/caolan/nodeunit">Nodeunit</a>. | ||
</p> | ||
</div> | ||
</div> | ||
<div class="row findoutmore"> | ||
<div class="span10"> | ||
<p> | ||
Find out more on <a href="https://github.com/caolan">GitHub</a> | ||
</p> | ||
<div class="row findoutmore"> | ||
<div class="span10"> | ||
<p> | ||
Find out more on <a href="https://github.com/caolan">GitHub</a> | ||
</p> | ||
</div> | ||
</div> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,23 @@ | ||
{{{include "navigation.html"}}} | ||
|
||
<h1>Caolan McMahon</h1> | ||
<div id="main"> | ||
<h1>Caolan McMahon</h1> | ||
|
||
<ul class="blogposts"> | ||
{{#each rows}} | ||
{{#with value}} | ||
<li class="{{#if published}}published{{else}}draft{{/if}}"> | ||
<h2><a href="{{baseURL}}/posts/{{slug}}">{{title}}</a></h2> | ||
<div class="meta"> | ||
{{#if published}}<span class="date">{{pp_date}}</span>{{else}}<span class="warning">Draft</span>{{/if}} | ||
<div class="extra"> | ||
<a href="{{baseURL}}/posts/{{slug}}#disqus_thread" class="comments">Comments and Reactions</a> | ||
<ul class="blogposts"> | ||
{{#each rows}} | ||
{{#with value}} | ||
<li class="{{#if published}}published{{else}}draft{{/if}}"> | ||
<h2><a href="{{baseURL}}/posts/{{slug}}">{{title}}</a></h2> | ||
<div class="meta"> | ||
{{#if published}}<span class="date">{{pp_date}}</span>{{else}}<span class="warning">Draft</span>{{/if}} | ||
<div class="extra"> | ||
<a href="{{baseURL}}/posts/{{slug}}#disqus_thread" class="comments">Comments and Reactions</a> | ||
</div> | ||
</div> | ||
</div> | ||
{{{intro_html}}} | ||
<p><a href="{{baseURL}}/posts/{{slug}}">Read more...</a></p> | ||
</li> | ||
{{/with}} | ||
{{/each}} | ||
</ul> | ||
{{{intro_html}}} | ||
<p><a href="{{baseURL}}/posts/{{slug}}">Read more...</a></p> | ||
</li> | ||
{{/with}} | ||
{{/each}} | ||
</ul> | ||
</div> |