Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

episode_09: added express and dummy html

  • Loading branch information...
commit 9435da520a725baa92cbaa9d03a5f9d5ea838747 1 parent 79455b9
@magnars authored
View
1  .gitignore
@@ -0,0 +1 @@
+node_modules
View
5 README.md
@@ -7,3 +7,8 @@ Nettspill (testdrevet)
-----------------------
- frontend: javascript
- backend: javascript (node.js)
+
+
+Utviklermiljø
+-------------
+Kjør `npm install` i root for å dra ned avhengigheter.
View
38 app.js
@@ -0,0 +1,38 @@
+
+/**
+ * Module dependencies.
+ */
+
+var express = require('express');
+
+var app = module.exports = express.createServer();
+
+// Configuration
+
+app.configure(function(){
+ app.set('views', __dirname + '/views');
+ app.set('view engine', 'jade');
+ app.use(express.bodyParser());
+ app.use(express.methodOverride());
+ app.use(app.router);
+ app.use(express.static(__dirname + '/public'));
+});
+
+app.configure('development', function(){
+ app.use(express.errorHandler({ dumpExceptions: true, showStack: true }));
+});
+
+app.configure('production', function(){
+ app.use(express.errorHandler());
+});
+
+// Routes
+
+app.get('/', function(req, res){
+ res.render('index', {
+ title: 'Express'
+ });
+});
+
+app.listen(3000);
+console.log("Express server listening on port %d in %s mode", app.address().port, app.settings.env);
View
9 package.json
@@ -0,0 +1,9 @@
+{
+ "name": "application-name"
+ , "version": "0.0.1"
+ , "private": true
+ , "dependencies": {
+ "express": "2.4.6"
+ , "jade": ">= 0.0.1"
+ }
+}
View
109 public/stylesheets/reset.css
@@ -0,0 +1,109 @@
+/*
+Copyright (c) 2009, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 3.0.0
+build: 1549
+*/
+html{
+ color:#000;
+ background:#FFF;
+}
+body,
+div,
+dl,
+dt,
+dd,
+ul,
+ol,
+li,
+h1,
+h2,
+h3,
+h4,
+h5,
+h6,
+pre,
+code,
+form,
+fieldset,
+legend,
+input,
+textarea,
+p,
+blockquote,
+th,
+td {
+ margin:0;
+ padding:0;
+}
+table {
+ border-collapse:collapse;
+ border-spacing:0;
+}
+fieldset,
+img {
+ border:0;
+}
+address,
+caption,
+cite,
+code,
+dfn,
+em,
+strong,
+th,
+var {
+ font-style:normal;
+ font-weight:normal;
+}
+li {
+ list-style:none;
+}
+
+caption,
+th {
+ text-align:left;
+}
+h1,
+h2,
+h3,
+h4,
+h5,
+h6 {
+ font-size:100%;
+ font-weight:normal;
+}
+q:before,
+q:after {
+ content:'';
+}
+abbr,
+acronym {
+ border:0;
+ font-variant:normal;
+}
+/* to preserve line-height and selector appearance */
+sup {
+ vertical-align:text-top;
+}
+sub {
+ vertical-align:text-bottom;
+}
+input,
+textarea,
+select {
+ font-family:inherit;
+ font-size:inherit;
+ font-weight:inherit;
+}
+/*to enable resizing for IE*/
+input,
+textarea,
+select {
+ *font-size:100%;
+}
+/*because legend doesn't inherit in IE */
+legend {
+ color:#000;
+}
View
26 public/stylesheets/style.css
@@ -0,0 +1,26 @@
+body { padding: 50px; font: 14px "Lucida Grande", Helvetica, Arial, sans-serif; min-width: 550px;}
+
+h1,h2,h3,h4,h5,h6,strong {font-weight: bold;}
+
+h1 {font-size: 30px;}
+h2 {font-size: 24px;}
+h3 {font-size: 16px;}
+
+h1,h2,h3,h4,h5,h6,ul,ol,p,blockquote,.block {margin: 10px;}
+
+.sidebar {float: left; min-width: 250px; width: 35%;}
+.game {overflow: hidden; padding-left: 25px;}
+
+.outside,
+.barricade,
+.room {padding: 10px; text-align: center; margin: 5px; overflow: hidden;}
+
+.room {border: 1px solid #ccc; background: #eee;}
+.outside {border: 1px dashed #ccc; color: #f00;}
+.bed {background: #ddf; border: 1px solid #bbe;}
+.barricade {padding-top: 0; padding-bottom: 0; background: #000; border: 1px solid #000; color: #fff;}
+
+.blueprints {margin-top: 20px; font-size: 12px;}
+.blueprint {background: #eee; border-bottom: 1px solid #ccc; margin-bottom: 5px; overflow: hidden;}
+.cost {float: right;}
+.blueprints h4 {margin-bottom: 2px; font-size: 14px;}
View
38 views/index.jade
@@ -0,0 +1,38 @@
+.sidebar
+ h1= title
+ p 100 resources left.
+ p Still alive: You and 4 guards.
+ .blueprints
+ h3 Your blueprints:
+ ul
+ li.blueprint
+ p.cost 5 resources
+ h4 Traphole
+ p A hole in the ground covered with some rotten planks.
+ .block
+ button Build Traphole
+ li.blueprint
+ p.cost 10 resources
+ h4 Hiding spot
+ p One hidden guard can make a surprise attack from here.
+ .block
+ button Build Hiding spot
+ li.blueprint
+ p.cost 20 resources
+ h4 Guardpost
+ p Two guards stationed here can fire a few round on intruders before falling back.
+ .block
+ button Build Guardpost
+
+.game
+ ul.rooms
+ li.outside
+ p Outside (30 zombies)
+ li.barricade
+ p Barricade (43% integrity)
+ li.room
+ p Trapdoor
+ li.room
+ p Hiding spot (1 guard)
+ li.bed.room
+ p Some beds (3 guards)
View
7 views/layout.jade
@@ -0,0 +1,7 @@
+!!!
+html
+ head
+ title= title
+ link(rel='stylesheet', href='/stylesheets/reset.css')
+ link(rel='stylesheet', href='/stylesheets/style.css')
+ body!= body
Please sign in to comment.
Something went wrong with that request. Please try again.