Web Dev Solutions

Catalin Mititiuc

aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCatalin Mititiuc <webdevcat@proton.me>2024-07-03 09:41:56 -0700
committerCatalin Mititiuc <webdevcat@proton.me>2024-07-03 09:41:56 -0700
commit99d60421e31c00c8051398aaf10a481dbccfd82b (patch)
treed42d3d9e6b4258391f04fd6b90a37fdcff906f0c
parentcff0cc6dd6e244da9c35f620585598a4e396652b (diff)
Move tree copse terrain feature from grid into buildings group
-rw-r--r--public/assets/css/radial.css4
-rw-r--r--src/radial.js6
2 files changed, 9 insertions, 1 deletions
diff --git a/public/assets/css/radial.css b/public/assets/css/radial.css
index b9ad688..d9636de 100644
--- a/public/assets/css/radial.css
+++ b/public/assets/css/radial.css
@@ -80,6 +80,10 @@ use[href="#hex"] {
display: inline;
}
+[data-view-elevation="-1"] .terrain {
+ display: none;
+}
+
[data-view-elevation="0"] .building .elevation-0 {
display: inline;
}
diff --git a/src/radial.js b/src/radial.js
index c6e52a6..038d9c1 100644
--- a/src/radial.js
+++ b/src/radial.js
@@ -511,6 +511,9 @@ function drawMapsheet(gameboard, mapsheet, position) {
drawHexes(gridContainer, grid, true);
(mapsheet.features || []).forEach(feature => {
+ const featureContainer = document.createElementNS(xmlns, 'g');
+ featureContainer.classList.add('terrain');
+
const origin = feature.position({ q: 0, r: 0, s: 0 });
const use = document.createElementNS(xmlns, 'use');
@@ -524,7 +527,8 @@ function drawMapsheet(gameboard, mapsheet, position) {
use.setAttributeNS(null, 'x', x);
use.setAttributeNS(null, 'y', y);
- gridContainer.appendChild(use);
+ featureContainer.appendChild(use)
+ buildingContainer.appendChild(featureContainer);
});
container.appendChild(gridContainer);