summaryrefslogtreecommitdiff
path: root/create.html
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2023-12-07 15:27:32 +0100
committerTor Andersson <tor@ccxvii.net>2024-01-08 16:36:47 +0100
commit897c0c2fcd534159b78381036076c48d2db43465 (patch)
tree0714012c49679c650cf72a3bba0e6d6122c1cc98 /create.html
parentdc6e8cd3fe0106c6233685e6d637c8b17cd635ea (diff)
downloadtable-battles-897c0c2fcd534159b78381036076c48d2db43465.tar.gz
Links and rechts.
Diffstat (limited to 'create.html')
-rw-r--r--create.html30
1 files changed, 30 insertions, 0 deletions
diff --git a/create.html b/create.html
index e69de29..48c6db3 100644
--- a/create.html
+++ b/create.html
@@ -0,0 +1,30 @@
+<link rel="stylesheet" href="/table-battles/cards.css">
+<style>
+.card { box-shadow: var(--drop-shadow) }
+</style>
+<div id="preview"></div>
+<script>
+
+var select = document.querySelector("select[name='scenario']")
+var preview = document.getElementById("preview")
+var list = null
+
+window.onload = async function () {
+ fetch("/table-battles/info/scenarios.html")
+ .then(r => r.text())
+ .then(html => {
+ list = (new DOMParser()).parseFromString(html, "text/html")
+ })
+}
+
+select.onchange = function (evt) {
+ if (list) {
+ let node = list.getElementById("scenario_" + parseInt(select.value))
+ if (node)
+ preview.replaceChildren(node.cloneNode(true))
+ else
+ preview.replaceChildren()
+ }
+}
+
+</script>