Toggle allegiance firing arc visibility
This commit is contained in:
parent
17e6a7812f
commit
2da40de2fc
@ -141,6 +141,12 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="map-container">
|
<div id="map-container">
|
||||||
|
<div id="toggle-firing-arc-vis">
|
||||||
|
<div>davion</div>
|
||||||
|
<input type="checkbox" data-allegiance="davion" />
|
||||||
|
<div>liao</div>
|
||||||
|
<input type="checkbox" data-allegiance="liao" />
|
||||||
|
</div>
|
||||||
<svg viewbox="-49 -40 2390 3163" xmlns="http://www.w3.org/2000/svg">
|
<svg viewbox="-49 -40 2390 3163" xmlns="http://www.w3.org/2000/svg">
|
||||||
<defs>
|
<defs>
|
||||||
<polygon id="point" points="0,10 8.66,5 8.66,-5 0,-10 -8.66,-5 -8.66,5" />
|
<polygon id="point" points="0,10 8.66,5 8.66,-5 0,-10 -8.66,-5 -8.66,5" />
|
||||||
|
6
index.js
6
index.js
@ -928,6 +928,12 @@ recordSheetVisibility.addEventListener('input', e => {
|
|||||||
localStorage.setItem('recordsVisibility', recordSheetVisibility.checked);
|
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 debug() {
|
||||||
function drawLine(x1, y1, x2, y2) {
|
function drawLine(x1, y1, x2, y2) {
|
||||||
let start = ptGrp.querySelector(`[data-x="${x1}"][data-y="${y1}"]`);
|
let start = ptGrp.querySelector(`[data-x="${x1}"][data-y="${y1}"]`);
|
||||||
|
12
style.css
12
style.css
@ -194,6 +194,18 @@ image.map-scans {
|
|||||||
text-align: right;
|
text-align: right;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#toggle-firing-arc-vis {
|
||||||
|
position: absolute;
|
||||||
|
right: 0;
|
||||||
|
padding-top: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#toggle-firing-arc-vis div {
|
||||||
|
margin-top: 10px;
|
||||||
|
writing-mode: vertical-lr;
|
||||||
|
transform: rotate(180deg);
|
||||||
|
}
|
||||||
|
|
||||||
/* circle.counter {
|
/* circle.counter {
|
||||||
stroke: transparent;
|
stroke: transparent;
|
||||||
stroke-width: 0.5in;
|
stroke-width: 0.5in;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user