diff --git a/.gitignore b/.gitignore index 2500a909..66ae7f44 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,3 @@ .DS_Store -.sass-cache tmp/* +*.css diff --git a/.npmignore b/.npmignore new file mode 100644 index 00000000..a9a5aecf --- /dev/null +++ b/.npmignore @@ -0,0 +1 @@ +tmp diff --git a/app.js b/app.js new file mode 100644 index 00000000..97e8fe0e --- /dev/null +++ b/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'); +}); diff --git a/package.json b/package.json new file mode 100644 index 00000000..b6965f40 --- /dev/null +++ b/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 ", + "main": "./app.js", + "directories": { + "lib": "." + }, + "engines": { + "node": "*" + }, + "dependencies": { + "express": ">=2.0.0rc", + "jade": ">=0.8.8", + "stylus": "0.8.0" + }, + "devDependencies": { + } +} diff --git a/public/fonts/04B_03__.TTF b/public/fonts/04B_03__.TTF new file mode 100644 index 00000000..fe4328b6 Binary files /dev/null and b/public/fonts/04B_03__.TTF differ diff --git a/public/images/noise.png b/public/images/noise.png new file mode 100644 index 00000000..d898a661 Binary files /dev/null and b/public/images/noise.png differ diff --git a/public/index.html b/public/index.html deleted file mode 100644 index 77d322e1..00000000 --- a/public/index.html +++ /dev/null @@ -1,120 +0,0 @@ - - - - - - Node.js Knockout - - - - - -
-

Node.js Knockout

-
- -

- Node.js Knockout is a 48-hour coding contest using - node.js. -

- -

- Node.js Knockout 2011 will be - - -

- -

- What do I do until then? - See last year's winners - or - follow us on Twitter. -

- - - - - - - - - - diff --git a/public/javascripts/application.js b/public/javascripts/application.js new file mode 100644 index 00000000..9ff4fd3d --- /dev/null +++ b/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' : ''); + } + }); +}); diff --git a/public/stylesheets/application.styl b/public/stylesheets/application.styl new file mode 100644 index 00000000..475f2145 --- /dev/null +++ b/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 diff --git a/views/index.jade b/views/index.jade new file mode 100644 index 00000000..38b837b2 --- /dev/null +++ b/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 + | — + 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 + diff --git a/views/layout.jade b/views/layout.jade new file mode 100644 index 00000000..f5267afe --- /dev/null +++ b/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' )