diff --git a/css/style.js b/css/style.js new file mode 100644 index 0000000..1359e64 --- /dev/null +++ b/css/style.js @@ -0,0 +1,82 @@ +module.exports = () => { + return ` +body { + font-family: sans-serif; +} + +#grid { + display: flex; + flex-wrap: wrap; + justify-content: center; +} + +.item { + margin: 20px; + flex: 1; + border: 1px solid #999; +} + +.name { + padding: 10px 20px; + font-size: 80px; + text-align: center; +} + +.cash { + padding: 20px 40px; + font-size: 100px; + text-align: center; +} + +.cash::before { + content: "$"; +} + +#topbar { + background-color: rgb(30, 62, 46); + color: #fff; + padding: 10px 20px; +} + +#topbar h1 { + display: inline; + margin-right: 2em; +} + +.GT { + color: black; + background-color: orange; +} + +.PRR { + color: white; + background-color: red; +} + +.B_O { + color: white; + background-color: blue; +} + +.ERIE { + color: black; + background-color: yellow; +} + +.IC { + color: white; + background-color: darkgreen; +} + +.C_O { + color: white; + background-color: lightblue; +} + +.NYC { + color: white; + background-color: black; +} + + `.trim() +} diff --git a/index.js b/index.js index c397491..52ff83c 100644 --- a/index.js +++ b/index.js @@ -2,6 +2,8 @@ const Koa = require("koa") const bodyParser = require("koa-bodyparser") const Router = require("koa-router") +const port = process.env.PORT || 3000 + const app = new Koa() app.use(bodyParser()) @@ -32,6 +34,6 @@ require("./routes/18sh")({ router }) app.use(router.routes()) app.use(router.allowedMethods()) -if (!module.parent) app.listen(3018) +if (!module.parent) app.listen(port) module.exports = app diff --git a/modules/gameFormat.js b/modules/gameFormat.js index 96c589e..341efd7 100644 --- a/modules/gameFormat.js +++ b/modules/gameFormat.js @@ -1,55 +1,36 @@ "use strict" module.exports = (title, data) => { - const css = ` - - `.trim() + const css = require("../css/style") const cashHoldings = Object.keys(data).map(key => { const cash = data[key] - return `