index : btroops | |
Virtual board game-aid for BattleTroops, an infantry combat simulator wargame published by FASA in 1989. |
aboutsummaryrefslogtreecommitdiff |
diff options
author | Catalin Mititiuc <Catalin.Mititiuc@gmail.com> | 2024-04-11 12:46:26 -0700 |
---|---|---|
committer | Catalin Mititiuc <Catalin.Mititiuc@gmail.com> | 2024-04-11 13:15:41 -0700 |
commit | b192fc0790a4815703afa6ccc782f2b573c64722 (patch) | |
tree | dcc0f3b3aca30447a1ad71a45d1193aadc92f59d /README.md | |
parent | 35a82e94e85c5b4f068e6e4d3d807dfc3c05379d (diff) |
Import map svg in an object; add a dev server
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/README.md b/README.md new file mode 100644 index 0000000..aee7c62 --- /dev/null +++ b/README.md @@ -0,0 +1,22 @@ +## Install dev server packages + + docker run --rm -w /app -v $PWD:/app -u $(id -u):$(id -u) node bash -c "npm install" + +## Start the dev server + + docker run --rm --init -it -w /app -v $PWD:/app -p 8080:8080 node bash -c "node dev-server.js" + +Visit `localhost:8080` to view. + +## Rough way to save the SVG map generated by JavaScript client-side + + const XMLS = new XMLSerializer(); + const svg_xmls = XMLS.serializeToString(svg); + let bl = new Blob([svg_xmls], {type: "text/html" }); + let a = document.createElement("a"); + a.href = URL.createObjectURL(bl); + a.download = "map.svg"; + a.hidden = true; + document.body.appendChild(a); + a.innerHTML = "something random - nobody will see this, it doesn't matter what you put here"; + a.click() |