Web Dev Solutions

Catalin Mititiuc

aboutsummaryrefslogtreecommitdiff
path: root/public
diff options
context:
space:
mode:
authorCatalin Mititiuc <webdevcat@proton.me>2024-04-27 18:28:59 -0700
committerCatalin Mititiuc <webdevcat@proton.me>2024-04-27 18:30:03 -0700
commit0c1f7e2fde7ed6e05271c8aeb8d4babbf4f2188d (patch)
treeb15c46880f7aa4e252df7928dbc5a2a2f5eef366 /public
parentce98e325656b8419b80d8c248e0469f3a9708322 (diff)
Add ability to change maps
Diffstat (limited to 'public')
-rw-r--r--public/index.html21
-rw-r--r--public/map.css5
-rw-r--r--public/map1.svg (renamed from public/map.svg)0
-rw-r--r--public/map2.svg84
4 files changed, 107 insertions, 3 deletions
diff --git a/public/index.html b/public/index.html
index ef12273..d8a91f9 100644
--- a/public/index.html
+++ b/public/index.html
@@ -104,7 +104,7 @@
Loading...
</div>
- <object type="image/svg+xml" data="map.svg"></object>
+ <object type="image/svg+xml" data="map1.svg"></object>
<div id="status">
<span id="hex-counter">Distance: <span id="hex-count">-</span></span>
@@ -134,6 +134,25 @@
<span class="inning-top">◓</span>
<span class="inning-bottom">◒</span>
</span>
+
+ <dialog id="map-dialog">
+ <form>
+ <p>
+ <label>
+ Map:
+ <select>
+ <option value="map1">Map1</option>
+ <option value="map2">Map2</option>
+ </select>
+ </label>
+ </p>
+ <div>
+ <button value="cancel" formmethod="dialog">Cancel</button>
+ <button id="confirm-btn" value="default">Confirm</button>
+ </div>
+ </form>
+ </dialog>
+ <button id="show-dialog">Change map</button>
</div>
<div id="record-sheet">
diff --git a/public/map.css b/public/map.css
index 932d224..dbabab9 100644
--- a/public/map.css
+++ b/public/map.css
@@ -203,11 +203,11 @@ g.selected use {
transform: translate(19px, 31px) scale(4);
}
-g.start-locations > g:first-child {
+g.start-locations > g:first-child:not([data-y]) {
--i: -2;
}
-g.start-locations > g:last-child {
+g.start-locations > g:last-child:not([data-y]) {
--i: 52;
}
@@ -249,6 +249,7 @@ g[data-y]:nth-child(odd) {
transform: translateX(calc(var(--x-step) * var(--i))) scale(var(--scale));
}
+g[data-y="-2"] { --i: -2; }
g[data-y="0"] { --i: 0; }
g[data-y="1"] { --i: 1; }
g[data-y="2"] { --i: 2; }
diff --git a/public/map.svg b/public/map1.svg
index d927ae4..d927ae4 100644
--- a/public/map.svg
+++ b/public/map1.svg
diff --git a/public/map2.svg b/public/map2.svg
new file mode 100644
index 0000000..1d0f8c4
--- /dev/null
+++ b/public/map2.svg
@@ -0,0 +1,84 @@
+<?xml version="1.0" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
+ "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg viewBox="-25 -150 400 570" xmlns="http://www.w3.org/2000/svg">
+ <link xmlns="http://www.w3.org/1999/xhtml" rel="stylesheet" href="map.css" type="text/css"/>
+ <defs>
+ <polygon id="hex" points="0,10 8.66,5 8.66,-5 0,-10 -8.66,-5 -8.66,5"/>
+
+ <circle id="counter-base" cx="0" cy="0" r="5"/>
+
+ <g id="t-1" class="troop-counter-template"><use href="#counter-base"/><text>1</text></g>
+ <g id="t-2" class="troop-counter-template"><use href="#counter-base"/><text>2</text></g>
+ <g id="t-3" class="troop-counter-template"><use href="#counter-base"/><text>3</text></g>
+ <g id="t-4" class="troop-counter-template"><use href="#counter-base"/><text>4</text></g>
+ <g id="t-5" class="troop-counter-template"><use href="#counter-base"/><text>5</text></g>
+ <g id="t-6" class="troop-counter-template"><use href="#counter-base"/><text>6</text></g>
+ <g id="t-7" class="troop-counter-template"><use href="#counter-base"/><text>7</text></g>
+
+ <image id="counter-prone" href="counter_prone.jpg" width="10"/>
+ <image id="counter-grenade" href="counter_grenade.jpg" width="10"/>
+ </defs>
+
+ <rect id="background" x="-18" y="-10" width="386" height="322"/>
+
+ <g class="board">
+ <g id="firing-arcs">
+ <g id="shapes"/>
+ <g id="lines"/>
+ </g>
+ <g class="start-locations">
+ <g data-y="-2">
+ <g data-x="4" class="counter" data-allegiance="liao" data-number="1"><use href="#t-1"/></g>
+ <g data-x="3" class="counter" data-allegiance="liao" data-number="2"><use href="#t-2"/></g>
+ <g data-x="2" class="counter" data-allegiance="liao" data-number="3"><use href="#t-3"/></g>
+ <g data-x="1" class="counter" data-allegiance="liao" data-number="4"><use href="#t-4"/></g>
+ <g data-x="0" class="counter" data-allegiance="liao" data-number="5"><use href="#t-5"/></g>
+ </g>
+ <g data-y="6">
+ <g data-x="0" class="counter" data-allegiance="davion" data-number="1"><use href="#t-1"/></g>
+ <g data-x="1" class="counter" data-allegiance="davion" data-number="2"><use href="#t-2"/></g>
+ <g data-x="2" class="counter" data-allegiance="davion" data-number="3"><use href="#t-3"/></g>
+ <g data-x="3" class="counter" data-allegiance="davion" data-number="4"><use href="#t-4"/></g>
+ <g data-x="4" class="counter" data-allegiance="davion" data-number="5"><use href="#t-5"/></g>
+ </g>
+ </g>
+ <g class="grid">
+ <g data-y="0">
+ <g data-x="0"><use href="#hex"/></g>
+ <g data-x="1"><use href="#hex"/></g>
+ <g data-x="2"><use href="#hex"/></g>
+ <g data-x="3"><use href="#hex"/></g>
+ <g data-x="4"><use href="#hex"/></g>
+ </g>
+ <g data-y="1">
+ <g data-x="0"><use href="#hex"/></g>
+ <g data-x="1"><use href="#hex"/></g>
+ <g data-x="2"><use href="#hex"/></g>
+ <g data-x="3"><use href="#hex"/></g>
+ <g data-x="4"><use href="#hex"/></g>
+ </g>
+ <g data-y="2">
+ <g data-x="0"><use href="#hex"/></g>
+ <g data-x="1"><use href="#hex"/></g>
+ <g data-x="2"><use href="#hex"/></g>
+ <g data-x="3"><use href="#hex"/></g>
+ <g data-x="4"><use href="#hex"/></g>
+ </g>
+ <g data-y="3">
+ <g data-x="0"><use href="#hex"/></g>
+ <g data-x="1"><use href="#hex"/></g>
+ <g data-x="2"><use href="#hex"/></g>
+ <g data-x="3"><use href="#hex"/></g>
+ <g data-x="4"><use href="#hex"/></g>
+ </g>
+ <g data-y="4">
+ <g data-x="0"><use href="#hex"/></g>
+ <g data-x="1"><use href="#hex"/></g>
+ <g data-x="2"><use href="#hex"/></g>
+ <g data-x="3"><use href="#hex"/></g>
+ <g data-x="4"><use href="#hex"/></g>
+ </g>
+ </g>
+ </g>
+</svg>