Add back a common css file, use lower contrast color/background-color

This commit is contained in:
Adam Goldsmith 2017-10-09 12:48:04 -04:00
parent 3f2d480635
commit e4be49acaa
3 changed files with 7 additions and 4 deletions

View File

@ -2,6 +2,7 @@
<head> <head>
<script src="/js/editor.js"></script> <script src="/js/editor.js"></script>
<link rel="stylesheet" type="text/css" href="/css/editor.css"> <link rel="stylesheet" type="text/css" href="/css/editor.css">
<link rel="stylesheet" type="text/css" href="/css/common.css">
<title>Editor</title> <title>Editor</title>
</head> </head>
<body> <body>

View File

@ -3,6 +3,7 @@
<script src="/js/interact.js"></script> <script src="/js/interact.js"></script>
<script src="/js/playfield.js"></script> <script src="/js/playfield.js"></script>
<link rel="stylesheet" type="text/css" href="/css/playfield.css"> <link rel="stylesheet" type="text/css" href="/css/playfield.css">
<link rel="stylesheet" type="text/css" href="/css/common.css">
<title>Playfield</title> <title>Playfield</title>
</head> </head>
<body> <body>

View File

@ -24,6 +24,7 @@ const server = http.createServer((req, res) => {
switch (pathParts[2]) { switch (pathParts[2]) {
case 'playfield.css': case 'playfield.css':
case 'editor.css': case 'editor.css':
case 'common.css':
sendFile(res, 'css/' + pathParts[2], 'text/css'); sendFile(res, 'css/' + pathParts[2], 'text/css');
break; break;
default: default:
@ -70,10 +71,6 @@ const server = http.createServer((req, res) => {
break; break;
} }
let deckName = decodeURI(pathParts[2]); let deckName = decodeURI(pathParts[2]);
if (!decks.includes(deckName)) {
send404(res, uri);
break;
}
switch (pathParts[3] || '') { switch (pathParts[3] || '') {
case '': case '':
sendDeckIndex(res, deckName); sendDeckIndex(res, deckName);
@ -112,9 +109,11 @@ function sendIndex(res) {
const html = ` const html = `
<html> <html>
<head> <head>
<link rel="stylesheet" type="text/css" href="/css/common.css">
<title>Index</title> <title>Index</title>
</head> </head>
<body> <body>
<label>Create New Deck: <input type="text" onchange="window.location='/deck/' + event.target.value + '/editor'"></label>
<ul> <ul>
${(decks.map(d => `<li><a href="/deck/${d}">${d}</a></li>`).join(' '))} ${(decks.map(d => `<li><a href="/deck/${d}">${d}</a></li>`).join(' '))}
</ul> </ul>
@ -128,6 +127,7 @@ function sendDeckIndex(res, deckName) {
const html = ` const html = `
<html> <html>
<head> <head>
<link rel="stylesheet" type="text/css" href="/css/common.css">
<title>${deckName}</title> <title>${deckName}</title>
</head> </head>
<body> <body>
@ -219,6 +219,7 @@ function send404(res, uri) {
const html = ` const html = `
<head> <head>
<title>404 Not Found</title> <title>404 Not Found</title>
<link rel="stylesheet" href="/css/common.css">
</head> </head>
<body> <body>
<h1>Error 404: Path ${uri.pathname} not found</h1> <h1>Error 404: Path ${uri.pathname} not found</h1>