Web Dev Solutions

Catalin Mititiuc

aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--index.js7
-rw-r--r--style.css7
2 files changed, 14 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'));
diff --git a/style.css b/style.css
index 7af36b9..4d288b9 100644
--- a/style.css
+++ b/style.css
@@ -148,6 +148,13 @@ use[href="#point"].active {
opacity: 0.2;
}
+use[href="#point"].sight-line-target {
+ opacity: 1;
+ stroke: orangered;
+ /* stroke-width: 1px; */
+ fill-opacity: 0.04;
+}
+
polyline.move-trace {
stroke: gray;
stroke-dasharray: 2;