Web Dev Solutions

Catalin Mititiuc

From fd7bccda92563da8ed055d773e173b760880e524 Mon Sep 17 00:00:00 2001 From: Catalin Mititiuc Date: Mon, 25 Mar 2024 11:09:28 -0700 Subject: Add 'Clear Firing Arcs' buttons --- index.html | 12 ++++++++++-- index.js | 10 +++++++++- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/index.html b/index.html index 3f3ed56..db842b4 100644 --- a/index.html +++ b/index.html @@ -146,7 +146,11 @@

- Davion
+ Davion + +

@@ -175,7 +179,11 @@

- Liao
+ Liao + +

diff --git a/index.js b/index.js index 15764a1..dfff1a3 100644 --- a/index.js +++ b/index.js @@ -354,4 +354,12 @@ document.querySelectorAll('.set-firing-arc').forEach(el => el.addEventListener(' document.querySelector('circle#point').style.display = 'none'; } } -})); \ No newline at end of file +})); + +document.querySelectorAll('.clear-firing-arcs').forEach(el => + el.addEventListener('click', ({target: {dataset: {allegiance}}}) => + document + .querySelectorAll(`.firing-arc[data-troop-allegiance="${allegiance}"]`) + .forEach(el => el.remove()) + ) +); \ No newline at end of file -- cgit v1.2.3