Web Dev Solutions

Catalin Mititiuc

aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCatalin Mititiuc <webdevcat@proton.me>2024-06-27 12:48:06 -0700
committerCatalin Mititiuc <webdevcat@proton.me>2024-06-27 12:48:06 -0700
commitc148f4a4f329decec4602a48a8a71a62b429bfb4 (patch)
tree5dc552f1bfe34a4369999753b9217d88a10c61e2 /src/index.js
parent9c0645b481224bcc777cac58eb2c7ea1592e58e1 (diff)
WIP: render radial coord hexes/maps
Diffstat (limited to 'src/index.js')
-rw-r--r--src/index.js12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/index.js b/src/index.js
index 6b7e930..6e98028 100644
--- a/src/index.js
+++ b/src/index.js
@@ -18,7 +18,8 @@ const mapPlaceholder = document.querySelector('.map-placeholder'),
distanceOutput = document.getElementById('status'),
proneToggle = document.getElementById('toggle-prone-counter'),
contentVisToggleEl = document.querySelector('#content input[type="checkbox"].visible'),
- fileName = localStorage.getItem('map') || 'scenario-side_show',
+ // fileName = localStorage.getItem('map') || 'scenario-side_show',
+ fileName = localStorage.getItem('map') || 'radial',
map = scenarios[fileName]?.hashed || `assets/images/${fileName}.svg`,
fileInputEl = document.querySelector('input[type="file"]'),
dice = document.querySelectorAll('.die'),
@@ -64,6 +65,7 @@ async function buildScenario(req) {
panzoom.start(svg);
gameboard.start(svg);
+
recordSheet.start(svg.querySelector('.start-locations'), gameboard.getUnits());
}
@@ -206,6 +208,14 @@ document.querySelector('#roll-dice').addEventListener('click', () => {
});
});
+// document.querySelectorAll('[name="select-elevation"]').forEach(el => {
+// const gameboard = document.querySelector('.gameboard');
+
+// el.addEventListener('change', function (e) {
+// gameboard.dataset.viewElevation = this.value
+// });
+// });
+
contentVisToggleEl.addEventListener('input', toggleContentVis);
contentVisToggleEl.checked = (localStorage.getItem('content-visibility') !== 'false');
toggleContentVis();