Import pan/zoom functions from external module

This commit is contained in:
2025-06-16 22:41:28 -07:00
parent a0c2640bb7
commit fdf4b93856
6 changed files with 2177 additions and 726 deletions

View File

@@ -10,27 +10,25 @@ text {
user-select: none;
}
use[href="#point"], use[href="#hex"] {
use[href="#hex"] {
opacity: 1;
fill: teal;
fill-opacity: 0.2;
stroke-width: 0.5px;
}
use[href="#point"]:hover,
use[href="#point"].hover,
use[href="#hex"]:hover,
use[href="#hex"].hover {
use[href="#hex"]:hover, use[href="#hex"].hover
{
opacity: 1;
fill: orange;
stroke: orangered;
}
use[href="#point"].active, use[href="#hex"].active {
use[href="#hex"].active {
opacity: 0.2;
}
use[href="#point"].sight-line-target, use[href="#hex"].sight-line-target {
use[href="#hex"].sight-line-target {
opacity: 1;
stroke: orangered;
fill-opacity: 0.04;
@@ -46,10 +44,6 @@ polyline.move-trace {
fill: #bacae3;
}
g#grid {
transform: translate(19px, 31px) scale(4);
}
#map2 {
transform-origin: 0px 0px;
transform: translate(-0.9px, -2.4px) scale(0.999, 1.007);
@@ -163,7 +157,7 @@ polygon.firing-arc[data-troop-allegiance="liao"] {
pointer-events: none;
}
defs #point, #hex {
#hex {
fill: inherit;
fill-opacity: inherit;
stroke: inherit;
@@ -180,19 +174,7 @@ use[href="#davion-1"]:hover {
transform: scale(2);
}
g.col:hover {
--scale: 0.97;
}
g.col:hover use[href="#hex"] {
fill: orange;
stroke: orangered;
}
g.col:hover use[href="#davion-1"] {
transform: scale(1.5);
}
/* Inradius and circumradius values come from the hexagon */
.grid {
--inradius: 8.66px;
--circumradius: 10px;
@@ -201,26 +183,115 @@ g.col:hover use[href="#davion-1"] {
transform: translate(19px, 31px) scale(4);
}
g.row {
g[data-y] {
--translateX: 0;
transform: translate(var(--translateX), calc(var(--y-step) * (var(--n) - 1)));
transform: translate(var(--translateX), calc(var(--y-step) * var(--i)));
}
g.row:nth-child(odd) {
g[data-y]:nth-child(odd) {
--translateX: calc(var(--inradius));
}
g.row:nth-child(1) { --n: 1; }
g.row:nth-child(2) { --n: 2; }
g.row:nth-child(3) { --n: 3; }
g.row:nth-child(4) { --n: 4; }
g.col {
--scale: 1;
transform: translateX(calc(var(--x-step) * (var(--n) - 1))) scale(var(--scale));
g[data-x]:hover {
--scale: 0.97;
}
g.col:nth-child(1) { --n: 1; }
g.col:nth-child(2) { --n: 2; }
g.col:nth-child(3) { --n: 3; }
g.col:nth-child(4) { --n: 4; }
g[data-x]:hover use[href="#hex"] {
fill: orange;
stroke: orangered;
}
g[data-x]:hover use[href="#davion-1"] {
transform: scale(1.5);
}
g[data-x] {
--scale: 1;
transform: translateX(calc(var(--x-step) * var(--i))) scale(var(--scale));
}
g[data-y="0"] { --i: 0; }
g[data-y="1"] { --i: 1; }
g[data-y="2"] { --i: 2; }
g[data-y="3"] { --i: 3; }
g[data-y="4"] { --i: 4; }
g[data-y="5"] { --i: 5; }
g[data-y="6"] { --i: 6; }
g[data-y="7"] { --i: 7; }
g[data-y="8"] { --i: 8; }
g[data-y="9"] { --i: 9; }
g[data-y="10"] { --i: 10; }
g[data-y="11"] { --i: 11; }
g[data-y="12"] { --i: 12; }
g[data-y="13"] { --i: 13; }
g[data-y="14"] { --i: 14; }
g[data-y="15"] { --i: 15; }
g[data-y="16"] { --i: 16; }
g[data-y="17"] { --i: 17; }
g[data-y="18"] { --i: 18; }
g[data-y="19"] { --i: 19; }
g[data-y="20"] { --i: 20; }
g[data-y="21"] { --i: 21; }
g[data-y="22"] { --i: 22; }
g[data-y="23"] { --i: 23; }
g[data-y="24"] { --i: 24; }
g[data-y="25"] { --i: 25; }
g[data-y="26"] { --i: 26; }
g[data-y="27"] { --i: 27; }
g[data-y="28"] { --i: 28; }
g[data-y="29"] { --i: 29; }
g[data-y="30"] { --i: 30; }
g[data-y="31"] { --i: 31; }
g[data-y="32"] { --i: 32; }
g[data-y="33"] { --i: 33; }
g[data-y="34"] { --i: 34; }
g[data-y="35"] { --i: 35; }
g[data-y="36"] { --i: 36; }
g[data-y="37"] { --i: 37; }
g[data-y="38"] { --i: 38; }
g[data-y="39"] { --i: 39; }
g[data-y="40"] { --i: 40; }
g[data-y="41"] { --i: 41; }
g[data-y="42"] { --i: 42; }
g[data-y="43"] { --i: 43; }
g[data-y="44"] { --i: 44; }
g[data-y="45"] { --i: 45; }
g[data-y="46"] { --i: 46; }
g[data-y="47"] { --i: 47; }
g[data-y="48"] { --i: 48; }
g[data-y="49"] { --i: 49; }
g[data-y="50"] { --i: 50; }
g[data-x="0"] { --i: 0; }
g[data-x="1"] { --i: 1; }
g[data-x="2"] { --i: 2; }
g[data-x="3"] { --i: 3; }
g[data-x="4"] { --i: 4; }
g[data-x="5"] { --i: 5; }
g[data-x="6"] { --i: 6; }
g[data-x="7"] { --i: 7; }
g[data-x="8"] { --i: 8; }
g[data-x="9"] { --i: 9; }
g[data-x="10"] { --i: 10; }
g[data-x="11"] { --i: 11; }
g[data-x="12"] { --i: 12; }
g[data-x="13"] { --i: 13; }
g[data-x="14"] { --i: 14; }
g[data-x="15"] { --i: 15; }
g[data-x="16"] { --i: 16; }
g[data-x="17"] { --i: 17; }
g[data-x="18"] { --i: 18; }
g[data-x="19"] { --i: 19; }
g[data-x="20"] { --i: 20; }
g[data-x="21"] { --i: 21; }
g[data-x="22"] { --i: 22; }
g[data-x="23"] { --i: 23; }
g[data-x="24"] { --i: 24; }
g[data-x="25"] { --i: 25; }
g[data-x="26"] { --i: 26; }
g[data-x="27"] { --i: 27; }
g[data-x="28"] { --i: 28; }
g[data-x="29"] { --i: 29; }
g[data-x="30"] { --i: 30; }
g[data-x="31"] { --i: 31; }
g[data-x="32"] { --i: 32; }

File diff suppressed because it is too large Load Diff

Before

Width:  |  Height:  |  Size: 4.6 KiB

After

Width:  |  Height:  |  Size: 77 KiB