Browse files

ah, back to express, jade, and stylus

  • Loading branch information...
1 parent 873446d commit 28c0bd8d766b625c0f87a945724cab84ea61dc59 Visnu Pitiyanuvath committed Mar 15, 2011
View
2 .gitignore
@@ -1,3 +1,3 @@
.DS_Store
-.sass-cache
tmp/*
+*.css
View
1 .npmignore
@@ -0,0 +1 @@
+tmp
View
18 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');
+});
View
25 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": {
+ }
+}
View
BIN public/fonts/04B_03__.TTF
Binary file not shown.
View
BIN 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.
View
120 public/index.html
@@ -1,120 +0,0 @@
-<!doctype html>
-<html>
- <head>
- <meta charset="utf-8">
- <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
- <title>Node.js Knockout</title>
- <style type="text/css">
- body {
- font-family: "helvetica neue", helvetica, arial, sans-serif;
- font-size: 18px;
- font-weight: 300;
- padding: 0px;
- margin: 0px;
- text-align: center;
- text-rendering: optimizeLegibility;
- }
-
- footer, header, menu, nav, section, time {
- display:block;
- }
-
- #logo {
- color: transparent;
- background: url('/images/logo.png') no-repeat scroll center center;
- font-size: xx-large;
- height: 232px;
- }
-
- #nko-start {
- font-family: 'Permanent Marker';
- font-size: 64px;
- }
-
- footer ul {
- padding: 0;
- }
- footer li {
- display: inline-block;
- margin-left: 0.25em;
- }
- </style>
- <script type="text/javascript">
- var _gaq = _gaq || [];
- _gaq.push(['_setAccount', 'UA-16773586-1']);
- _gaq.push(['_trackPageview']);
- (function() {
- var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
- ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
- var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
- })();
- </script>
- <link href='http://fonts.googleapis.com/css?family=Permanent+Marker' rel='stylesheet' type='text/css'>
- </head>
- <body>
- <header>
- <h1 id="logo">Node.js Knockout</h1>
- </header>
-
- <p id="about">
- Node.js Knockout is a 48-hour coding contest using
- <a href="http://nodejs.org">node.js</a>.
- </p>
-
- <p id="when">
- Node.js Knockout 2011 will be
- <time id="nko-start" datetime="2011-08-27T00:00:00Z">
- August 27-28, 2011
- </time>
- <span id="countdown"></span>
- </p>
-
- <p id="more">
- What do I do until then?
- <a href="http://2010.nodeknockout.com">See last year's winners</a>
- or
- <a href="http://twitter.com/node_knockout">follow us on Twitter</a>.
- </p>
-
- <footer>
- <ul>
- <li class="twitter"><a href="http://twitter.com/node_knockout">@node_knockout</a></li>
- <li class="email"><a href="mailto:all@nodeknockout.com">all@nodeknockout.com</a></li>
- <li class="blog"><a href="http://nodeknockout.posterous.com">blog</a></li>
- <li class="2010"><a href="http://2010.nodeknockout.com">2010</a></li>
- </ul>
- </footer>
-
- <!-- javascript -->
- <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script>
-
- <script type="text/javascript">
- $(function() {
- var parts, start;
- parts = $('#nko-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' : '');
- }
- });
- });
- </script>
-
- </body>
-</html>
View
27 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' : '');
+ }
+ });
+});
View
40 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
View
30 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
+
View
11 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.