Skip to content

Commit

Permalink
ah, back to express, jade, and stylus
Browse files Browse the repository at this point in the history
  • Loading branch information
Visnu Pitiyanuvath committed Mar 15, 2011
1 parent 873446d commit 28c0bd8
Show file tree
Hide file tree
Showing 11 changed files with 153 additions and 121 deletions.
2 changes: 1 addition & 1 deletion .gitignore
@@ -1,3 +1,3 @@
.DS_Store .DS_Store
.sass-cache
tmp/* tmp/*
*.css
1 change: 1 addition & 0 deletions .npmignore
@@ -0,0 +1 @@
tmp
18 changes: 18 additions & 0 deletions app.js
@@ -0,0 +1,18 @@
var express = require('express')
, pub = __dirname + '/public';

var app = express.createServer();

app.use(require('stylus').middleware(pub));
app.use(express.static(pub));
app.use(express.logger());
app.use(express.errorHandler({ dumpExceptions: true, showStack: true }));

app.set('views', __dirname + '/views');
app.set('view engine', 'jade');

app.listen(process.env.PORT || 8000);

app.get('/', function(req, res) {
res.render('index');
});
25 changes: 25 additions & 0 deletions package.json
@@ -0,0 +1,25 @@
{
"name": "nko",
"description": "node.js knockout: 48-hour node.js hackathon",
"version": "0.0.1",
"homepage": "http://nodeknockout.com",
"repository": {
"type": "git",
"url": "git://github.com/nko/website.git"
},
"author": "NKO Team <all@nodeknockout.com>",
"main": "./app.js",
"directories": {
"lib": "."
},
"engines": {
"node": "*"
},
"dependencies": {
"express": ">=2.0.0rc",
"jade": ">=0.8.8",
"stylus": "0.8.0"
},
"devDependencies": {
}
}
Binary file added public/fonts/04B_03__.TTF
Binary file not shown.
Binary file added public/images/noise.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
120 changes: 0 additions & 120 deletions public/index.html

This file was deleted.

27 changes: 27 additions & 0 deletions public/javascripts/application.js
@@ -0,0 +1,27 @@
(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||{});

$(function() {
var parts, start;
parts = $('time.start').attr('datetime').split(/[-:TZ]/);
parts[1]--; // js dates :(
start = Date.UTC.apply(null, parts);

$('#countdown').each(function() {
var $this = $(this);
(function tick() {
$this.html(countdownify((start - (new Date)) / 1000));
return setTimeout(tick, 1000);
})();

function countdownify(secs) {
var names = ['day', 'hour', 'minute', 'second'];
return $.map([secs / 86400, secs % 86400 / 3600, secs % 3600 / 60, secs % 60], function(num, i) {
return [Math.floor(num), pluralize(names[i], num)];
}).join(' ');
}

function pluralize(str, count) {
return str + (parseInt(count) !== 1 ? 's' : '');
}
});
});
40 changes: 40 additions & 0 deletions public/stylesheets/application.styl
@@ -0,0 +1,40 @@
@font-face
font-family "04b_03"
src url(/fonts/04B_03__.TTF)

header, footer
display block

body
font-family "04b_03", monospace
text-align center
background hsl(200, 30%, 95%) url('/images/noise.png') repeat
text-shadow 0px 1px 0px hsla(0, 100%, 100%, 0.6)

a:link, a:visited
color hsl(200, 30%, 60%)

header
h1
font-size 72pt
word-spacing -0.5ex
.ko
background-color black
color white
text-shadow 0px 2px 0px hsla(0, 100%, 100%, 0.5)
padding 10px 10px 0 25px
border-radius 2px
border solid 1px hsla(0, 100%, 100%, 0.5)

h2
margin 2em
.dates
font-size 32pt
#countdown
margin 0.5em

footer
margin-top 5em
li
display inline-block
margin 0 1ex
30 changes: 30 additions & 0 deletions views/index.jade
@@ -0,0 +1,30 @@
header
h1
| node.js
span.ko ko

h3
| node.js knockout is a 48-hour coding contest using
a( href: 'http://nodejs.org' ) node.js

h2
| node.js knockout 2011 will be
.dates
time.start( datetime: '2011-08-27T00:00:00Z' ) August 27
| &mdash;
time.end( datetime: '2011-08-28T00:00:00Z' ) August 28, 2011
#countdown

.now-what
| What do I do until then?
a( href: '#' ) See last year's winners
| or
a( href: '#' ) follow us on Twitter

footer
ul
li: a( href: 'http://twitter.com/node_knockout' ) @node_knockout
li: a( href: 'mailto:all@nodeknockout.com' ) all@nodeknockout.com
li: a( href: 'http://blog.nodeknockout.com' ) blog
li: a( href: 'http://2010.nodeknockout.com' ) 2010 website

11 changes: 11 additions & 0 deletions views/layout.jade
@@ -0,0 +1,11 @@
!!! 5
html
head
meta( charset: 'utf-8' )
meta( http-equiv: 'X-UA-Compatible', content: 'IE=edge,chrome=1' )
title node.js knockout
link( rel: 'stylesheet', href: '/stylesheets/application.css' )
body
!= body
script( type: 'text/javascript', src: '//ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js' )
script( type: 'text/javascript', src: '/javascripts/application.js' )

0 comments on commit 28c0bd8

Please sign in to comment.