nedap usability
This commit is contained in:
parent
942dd0dfd9
commit
12aef47d43
|
@ -10,7 +10,7 @@ var backend, question, answers, scores;
|
||||||
function html(body) {
|
function html(body) {
|
||||||
return "<!DOCTYPE html>\n" +
|
return "<!DOCTYPE html>\n" +
|
||||||
"<html><head><title>Pentanews Game Show</title></head>\n" +
|
"<html><head><title>Pentanews Game Show</title></head>\n" +
|
||||||
/* TODO: CSS */
|
"<link href='style.css' rel='stylesheet' type='text/css'>" +
|
||||||
"<body><h1>Pentanews Game Show</h1>\n" +
|
"<body><h1>Pentanews Game Show</h1>\n" +
|
||||||
body +
|
body +
|
||||||
"</body></html>";
|
"</body></html>";
|
||||||
|
@ -43,7 +43,7 @@ console.log({question:question,answers:answers})
|
||||||
res.end();
|
res.end();
|
||||||
} else {
|
} else {
|
||||||
res.writeHead(404, { 'Content-type': 'text/html' });
|
res.writeHead(404, { 'Content-type': 'text/html' });
|
||||||
res.write(html('o_0'));
|
res.write(html('<p>No question left on server.</p>'));
|
||||||
res.end();
|
res.end();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -56,17 +56,23 @@ console.log({question:question,answers:answers})
|
||||||
scores[i]++;
|
scores[i]++;
|
||||||
backend.send(JSON.stringify({ scores: scores }));
|
backend.send(JSON.stringify({ scores: scores }));
|
||||||
|
|
||||||
|
res.writeHead(303, { 'Content-type': 'text/html',
|
||||||
|
'Location': '/thanks' });
|
||||||
|
res.end();
|
||||||
|
} else {
|
||||||
|
res.writeHead(400, { 'Content-type': 'text/html' });
|
||||||
|
res.end();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
res.writeHead(400, { 'Content-type': 'text/html' });
|
||||||
|
res.end();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
app.get('/thanks', function(req, res) {
|
||||||
res.writeHead(200, { 'Content-type': 'text/html' });
|
res.writeHead(200, { 'Content-type': 'text/html' });
|
||||||
res.write(html("<p>Thanks</p>"));
|
res.write(html("<p>Thanks, your vote may have been counted.</p>"));
|
||||||
res.end();
|
res.end();
|
||||||
} else {
|
|
||||||
res.writeHead(400, { 'Content-type': 'text/html' });
|
|
||||||
res.end();
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
res.writeHead(400, { 'Content-type': 'text/html' });
|
|
||||||
res.end();
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
23
nedap/static/style.css
Normal file
23
nedap/static/style.css
Normal file
|
@ -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;
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user