summaryrefslogtreecommitdiff
path: root/create.html
diff options
context:
space:
mode:
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>