Web Dev Solutions

Catalin Mititiuc

aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCatalin Mititiuc <webdevcat@proton.me>2024-06-24 09:25:22 -0700
committerCatalin Mititiuc <webdevcat@proton.me>2024-06-24 09:25:22 -0700
commit08a1cc452dc7c3e8dbb9b15b67992087df6663fa (patch)
treed4e38679f06cbffe872c41b2843034bbf30f1cda
parentdd8e7f04aaea205d2a3809d0ca1e26eb0a511c5e (diff)
Add some more buildings
-rw-r--r--public/radial.html228
-rw-r--r--src/radial.js66
2 files changed, 205 insertions, 89 deletions
diff --git a/public/radial.html b/public/radial.html
index 4d08f43..16907fb 100644
--- a/public/radial.html
+++ b/public/radial.html
@@ -278,40 +278,12 @@
</pattern>
<g id="building1" class="building">
- <rect id="building1-floor" class="floor" x="-33.25" y="-62.25" width="66.5" height="124.5"/>
- <path id="building1-outer-wall" class="outer-wall" d="
- M -33.25 -62.25 V 62.25 H 33.25 V -62.25 Z
- M -6.75 -37.75 V 6.25 H 2.25 V 62.25
- M -33.25 16.25 H -7.75 V 62.25
- M 2.25 39.25 H 33.25
- M 13.75 6.25 V -1.25 H 33.25
- "/>
- <path id="building1-inner-wall" class="inner-wall" d="
- M -33.25 -62.25 V 62.25 H 33.25 V -62.25 Z
- M -6.75 -37.75 V 6.25 H 2.25 V 62.25
- M -33.25 16.25 H -7.75 V 62.25
- M 2.25 39.25 H 33.25
- M 13.75 6.25 V -1.25 H 33.25
- "/>
- <path id="building1-windows" class="windows" d="
- M -33.25 -45.74 V -33.25
- M -33.25 40.75 V 53.75
- M 11.75 62.25 H 31.25
- "/>
- <path id="building1-door-edges" class="door-edges" d="
- M -33.25 -16.25 V -13.75 M -33.25 -5.75 V -3.25
- M -7.75 26.25 V 29.25 M -7.75 36.25 V 39.25
- M 2.25 13.75 V 16.25 M 2.25 24.25 V 26.75
- M 2.25 40.25 V 42.75 M 2.25 50.75 V 53.25
- M -3.25 -62.25 H -0.75 M 11.25 -62.25 H 13.25
- "/>
- <path id="building1-doors" class="doors" d="
- M -33.25 -13.75 V -5.75
- M -7.75 29.25 V 36.25
- M 2.25 16.25 V 24.25
- M 2.25 42.75 V 50.75
- M -0.75 -62.25 H 11.25
- "/>
+ <path id="building1-floor" class="floor"
+ d="M -38.969999,-67.499999 H 38.969999 V 67.499999 h -77.939998 z" />
+ <path id="building1-outer-wall" class="outer-wall"
+ d="m 38.969998,-7.500001 h -12.99 v 12.5 m -21.6499995,32.5 H 38.969998 m -34.6399995,30 v -60 h -8.66 v -45 m -8.6600005,105 v -45 h -25.979997 m 0,-89.999998 H 38.969999 V 67.499999 h -77.939998 z" />
+ <path id="building1-inner-wall" class="inner-wall"
+ d="m 38.969998,-7.500001 h -12.99 v 12.5 m -21.6499995,32.5 H 38.969998 m -34.6399995,30 v -60 h -8.66 v -45 m -8.6600005,105 v -45 h -25.979997 m 0,-89.999998 H 38.969999 V 67.499999 h -77.939998 z" />
</g>
<g id="building2" class="building">
@@ -325,6 +297,150 @@
d="m 3.698745,-67.5 h 9.55648 m 7.76351,30 h 9.55648 M -4.9612546,67.5 H 4.595225 m -18.71725,-60 h 9.5564804 m -35.0357204,0 h 9.55648 m 33.74353,-75 h 9.55648 m -35.53648,30 h 9.55648 m 7.7635204,105 H 4.595225 m -18.71725,-60 h 9.5564804 m -35.0357204,0 h 9.55648" />
</g>
+ <g id="building3" class="building">
+ <rect id="building3-floor" class="floor" x="-32.25" y="-44" width="64.5" height="88" />
+ <path id="building3-outer-wall" class="outer-wall" d="
+ M -32.25 -44 h 64.5 v 88 h -64 z
+ m 37.5 0 v 18
+ m -37.5 0 h 64.5
+ m -36.5 0 v 10.5
+ m 0 21 V 44
+ m 24.5 -34.5 h 12
+ " />
+ <path id="building3-inner-wall" class="inner-wall" d="
+ M -32.25 -44 h 64.5 v 88 h -64 z
+ m 37.5 0 v 18
+ m -37.5 0 h 64.5
+ m -36.5 0 v 10.5
+ m 0 21 V 44
+ m 24.5 -34.5 h 12
+ " />
+ <path id="building3-windows" class="windows" d="
+ M -13.75 -44 h 10.5
+ M 32.25 -10 v 10
+ M 23 44 h -10.5
+ M -32.25 29 v -10.5
+ m 0 -21 v -10
+ " />
+ <path id="building3-door-edges" class="door-edges" d="
+ M 12 -44 h 10.5
+ m -45 18 h 10.5
+ m 24.5 0 h 10.5
+ M -22 44 h 10.5
+ " />
+ <path id="building3-doors" class="doors" d="
+ M 15 -44 h 5
+ m -40 18 h 5.5
+ m 29 0 h 5.5
+ M -19.5 44 h 5.5
+ " />
+ </g>
+
+ <g id="building4" class="building">
+ <rect id="building4-floor" class="floor" x="-35.25" y="-62.25" width="70.5" height="124.5"/>
+ <path id="building4-outer-wall" class="outer-wall" d="
+ M -35.25 -62.25 h 70.5 v 124.5 h -70.5 z
+ m 35.5 0 v 50 h -35.5
+ m 35.5 -14 h 35
+ m -17 0 v 30
+ m 17 0 h -34.5 v 58
+ m 34.5 -22.25 h -34
+ m -16 1.5 h -20
+ "/>
+ <path id="building4-inner-wall" class="inner-wall" d="
+ M -35.25 -62.25 h 70.5 v 124.5 h -70.5 z
+ m 35.5 0 v 50 h -35.5
+ m 35.5 -14 h 35
+ m -17 0 v 30
+ m 17 0 h -34.5 v 58
+ m 34.5 -22.25 h -34
+ m -16 1.5 h -20
+ "/>
+ <path id="building4-windows" class="windows" d="
+ M 35.25 -44 v 10.5
+ m 0 51 v 10
+ m -14.5 34.75 h -15.5
+ m -40.5 -50 v -10
+ m 0 -18 v -10
+ "/>
+ <path id="building4-door-edges" class="door-edges" d="
+ M -27 -62.25 h 10
+ m 20 36 h 10
+ m -31 14 h 10
+ m 26.25 -1.5 v 10
+ m -15.25 7.5 h 10
+ m -12.25 40 v 10
+ m -31 8.5 h 16
+ "/>
+ <path id="building4-doors" class="doors" d="
+ M -24.5 -62.25 h 5
+ m 25 36 h 5
+ m -26 14 h 5
+ m 28.75 1 v 5
+ m -13 10 h 5.5
+ m -10 42.25 v 5.5
+ m -28.5 10.75 h 11
+ "/>
+ </g>
+
+ <g id="building5" class="building">
+ <rect id="building5-floor" class="floor" x="-75" y="-32.75" width="150" height="65.5"/>
+ <path id="building5-outer-wall" class="outer-wall" d="
+ M -75 -32.75 h 150 v 65.5 h -150 z
+ m 0 13 h 8 m 13 0 h 7
+ m 0 -13 v 26.5
+ m 43 -26.5 v 26.5
+ m 38 -26.5 v 26.5
+ m 23.5 -26.5 v 65.5
+ m -132.5 -39 h 7 m 14 0 h 111
+ m 15 1.5 h 3
+ m -105.25 -1.5 v 7.5
+ m 0 17.5 v 13.5
+ m 36.5 0 v -13.5
+ m 4.5 -19 v -6
+ "/>
+ <path id="building5-inner-wall" class="inner-wall" d="
+ M -75 -32.75 h 150 v 65.5 h -150 z
+ m 0 13 h 8 m 13 0 h 7
+ m 0 -13 v 26.5
+ m 43 -26.5 v 26.5
+ m 38 -26.5 v 26.5
+ m 23.5 -26.5 v 65.5
+ m -132.5 -39 h 7 m 14 0 h 111
+ m 15 1.5 h 3
+ m -105.25 -1.5 v 7.5
+ m 0 17.5 v 13.5
+ m 36.5 0 v -13.5
+ m 4.5 -19 v -6
+ "/>
+ <path id="building5-windows" class="windows" d="
+ M -21 -32.75 h 10
+ m 33 0 h 10
+ m 6.5 0 h 10
+ m 9 51 v 10
+ m -31 4.5 h -16
+ m -19.5 0 h -16
+ M -75 2 v 10
+ m 0 7 v 10
+ "/>
+ <path id="building5-door-edges" class="door-edges" d="
+ M -75 -17.75 v 9.5
+ m 150 -22 v 10
+ m -17.5 21 v 10
+ m -2 -17 h -9
+ m -38 0 h -10
+ m -10.5 0 h -10
+ "/>
+ <path id="building5-doors" class="doors" d="
+ M -75 -15.75 v 5.5
+ m 150 -18 v 6
+ m -17.5 25 v 6
+ m -4 -15 h -5
+ m -43 0 h -4.5
+ m -15.5 0 h -5
+ "/>
+ </g>
+
<g id="building6" class="building">
<rect id="building6-floor" class="floor" x="-23" y="-58.75" width="46" height="117.5" />
<path id="building6-outer-wall" class="outer-wall" d="
@@ -360,43 +476,13 @@
" />
</g>
- <g id="building3" class="building">
- <rect id="building3-floor" class="floor" x="-32.25" y="-44" width="64.5" height="88"/>
- <path id="building3-outer-wall" class="outer-wall" d="
- M -32.25 -44 h 64.5 v 88 h -64 z
- m 37.5 0 v 18
- m -37.5 0 h 64.5
- m -36.5 0 v 10.5
- m 0 21 V 44
- m 24.5 -34.5 h 12
- "/>
- <path id="building3-inner-wall" class="inner-wall" d="
- M -32.25 -44 h 64.5 v 88 h -64 z
- m 37.5 0 v 18
- m -37.5 0 h 64.5
- m -36.5 0 v 10.5
- m 0 21 V 44
- m 24.5 -34.5 h 12
- "/>
- <path id="building3-windows" class="windows" d="
- M -13.75 -44 h 10.5
- M 32.25 -10 v 10
- M 23 44 h -10.5
- M -32.25 29 v -10.5
- m 0 -21 v -10
- "/>
- <path id="building3-door-edges" class="door-edges" d="
- M 12 -44 h 10.5
- m -45 18 h 10.5
- m 24.5 0 h 10.5
- M -22 44 h 10.5
- "/>
- <path id="building3-doors" class="doors" d="
- M 15 -44 h 5
- m -40 18 h 5.5
- m 29 0 h 5.5
- M -19.5 44 h 5.5
- "/>
+ <g id="building7" class="building">
+ <path id="building7-floor" class="floor"
+ d="m -116.91,-52.5 v 105 h 25.98 l 8.66,-15 h 77.94 l 8.66038,15.00022 h 103.92 v -120 h -155.88 L -73.61,-52.5 Z" />
+ <path id="building7-outer-wall" class="outer-wall"
+ d="M -86.6,20 V 7.5 h 21.65 v 15 h 4.33 M -77.94,25 V 37.5 M 38.970381,52.50022 v -30 M -43.3,37.5 v -15 h -17.32 v 15 m 38.97,0 v -15 h 17.32 m 43.300001,-60 v -30 M 4.33038,-37.49978 v -30 m -43.30076,44.99956 H 4.33038 v -14.99956 h 69.280001 m 34.639999,60 H -4.33038 V 37.5 m 77.940761,15.00022 v -120 M -108.25,-7.5 h -8.66 m 77.93962,-59.99978 v 60 H -82.26962 M -116.91,-52.5 v 105 h 25.98 l 8.66,-15 h 77.94 l 8.66038,15.00022 h 103.92 v -120 h -155.88 L -73.61,-52.5 Z" />
+ <path id="building7-inner-wall" class="inner-wall"
+ d="M -86.6,20 V 7.5 h 21.65 v 15 h 4.33 M -77.94,25 V 37.5 M 38.970381,52.50022 v -30 M -43.3,37.5 v -15 h -17.32 v 15 m 38.97,0 v -15 h 17.32 m 43.300001,-60 v -30 M 4.33038,-37.49978 v -30 m -43.30076,44.99956 H 4.33038 v -14.99956 h 69.280001 m 34.639999,60 H -4.33038 V 37.5 m 77.940761,15.00022 v -120 M -108.25,-7.5 h -8.66 m 77.93962,-59.99978 v 60 H -82.26962 M -116.91,-52.5 v 105 h 25.98 l 8.66,-15 h 77.94 l 8.66038,15.00022 h 103.92 v -120 h -155.88 L -73.61,-52.5 Z" />
</g>
</defs>
diff --git a/src/radial.js b/src/radial.js
index 9349bd1..5a8ae5a 100644
--- a/src/radial.js
+++ b/src/radial.js
@@ -349,25 +349,40 @@ let mapsheet20 = {
grid: new Map(mapsheetHexCoords),
buildings: [
{
+ type: 'building1',
+ grid: new Map(buildingHexes.bld1),
+ position: ({ q, r, s }) => ({ q: q, r: r + 7, s: s - 7 })
+ },
+ {
type: 'building2',
grid: new Map(buildingHexes.bld2),
position: ({ q, r, s }) => ({ q: q + 7, r: r + 7, s: s - 14 })
},
{
+ type: 'building3',
+ grid: new Map(buildingHexes.bld3),
+ position: ({ q, r, s }) => ({ q: q - 14, r: r + 5, s: s + 9 })
+ },
+ {
+ type: 'building4',
+ grid: new Map(buildingHexes.bld4),
+ position: ({ q, r, s }) => ({ q: q - 8, r: r + 6, s: s + 2 })
+ },
+ {
+ type: 'building5',
+ grid: new Map(buildingHexes.bld5),
+ position: ({ q, r, s }) => ({ q: q + 13, r: r - 6, s: s - 7 })
+ },
+ {
type: 'building6',
grid: new Map(buildingHexes.bld6),
position: ({ q, r, s }) => ({ q: q + 7, r: r - 6, s: s - 1 })
},
{
- type: 'building1',
- grid: new Map(buildingHexes.bld1),
- position: ({ q, r, s }) => ({ q: q, r: r + 7, s: s - 7 })
+ type: 'building7',
+ grid: new Map(buildingHexes.bld7),
+ position: ({ q, r, s }) => ({ q: q - 6, r: r - 5, s: s + 11 }),
},
- {
- type: 'building3',
- grid: new Map(buildingHexes.bld3),
- position: ({ q, r, s }) => ({ q: q - 14, r: r + 5, s: s + 9 })
- }
]
};
@@ -376,25 +391,40 @@ let mapsheet30 = {
grid: new Map(mapsheetHexCoords),
buildings: [
{
+ type: 'building1',
+ grid: new Map(buildingHexes.bld1),
+ position: ({ q, r, s }) => ({ q: q - 2, r: r - 5, s: s + 7 })
+ },
+ {
type: 'building2',
grid: new Map(buildingHexes.bld2),
position: reflectR({ q: 9, r: -6, s: -3 })
},
{
+ type: 'building3',
+ grid: new Map(buildingHexes.bld3),
+ position: reflectR({ q: 17, r: -7, s: -10 })
+ },
+ {
+ type: 'building4',
+ grid: new Map(buildingHexes.bld4),
+ position: ({ q, r, s }) => ({ q: q - 9, r: r - 6, s: s + 15 })
+ },
+ {
+ type: 'building5',
+ grid: new Map(buildingHexes.bld5),
+ position: ({ q, r, s }) => ({ q: q + 6, r: r + 8, s: s - 14 })
+ },
+ {
type: 'building6',
grid: new Map(buildingHexes.bld6),
position: reflectR({ q: 1, r: 6, s: -7 })
},
{
- type: 'building1',
- grid: new Map(buildingHexes.bld1),
- position: ({ q, r, s }) => ({ q: q - 2, r: r - 5, s: s + 7 })
+ type: 'building7',
+ grid: new Map(buildingHexes.bld7),
+ position: ({ q, r, s }) => ({ q: q - 12, r: r + 8, s: s + 4 })
},
- {
- type: 'building3',
- grid: new Map(buildingHexes.bld3),
- position: reflectR({ q: 17, r: -7, s: -10 })
- }
]
};
@@ -404,7 +434,7 @@ function reflectR(coords) {
q: -s + coords.q,
r: -r + coords.r,
s: -q + coords.s,
- transform: "scale(-1)"
+ transform: "scale(1 -1)"
};
};
}
@@ -540,7 +570,7 @@ function findScalar(arr) {
// const sheets = [[mapsheet10]];
-// drawHexes(gameboard, buildingHexes.bld2, true);
+// drawHexes(gameboard, buildingHexes.bld7, true);
// drawHexes(addGroup(gameboard, 'part-1'), bld8, true);