From ac9b4563141af33e30f4470500499ea927b87868 Mon Sep 17 00:00:00 2001
From: Catalin Mititiuc
Date: Sat, 6 Apr 2024 11:45:21 -0700
Subject: Add styling to sight line target hex
---
index.js | 7 +++++++
1 file changed, 7 insertions(+)
(limited to 'index.js')
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'));
--
cgit v1.2.3