Web Dev Solutions

Catalin Mititiuc

aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCatalin Mititiuc <webdevcat@proton.me>2024-04-27 11:47:25 -0700
committerCatalin Mititiuc <webdevcat@proton.me>2024-04-27 11:55:25 -0700
commit25a79c4be5b50546147d61184e60bc63292a074c (patch)
treeb4f6d2a5be51f5def80d9b941df7a83ab9ddbc15 /src/index.js
parentbbd58ed2a0691987d21b20c3ab7d301727d46d1e (diff)
Remove 'reveal pattern' from game, as it's not necessary
Diffstat (limited to 'src/index.js')
-rw-r--r--src/index.js19
1 files changed, 9 insertions, 10 deletions
diff --git a/src/index.js b/src/index.js
index bc4f138..b16e00b 100644
--- a/src/index.js
+++ b/src/index.js
@@ -1,5 +1,5 @@
-import PanZoom from './modules/panzoom.js';
-import Game from './modules/game.js';
+import * as panzoom from './modules/panzoom.js';
+import * as game from './modules/game.js';
const RecordSheet = {
unSelect: function () {
@@ -40,19 +40,18 @@ document.querySelector('object').addEventListener('load', function () {
});
window.addEventListener('load', () => {
- const svg = document.querySelector('object').contentDocument.querySelector('svg'),
- game = Game(svg);
+ const svg = document.querySelector('object').contentDocument.querySelector('svg');
- window.game = game;
+ game.start(svg);
+ panzoom.start(svg);
const svgns = "http://www.w3.org/2000/svg",
recordSheetVisibility = document.querySelector('#content input[type="checkbox"].visible');
- PanZoom(svg);
const distanceOutput = document.getElementById('status');
- game.distanceCallback = count => {
+ game.setDistanceCallback(count => {
const output = {
count: '-',
display: 'none'
@@ -65,12 +64,12 @@ window.addEventListener('load', () => {
distanceOutput.querySelector('#hex-count').textContent = output.count;
distanceOutput.style.display = output.display;
- };
+ });
const proneToggle = document.getElementById('toggle-prone-counter');
- game.proneFlagCallback = checked => proneToggle.checked = checked;
- game.selectCallback = data => RecordSheet.select(data);
+ game.setProneFlagCallback(checked => proneToggle.checked = checked);
+ game.setSelectCallback(data => RecordSheet.select(data));
// Object.values(settingsPanel.querySelectorAll('fieldset')).forEach(fieldset => {
// const identityMtx = [1, 0, 0, 1, 0, 0];