From 12aef47d43e3804bf7a0b1ec6fba05e30ee38a04 Mon Sep 17 00:00:00 2001 From: Astro Date: Fri, 10 Dec 2010 17:26:23 +0100 Subject: [PATCH] nedap usability --- nedap/server.js | 14 ++++++++++---- nedap/static/style.css | 23 +++++++++++++++++++++++ 2 files changed, 33 insertions(+), 4 deletions(-) create mode 100644 nedap/static/style.css diff --git a/nedap/server.js b/nedap/server.js index 8adc886..3fd014f 100644 --- a/nedap/server.js +++ b/nedap/server.js @@ -10,7 +10,7 @@ var backend, question, answers, scores; function html(body) { return "\n" + "Pentanews Game Show\n" + - /* TODO: CSS */ + "" + "

Pentanews Game Show

\n" + body + ""; @@ -43,7 +43,7 @@ console.log({question:question,answers:answers}) res.end(); } else { res.writeHead(404, { 'Content-type': 'text/html' }); - res.write(html('o_0')); + res.write(html('

No question left on server.

')); res.end(); } }); @@ -56,8 +56,8 @@ console.log({question:question,answers:answers}) scores[i]++; backend.send(JSON.stringify({ scores: scores })); - res.writeHead(200, { 'Content-type': 'text/html' }); - res.write(html("

Thanks

")); + res.writeHead(303, { 'Content-type': 'text/html', + 'Location': '/thanks' }); res.end(); } else { res.writeHead(400, { 'Content-type': 'text/html' }); @@ -68,6 +68,12 @@ console.log({question:question,answers:answers}) res.end(); } }); + + app.get('/thanks', function(req, res) { + res.writeHead(200, { 'Content-type': 'text/html' }); + res.write(html("

Thanks, your vote may have been counted.

")); + res.end(); + }); } diff --git a/nedap/static/style.css b/nedap/static/style.css new file mode 100644 index 0000000..370c0a6 --- /dev/null +++ b/nedap/static/style.css @@ -0,0 +1,23 @@ +body { + margin: 0 auto; + width: 30em; + color: white; + background-color: #20203f; + text-align: center; + font-family: sans-serif; +} + +p, ul { + text-align: left; +} + +ul { + list-style-type: none; + background-color: #30304f; + padding: 0.5em; +} + +input[type=radio] { + padding: 0.2em; + margin: 0; +} \ No newline at end of file