Add styling to sight line target hex

This commit is contained in:
Catalin Mititiuc 2024-04-06 11:45:21 -07:00
parent ba1e9009a3
commit ac9b456314
2 changed files with 14 additions and 0 deletions

View File

@ -653,11 +653,16 @@ const RecordSheet = new function() {
const SightLine = new function() { const SightLine = new function() {
this.clear = function() { this.clear = function() {
let sl = grid.querySelector('line.sight-line'); let sl = grid.querySelector('line.sight-line');
let target = grid.querySelector(`use[href="#point"].sight-line-target`);
if (sl) { if (sl) {
sl.remove(); sl.remove();
} }
if (target) {
target.classList.remove('sight-line-target');
}
this.clearHexes(); this.clearHexes();
}; };
@ -808,6 +813,8 @@ POINTS.forEach((row, index) => row.forEach(([x, y]) => {
if (sl.classList.contains('active')) { if (sl.classList.contains('active')) {
SightLine.clear(); SightLine.clear();
} else {
group.querySelector(`use[href="#point"]`).classList.add('sight-line-target');
} }
group.dispatchEvent(new MouseEvent('pointerover')); group.dispatchEvent(new MouseEvent('pointerover'));

View File

@ -148,6 +148,13 @@ use[href="#point"].active {
opacity: 0.2; opacity: 0.2;
} }
use[href="#point"].sight-line-target {
opacity: 1;
stroke: orangered;
/* stroke-width: 1px; */
fill-opacity: 0.04;
}
polyline.move-trace { polyline.move-trace {
stroke: gray; stroke: gray;
stroke-dasharray: 2; stroke-dasharray: 2;