From adc67da606798fa0eaf7c155fe73cfa6d87f1463 Mon Sep 17 00:00:00 2001
From: Catalin Mititiuc
Date: Wed, 3 Apr 2024 14:11:12 -0700
Subject: Toggle allegiance firing arc visibility
---
index.js | 6 ++++++
1 file changed, 6 insertions(+)
(limited to 'index.js')
diff --git a/index.js b/index.js
index abd9794..38ca8c6 100644
--- a/index.js
+++ b/index.js
@@ -928,6 +928,12 @@ recordSheetVisibility.addEventListener('input', e => {
localStorage.setItem('recordsVisibility', recordSheetVisibility.checked);
});
+document.querySelectorAll('#toggle-firing-arc-vis input').forEach(el => el.addEventListener('input', e => {
+ let clipPaths = svg.querySelectorAll(`clipPath[data-troop-allegiance="${el.dataset.allegiance}"]`);
+
+ clipPaths.forEach(cp => cp.style.display = el.checked ? 'none' : '');
+}));
+
(function debug() {
function drawLine(x1, y1, x2, y2) {
let start = ptGrp.querySelector(`[data-x="${x1}"][data-y="${y1}"]`);
--
cgit v1.2.3