Skip to content

Commit 28c0bd8

Browse files
author
Visnu Pitiyanuvath
committed
ah, back to express, jade, and stylus
1 parent 873446d commit 28c0bd8

File tree

11 files changed

+153
-121
lines changed

11 files changed

+153
-121
lines changed

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
.DS_Store
2-
.sass-cache
32
tmp/*
3+
*.css

.npmignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
tmp

app.js

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
var express = require('express')
2+
, pub = __dirname + '/public';
3+
4+
var app = express.createServer();
5+
6+
app.use(require('stylus').middleware(pub));
7+
app.use(express.static(pub));
8+
app.use(express.logger());
9+
app.use(express.errorHandler({ dumpExceptions: true, showStack: true }));
10+
11+
app.set('views', __dirname + '/views');
12+
app.set('view engine', 'jade');
13+
14+
app.listen(process.env.PORT || 8000);
15+
16+
app.get('/', function(req, res) {
17+
res.render('index');
18+
});

package.json

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"name": "nko",
3+
"description": "node.js knockout: 48-hour node.js hackathon",
4+
"version": "0.0.1",
5+
"homepage": "http://nodeknockout.com",
6+
"repository": {
7+
"type": "git",
8+
"url": "git://github.com/nko/website.git"
9+
},
10+
"author": "NKO Team <[email protected]>",
11+
"main": "./app.js",
12+
"directories": {
13+
"lib": "."
14+
},
15+
"engines": {
16+
"node": "*"
17+
},
18+
"dependencies": {
19+
"express": ">=2.0.0rc",
20+
"jade": ">=0.8.8",
21+
"stylus": "0.8.0"
22+
},
23+
"devDependencies": {
24+
}
25+
}

public/fonts/04B_03__.TTF

19 KB
Binary file not shown.

public/images/noise.png

11.8 KB
Loading

public/index.html

-120
This file was deleted.

public/javascripts/application.js

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
(function(b){function c(){}for(var d="assert,count,debug,dir,dirxml,error,exception,group,groupCollapsed,groupEnd,info, log,markTimeline,profile,profileEnd,time,timeEnd,trace,warn".split(","),a;a=d.pop();)b[a]=b[a]||c})(window.console=window.console||{});
2+
3+
$(function() {
4+
var parts, start;
5+
parts = $('time.start').attr('datetime').split(/[-:TZ]/);
6+
parts[1]--; // js dates :(
7+
start = Date.UTC.apply(null, parts);
8+
9+
$('#countdown').each(function() {
10+
var $this = $(this);
11+
(function tick() {
12+
$this.html(countdownify((start - (new Date)) / 1000));
13+
return setTimeout(tick, 1000);
14+
})();
15+
16+
function countdownify(secs) {
17+
var names = ['day', 'hour', 'minute', 'second'];
18+
return $.map([secs / 86400, secs % 86400 / 3600, secs % 3600 / 60, secs % 60], function(num, i) {
19+
return [Math.floor(num), pluralize(names[i], num)];
20+
}).join(' ');
21+
}
22+
23+
function pluralize(str, count) {
24+
return str + (parseInt(count) !== 1 ? 's' : '');
25+
}
26+
});
27+
});

public/stylesheets/application.styl

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
@font-face
2+
font-family "04b_03"
3+
src url(/fonts/04B_03__.TTF)
4+
5+
header, footer
6+
display block
7+
8+
body
9+
font-family "04b_03", monospace
10+
text-align center
11+
background hsl(200, 30%, 95%) url('/images/noise.png') repeat
12+
text-shadow 0px 1px 0px hsla(0, 100%, 100%, 0.6)
13+
14+
a:link, a:visited
15+
color hsl(200, 30%, 60%)
16+
17+
header
18+
h1
19+
font-size 72pt
20+
word-spacing -0.5ex
21+
.ko
22+
background-color black
23+
color white
24+
text-shadow 0px 2px 0px hsla(0, 100%, 100%, 0.5)
25+
padding 10px 10px 0 25px
26+
border-radius 2px
27+
border solid 1px hsla(0, 100%, 100%, 0.5)
28+
29+
h2
30+
margin 2em
31+
.dates
32+
font-size 32pt
33+
#countdown
34+
margin 0.5em
35+
36+
footer
37+
margin-top 5em
38+
li
39+
display inline-block
40+
margin 0 1ex

views/index.jade

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
header
2+
h1
3+
| node.js
4+
span.ko ko
5+
6+
h3
7+
| node.js knockout is a 48-hour coding contest using
8+
a( href: 'http://nodejs.org' ) node.js
9+
10+
h2
11+
| node.js knockout 2011 will be
12+
.dates
13+
time.start( datetime: '2011-08-27T00:00:00Z' ) August 27
14+
| &mdash;
15+
time.end( datetime: '2011-08-28T00:00:00Z' ) August 28, 2011
16+
#countdown
17+
18+
.now-what
19+
| What do I do until then?
20+
a( href: '#' ) See last year's winners
21+
| or
22+
a( href: '#' ) follow us on Twitter
23+
24+
footer
25+
ul
26+
li: a( href: 'http://twitter.com/node_knockout' ) @node_knockout
27+
li: a( href: 'mailto:[email protected]' ) [email protected]
28+
li: a( href: 'http://blog.nodeknockout.com' ) blog
29+
li: a( href: 'http://2010.nodeknockout.com' ) 2010 website
30+

views/layout.jade

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
!!! 5
2+
html
3+
head
4+
meta( charset: 'utf-8' )
5+
meta( http-equiv: 'X-UA-Compatible', content: 'IE=edge,chrome=1' )
6+
title node.js knockout
7+
link( rel: 'stylesheet', href: '/stylesheets/application.css' )
8+
body
9+
!= body
10+
script( type: 'text/javascript', src: '//ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js' )
11+
script( type: 'text/javascript', src: '/javascripts/application.js' )

0 commit comments

Comments
 (0)