diff options
author | Tor Andersson <tor@ccxvii.net> | 2023-12-08 12:50:33 +0100 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2024-01-08 16:36:47 +0100 |
commit | 2e0776498cd8b992c060bc578107d83e571fd45b (patch) | |
tree | 23b03a37d29c5e74a1a8306866cde42f1d861f6f /create.html | |
parent | 301bc138267a99d1135c5eec30cedbd316eed742 (diff) | |
download | table-battles-2e0776498cd8b992c060bc578107d83e571fd45b.tar.gz |
images
Diffstat (limited to 'create.html')
-rw-r--r-- | create.html | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/create.html b/create.html index 48c6db3..e1bb4f4 100644 --- a/create.html +++ b/create.html @@ -1,8 +1,27 @@ <link rel="stylesheet" href="/table-battles/cards.css"> <style> -.card { box-shadow: var(--drop-shadow) } +.card { box-shadow: var(--drop-shadow); background-size: 240px 336px; } +.card.exp0 { background-image: url(/table-battles/info/base-cover.jpg); } +.card.exp1 { background-image: url(/table-battles/info/wotr-cover.jpg); } +.card.exp2 { background-image: url(/table-battles/info/aoa-cover.jpg); } +.card.exp3 { background-image: url(/table-battles/info/getty-cover.jpg); } +.card.exp4 { background-image: url(/table-battles/info/ecw-cover.jpg); } +.card.exp5 { background-image: url(/table-battles/info/tga-cover.jpg); } +.card.exp6 { background-image: url(/table-battles/info/cal-cover.jpg); } </style> -<div id="preview"></div> +<div style="display:none"> +<div class="card exp0" data-scenario="Random"></div> +<div class="card exp0" data-scenario="Random - Table Battles"></div> +<div class="card exp1" data-scenario="Random - Wars of the Roses"></div> +<div class="card exp2" data-scenario="Random - Age of Alexander"></div> +<div class="card exp3" data-scenario="Random - Gettysburg"></div> +<div class="card exp4" data-scenario="Random - English Civil War"></div> +<div class="card exp5" data-scenario="Random - The Grand Alliance"></div> +<div class="card exp6" data-scenario="Random - Charles Alexander of Lorraine"></div> +</div> +<div id="preview"> +<div class="card exp0"></div> +</div> <script> var select = document.querySelector("select[name='scenario']") @@ -14,12 +33,15 @@ window.onload = async function () { .then(r => r.text()) .then(html => { list = (new DOMParser()).parseFromString(html, "text/html") + select.onchange() }) } select.onchange = function (evt) { if (list) { let node = list.getElementById("scenario_" + parseInt(select.value)) + if (!node) + node = document.querySelector(`[data-scenario='${select.value}']`) if (node) preview.replaceChildren(node.cloneNode(true)) else |