Web Dev Solutions

Catalin Mititiuc

aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCatalin Mititiuc <Catalin.Mititiuc@gmail.com>2024-04-06 11:45:21 -0700
committerCatalin Mititiuc <Catalin.Mititiuc@gmail.com>2024-04-06 11:45:21 -0700
commitac9b4563141af33e30f4470500499ea927b87868 (patch)
tree9d146706e87097b6921b3c0a98514c60308c5cd2 /index.js
parentba1e9009a3586dc75456e117ab1d7946d518dd5d (diff)
Add styling to sight line target hex
Diffstat (limited to 'index.js')
-rw-r--r--index.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/index.js b/index.js
index 07cff21..e9914cf 100644
--- a/index.js
+++ b/index.js
@@ -653,11 +653,16 @@ const RecordSheet = new function() {
const SightLine = new function() {
this.clear = function() {
let sl = grid.querySelector('line.sight-line');
+ let target = grid.querySelector(`use[href="#point"].sight-line-target`);
if (sl) {
sl.remove();
}
+ if (target) {
+ target.classList.remove('sight-line-target');
+ }
+
this.clearHexes();
};
@@ -808,6 +813,8 @@ POINTS.forEach((row, index) => row.forEach(([x, y]) => {
if (sl.classList.contains('active')) {
SightLine.clear();
+ } else {
+ group.querySelector(`use[href="#point"]`).classList.add('sight-line-target');
}
group.dispatchEvent(new MouseEvent('pointerover'));