diff --git a/.gitignore b/.gitignore index ce5026d..a323d03 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,5 @@ node_modules eventmapper_config.json data files -assets/styles/.old \ No newline at end of file +assets/styles/.old +.vercel diff --git a/assets/scripts/KaplayMap/gameobj.js b/assets/scripts/KaplayMap/gameobj.js index e6038f7..0898773 100644 --- a/assets/scripts/KaplayMap/gameobj.js +++ b/assets/scripts/KaplayMap/gameobj.js @@ -1,6 +1,7 @@ export class GameObjManager { map; opts = { + textColor: "FFFFFF", bgColor: "303030", bgFocusColor: "505030", bgHoverColor: "505050", @@ -40,7 +41,7 @@ export class GameObjManager { this.floorObject = this.map.kp.make([ this.map.kp.polygon(polygon.pts), - this.map.kp.color(this.map.kp.Color.fromHex("303030")), + this.map.kp.color(this.map.kp.Color.fromHex(this.opts.bgColor)), this.map.kp.opacity(this.opts.floorOpacity), this.map.kp.pos(), this.map.kp.z(5), @@ -67,7 +68,7 @@ export class GameObjManager { text: currentFloor.name, size: 24 * camScale, pos: this.map.kp.vec2(-4 * camScale, -8 * camScale), - color: this.map.kp.WHITE, + color: this.map.kp.Color.fromHex(this.opts.textColor), anchor: "botleft", }); }); @@ -207,7 +208,7 @@ export class GameObjManager { text: room.shortName + "…", size: this.opts.fontSize * camScale, pos: polygon.bbox().center(), - color: this.map.kp.WHITE, + color: this.map.kp.Color.fromHex(this.opts.textColor), align: "center", anchor: "center", }); @@ -217,7 +218,7 @@ export class GameObjManager { width: polygon.bbox().width, size: this.opts.fontSize * camScale, pos: polygon.bbox().center(), - color: this.map.kp.WHITE, + color: this.map.kp.Color.fromHex(this.opts.textColor), align: "center", anchor: "center", }); diff --git a/assets/scripts/script.js b/assets/scripts/script.js index f1d712c..fbde433 100644 --- a/assets/scripts/script.js +++ b/assets/scripts/script.js @@ -15,11 +15,13 @@ const kp = kaplay({ global: false, maxFPS: 120, texFilter: "nearest", - background: "404040", + background: window.backgroundBranding ?? "404040", }); const kaplaymap = new KaplayMap(kp, {}); -const eventmappermanager = new EventMapperManager(kaplaymap, mapUi); +const eventmappermanager = new EventMapperManager(kaplaymap, mapUi, { + gameobj: window.gameObjBranding, +}); async function main() { const grid = kp.loadSprite(null, "/files/images/grid.png"); diff --git a/assets/styles/elements.css b/assets/styles/elements.css index ff940b2..b95e272 100644 --- a/assets/styles/elements.css +++ b/assets/styles/elements.css @@ -27,8 +27,7 @@ hr { button { background-color: transparent; - border: none; - color: white; + color: currentColor; font: inherit; padding: 4px; border-radius: 4px; @@ -42,13 +41,17 @@ button:active { background-color: #0004; } +button:disabled { + background-color: #80808040; +} + + button.selected { border: 1px solid #fff; } input { background-color: #0004; - border: none; color: white; font: inherit; box-sizing: border-box; diff --git a/pages/index.html b/pages/index.html index 1064e64..99e2f3c 100644 --- a/pages/index.html +++ b/pages/index.html @@ -101,7 +101,7 @@ - + diff --git a/scripts/server.js b/scripts/index.js similarity index 100% rename from scripts/server.js rename to scripts/index.js diff --git a/vercel.json b/vercel.json new file mode 100644 index 0000000..2e827e3 --- /dev/null +++ b/vercel.json @@ -0,0 +1 @@ +{ "version": 2, "rewrites": [{ "source": "/(.*)", "destination": "/scripts" }] }