Web Dev Solutions

Catalin Mititiuc

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 +++++++ style.css | 7 +++++++ 2 files changed, 14 insertions(+) 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; -- cgit v1.2.3