mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-22 20:11:24 +01:00
Color picker hatches 14-60
Added hatches to number 14 to 60. Updated the code of the color picker to accept multiples rows of hatches. Changed the size of fillRectPointer from 0.9 em to 1.5 em. Added an Update code to upgrade maps to 1.72 to have a grid of 60 svg hatches. Without the update, loaded files appeared with the rectangles for hatches 14-60 empty.
This commit is contained in:
parent
6981d0f710
commit
847251df58
5 changed files with 196 additions and 30 deletions
188
index.html
188
index.html
|
|
@ -169,31 +169,189 @@
|
|||
<line x1="0" y1="0" x2="0" y2="4" style="stroke:black; stroke-width:1.5"/>
|
||||
<line x1="0" y1="0" x2="4" y2="0" style="stroke:black; stroke-width:1.5"/>
|
||||
</pattern>
|
||||
<pattern id="hatch6" patternUnits="userSpaceOnUse" width="5" height="5">
|
||||
<circle cx="2.5" cy="2.5" r="1" style="fill: black"/>
|
||||
</pattern>
|
||||
<pattern id="hatch7" patternUnits="userSpaceOnUse" width="4" height="4">
|
||||
<pattern id="hatch6" patternUnits="userSpaceOnUse" width="4" height="4">
|
||||
<line x1="0" y1="0" x2="0" y2="3" transform="rotate(-45 0 0)" style="stroke:black; stroke-width:1.5" />
|
||||
</pattern>
|
||||
<pattern id="hatch8" patternUnits="userSpaceOnUse" width="4" height="4">
|
||||
<pattern id="hatch7" patternTransform="rotate(-45 0 0)" patternUnits="userSpaceOnUse" width="4" height="4">
|
||||
<line x1="0" y1="0" x2="0" y2="3" transform="rotate(-45 0 0)" style="stroke:black; stroke-width:1.5" />
|
||||
</pattern>
|
||||
<pattern id="hatch8" patternTransform="rotate(45 0 0)" patternUnits="userSpaceOnUse" width="4" height="4">
|
||||
<line x1="0" y1="0" x2="0" y2="3" transform="rotate(-45 0 0)" style="stroke:black; stroke-width:1.5" />
|
||||
</pattern>
|
||||
<pattern id="hatch9" patternUnits="userSpaceOnUse" width="4" height="4">
|
||||
<line x1="0" y1="0" x2="0" y2="3" style="stroke:black; stroke-width:2.5"/>
|
||||
</pattern>
|
||||
<pattern id="hatch9" patternTransform="rotate(45 0 0)" patternUnits="userSpaceOnUse" width="4" height="4">
|
||||
<pattern id="hatch10" patternTransform="rotate(45 0 0)" patternUnits="userSpaceOnUse" width="4" height="4">
|
||||
<line x1="0" y1="0" x2="0" y2="3" style="stroke:black; stroke-width:2.5"/>
|
||||
</pattern>
|
||||
<pattern id="hatch10" patternUnits="userSpaceOnUse" width="4" height="4">
|
||||
<pattern id="hatch11" patternUnits="userSpaceOnUse" width="4" height="4">
|
||||
<line x1="0" y1="0" x2="3" y2="0" style="stroke:black; stroke-width:2.5"/>
|
||||
</pattern>
|
||||
<pattern id="hatch11" patternTransform="rotate(-45 0 0)" patternUnits="userSpaceOnUse" width="4" height="4">
|
||||
<pattern id="hatch12" patternTransform="rotate(-45 0 0)" patternUnits="userSpaceOnUse" width="4" height="4">
|
||||
<line x1="0" y1="0" x2="0" y2="3" style="stroke:black; stroke-width:2.5"/>
|
||||
</pattern>
|
||||
<pattern id="hatch12" patternTransform="rotate(45 0 0)" patternUnits="userSpaceOnUse" width="4" height="4">
|
||||
<line x1="0" y1="1" x2="0" y2="3" style="stroke:black; stroke-width:1.5" />
|
||||
<line x1="1" y1="0" x2="3" y2="0" style="stroke:black; stroke-width:1.5" />
|
||||
</pattern>
|
||||
<pattern id="hatch13" patternTransform="rotate(45 0 0)" patternUnits="userSpaceOnUse" width="4" height="4">
|
||||
<line x1="0" y1="0" x2="0" y2="3" style="stroke:black; stroke-width:1.5" />
|
||||
<line x1="0" y1="0" x2="3" y2="0" style="stroke:black; stroke-width:1.5" />
|
||||
<line x1="0" y1="1" x2="0" y2="3" style="stroke:black; stroke-width:1.5"/>
|
||||
<line x1="1" y1="0" x2="3" y2="0" style="stroke:black; stroke-width:1.5"/>
|
||||
</pattern>
|
||||
<pattern id="hatch14" patternTransform="rotate(45 0 0)" patternUnits="userSpaceOnUse" width="4" height="4">
|
||||
<line x1="0" y1="0" x2="0" y2="3" style="stroke:black; stroke-width:1.5"/>
|
||||
<line x1="0" y1="0" x2="3" y2="0" style="stroke:black; stroke-width:1.5"/>
|
||||
</pattern>
|
||||
<pattern id="hatch15" patternUnits="userSpaceOnUse" width="4" height="4">
|
||||
<line x1="1" y1="0" x2="0" y2="4" style="stroke:black; stroke-width:2"/>
|
||||
</pattern>
|
||||
<pattern id="hatch16" patternTransform="rotate(45 0 0)" patternUnits="userSpaceOnUse" width="4" height="4">
|
||||
<line x1="1" y1="0" x2="0" y2="4" style="stroke:black; stroke-width:2"/>
|
||||
</pattern>
|
||||
<pattern id="hatch17" patternTransform="rotate(-45 0 0)" patternUnits="userSpaceOnUse" width="4" height="4">
|
||||
<line x1="1" y1="0" x2="0" y2="4" style="stroke:black; stroke-width:2"/>
|
||||
</pattern>
|
||||
<pattern id="hatch18" patternUnits="userSpaceOnUse" width="4" height="4">
|
||||
<line x1="1" y1="0" x2="0" y2="4" style="stroke:black; stroke-width:1.5"/>
|
||||
<line x1="1" y1="0" x2="4" y2="0" style="stroke:black; stroke-width:1.5"/>
|
||||
</pattern>
|
||||
<pattern id="hatch19" patternTransform="rotate(45 0 0)" patternUnits="userSpaceOnUse" width="4" height="4">
|
||||
<line x1="1" y1="0" x2="0" y2="4" style="stroke:black; stroke-width:1.5"/>
|
||||
<line x1="1" y1="0" x2="4" y2="0" style="stroke:black; stroke-width:1.5"/>
|
||||
</pattern>
|
||||
<pattern id="hatch20" patternUnits="userSpaceOnUse" width="4" height="4">
|
||||
<line x1="2" y1="0" x2="0" y2="4" style="stroke:black; stroke-width:2"/>
|
||||
</pattern>
|
||||
<pattern id="hatch21" patternTransform="rotate(45 0 0)" patternUnits="userSpaceOnUse" width="4" height="4">
|
||||
<line x1="2" y1="0" x2="0" y2="4" style="stroke:black; stroke-width:2"/>
|
||||
</pattern>
|
||||
<pattern id="hatch22" patternTransform="rotate(-45 0 0)" patternUnits="userSpaceOnUse" width="4" height="4">
|
||||
<line x1="2" y1="0" x2="0" y2="4" style="stroke:black; stroke-width:2"/>
|
||||
</pattern>
|
||||
<pattern id="hatch23" patternTransform="rotate(45 0 0)" patternUnits="userSpaceOnUse" width="4" height="4">
|
||||
<line x1="2" y1="0" x2="0" y2="4" style="stroke:black; stroke-width:1.5"/>
|
||||
<line x1="2" y1="0" x2="4" y2="0" style="stroke:black; stroke-width:1.5"/>
|
||||
</pattern>
|
||||
<pattern id="hatch24" patternUnits="userSpaceOnUse" width="4" height="4">
|
||||
<line x1="0" y1="0" x2="0" y2="3" style="stroke:black; stroke-width:1.5"/>
|
||||
<line x1="0" y1="0" x2="3" y2="0" style="stroke:black; stroke-width:1.5"/>
|
||||
</pattern>
|
||||
<pattern id="hatch25" patternUnits="userSpaceOnUse" width="4" height="4">
|
||||
<line x1="2" y1="0" x2="0" y2="4" style="stroke:black; stroke-width:1.5"/>
|
||||
<line x1="2" y1="0" x2="4" y2="0" style="stroke:black; stroke-width:1.5"/>
|
||||
</pattern>
|
||||
<pattern id="hatch26" patternTransform="rotate(-45 0 0)" patternUnits="userSpaceOnUse" width="4" height="4">
|
||||
<line x1="2" y1="0" x2="4" y2="0" style="stroke:black; stroke-width:2"/>
|
||||
</pattern>
|
||||
<pattern id="hatch27" patternUnits="userSpaceOnUse" width="4" height="4">
|
||||
<line x1="2" y1="0" x2="4" y2="0" style="stroke:black; stroke-width:2"/>
|
||||
</pattern>
|
||||
<pattern id="hatch28" patternTransform="rotate(45 0 0)" patternUnits="userSpaceOnUse" width="4" height="4">
|
||||
<line x1="2" y1="0" x2="4" y2="0" style="stroke:black; stroke-width:2"/>
|
||||
</pattern>
|
||||
<pattern id="hatch29" patternUnits="userSpaceOnUse" width="4" height="4">
|
||||
<line x1="2" y1="0" x2="0" y2="2" style="stroke:black; stroke-width:2"/>
|
||||
</pattern>
|
||||
<pattern id="hatch30" patternTransform="rotate(30 0 0)" patternUnits="userSpaceOnUse" width="4" height="4">
|
||||
<line x1="0" y1="1" x2="0" y2="3" style="stroke:black; stroke-width:1.5"/>
|
||||
<line x1="1" y1="0" x2="3" y2="0" style="stroke:black; stroke-width:1.5"/>
|
||||
</pattern>
|
||||
<pattern id="hatch31" patternUnits="userSpaceOnUse" width="4" height="4">
|
||||
<line x1="1" y1="0" x2="0" y2="3" style="stroke:black; stroke-width:1.5"/>
|
||||
<line x1="1" y1="0" x2="3" y2="0" style="stroke:black; stroke-width:1.5"/>
|
||||
</pattern>
|
||||
<pattern id="hatch32" patternTransform="rotate(45 0 0)" patternUnits="userSpaceOnUse" width="4" height="4">
|
||||
<line x1="1" y1="0" x2="0" y2="3" style="stroke:black; stroke-width:1.5"/>
|
||||
<line x1="1" y1="0" x2="3" y2="0" style="stroke:black; stroke-width:1.5"/>
|
||||
</pattern>
|
||||
<pattern id="hatch33" patternUnits="userSpaceOnUse" width="5" height="5">
|
||||
<circle cx="2.5" cy="2.5" r="0.5" style="fill: black"/>
|
||||
</pattern>
|
||||
<pattern id="hatch34" patternUnits="userSpaceOnUse" width="5" height="5">
|
||||
<circle cx="2.5" cy="2.5" r="1" style="fill: black"/>
|
||||
</pattern>
|
||||
<pattern id="hatch35" patternUnits="userSpaceOnUse" width="5" height="5">
|
||||
<circle cx="2.5" cy="2.5" r="1.5" style="fill: black"/>
|
||||
</pattern>
|
||||
<pattern id="hatch36" patternUnits="userSpaceOnUse" width="5" height="5">
|
||||
<circle cx="2.5" cy="2.5" r="2" style="fill: black"/>
|
||||
</pattern>
|
||||
<pattern id="hatch37" patternUnits="userSpaceOnUse" width="5" height="5">
|
||||
<circle cx="3" cy="3" r="0.5" style="fill: black"/>
|
||||
<circle cx="1" cy="1" r="0.5" style="fill: black"/>
|
||||
</pattern>
|
||||
<pattern id="hatch38" patternUnits="userSpaceOnUse" width="5" height="5">
|
||||
<circle cx="3" cy="3" r="1" style="fill: black"/>
|
||||
<circle cx="1" cy="1" r="1" style="fill: black"/>
|
||||
</pattern>
|
||||
<pattern id="hatch39" patternUnits="userSpaceOnUse" width="5" height="5">
|
||||
<circle cx="3" cy="3" r="1.5" style="fill: black"/>
|
||||
<circle cx="1" cy="1" r="1.5" style="fill: black"/>
|
||||
</pattern>
|
||||
<pattern id="hatch40" patternUnits="userSpaceOnUse" width="5" height="5">
|
||||
<circle cx="3" cy="3" r="2" style="fill: black"/>
|
||||
<circle cx="1" cy="1" r="2" style="fill: black"/>
|
||||
</pattern>
|
||||
<pattern id="hatch41" patternUnits="userSpaceOnUse" width="4" height="4">
|
||||
<line x1="0" y1="0" x2="4" y2="4" style="stroke:black; stroke-width:1.5"/>
|
||||
<line x1="0" y1="0" x2="4" y2="0" style="stroke:black; stroke-width:1.5"/>
|
||||
</pattern>
|
||||
<pattern id="hatch42" patternTransform="rotate(45 0 0)" patternUnits="userSpaceOnUse" width="4" height="4">
|
||||
<line x1="0" y1="0" x2="4" y2="4" style="stroke:black; stroke-width:1.5"/>
|
||||
<line x1="0" y1="0" x2="4" y2="0" style="stroke:black; stroke-width:1.5"/>
|
||||
</pattern>
|
||||
<pattern id="hatch43" patternUnits="userSpaceOnUse" width="4" height="4">
|
||||
<line x1="0" y1="0" x2="3" y2="3" style="stroke:black; stroke-width:1.5"/>
|
||||
<line x1="0" y1="0" x2="4" y2="0" style="stroke:black; stroke-width:1.5"/>
|
||||
</pattern>
|
||||
<pattern id="hatch44" patternTransform="rotate(45 0 0)" patternUnits="userSpaceOnUse" width="4" height="4">
|
||||
<line x1="0" y1="0" x2="3" y2="3" style="stroke:black; stroke-width:1.5"/>
|
||||
<line x1="0" y1="0" x2="4" y2="0" style="stroke:black; stroke-width:1.5"/>
|
||||
</pattern>
|
||||
<pattern id="hatch45" patternUnits="userSpaceOnUse" width="4" height="4">
|
||||
<line x1="0" y1="0" x2="0" y2="4" style="stroke:grey; stroke-width:1"/>
|
||||
</pattern>
|
||||
<pattern id="hatch46" patternTransform="rotate(45 0 0)" patternUnits="userSpaceOnUse" width="4" height="4">
|
||||
<line x1="0" y1="0" x2="0" y2="4" style="stroke:grey; stroke-width:1"/>
|
||||
</pattern>
|
||||
<pattern id="hatch47" patternUnits="userSpaceOnUse" width="4" height="4">
|
||||
<line x1="0" y1="0" x2="4" y2="0" style="stroke:grey; stroke-width:1"/>
|
||||
</pattern>
|
||||
<pattern id="hatch48" patternTransform="rotate(-45 0 0)" patternUnits="userSpaceOnUse" width="4" height="4">
|
||||
<line x1="0" y1="0" x2="0" y2="4" style="stroke:grey; stroke-width:1"/>
|
||||
</pattern>
|
||||
<pattern id="hatch49" patternUnits="userSpaceOnUse" width="4" height="4">
|
||||
<line x1="0" y1="0" x2="0" y2="4" style="stroke:grey; stroke-width:1"/>
|
||||
<line x1="0" y1="0" x2="4" y2="0" style="stroke:grey; stroke-width:1"/>
|
||||
</pattern>
|
||||
<pattern id="hatch50" patternTransform="rotate(45 0 0)" patternUnits="userSpaceOnUse" width="4" height="4">
|
||||
<line x1="0" y1="0" x2="0" y2="4" style="stroke:grey; stroke-width:1"/>
|
||||
<line x1="0" y1="0" x2="4" y2="0" style="stroke:grey; stroke-width:1"/>
|
||||
</pattern>
|
||||
<pattern id="hatch51" patternUnits="userSpaceOnUse" width="4" height="4">
|
||||
<line x1="0" y1="0" x2="0" y2="3" transform="rotate(-45 0 0)" style="stroke:grey; stroke-width:1" />
|
||||
</pattern>
|
||||
<pattern id="hatch52" patternTransform="rotate(-45 0 0)" patternUnits="userSpaceOnUse" width="4" height="4">
|
||||
<line x1="0" y1="0" x2="0" y2="3" transform="rotate(-45 0 0)" style="stroke:grey; stroke-width:1" />
|
||||
</pattern>
|
||||
<pattern id="hatch53" patternTransform="rotate(45 0 0)" patternUnits="userSpaceOnUse" width="4" height="4">
|
||||
<line x1="0" y1="0" x2="0" y2="3" transform="rotate(-45 0 0)" style="stroke:grey; stroke-width:1" />
|
||||
</pattern>
|
||||
<pattern id="hatch54" patternUnits="userSpaceOnUse" width="4" height="4">
|
||||
<line x1="0" y1="0" x2="0" y2="3" style="stroke:grey; stroke-width:1"/>
|
||||
</pattern>
|
||||
<pattern id="hatch55" patternTransform="rotate(45 0 0)" patternUnits="userSpaceOnUse" width="4" height="4">
|
||||
<line x1="0" y1="0" x2="0" y2="3" style="stroke:grey; stroke-width:1"/>
|
||||
</pattern>
|
||||
<pattern id="hatch56" patternUnits="userSpaceOnUse" width="4" height="4">
|
||||
<line x1="0" y1="0" x2="3" y2="0" style="stroke:grey; stroke-width:1"/>
|
||||
</pattern>
|
||||
<pattern id="hatch57" patternTransform="rotate(-45 0 0)" patternUnits="userSpaceOnUse" width="4" height="4">
|
||||
<line x1="0" y1="0" x2="0" y2="3" style="stroke:grey; stroke-width:1"/>
|
||||
</pattern>
|
||||
<pattern id="hatch58" patternTransform="rotate(45 0 0)" patternUnits="userSpaceOnUse" width="4" height="4">
|
||||
<line x1="0" y1="1" x2="0" y2="3" style="stroke:grey; stroke-width:1"/>
|
||||
<line x1="1" y1="0" x2="3" y2="0" style="stroke:grey; stroke-width:1"/>
|
||||
</pattern>
|
||||
<pattern id="hatch59" patternTransform="rotate(45 0 0)" patternUnits="userSpaceOnUse" width="4" height="4">
|
||||
<line x1="0" y1="0" x2="0" y2="3" style="stroke:grey; stroke-width:1"/>
|
||||
<line x1="0" y1="0" x2="3" y2="0" style="stroke:grey; stroke-width:1"/>
|
||||
</pattern>
|
||||
</g>
|
||||
|
||||
|
|
@ -226,7 +384,7 @@
|
|||
<div id="loading">
|
||||
<div id="titleName"><t data-t="titleName">Azgaar's</t></div>
|
||||
<div id="title"><t data-t="title">Fantasy Map Generator</t></div>
|
||||
<div id="version"><t data-t="version">v. </t>1.71</div>
|
||||
<div id="version"><t data-t="version">v. </t>1.72</div>
|
||||
<p id="loading-text"><t data-t="loading">LOADING</t><span>.</span><span>.</span><span>.</span></p>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
2
main.js
2
main.js
|
|
@ -2,7 +2,7 @@
|
|||
// https://github.com/Azgaar/Fantasy-Map-Generator
|
||||
|
||||
"use strict";
|
||||
const version = "1.71"; // generator version
|
||||
const version = "1.72"; // generator version
|
||||
document.title += " v" + version;
|
||||
|
||||
// Switches to disable/enable logging features
|
||||
|
|
|
|||
|
|
@ -190,7 +190,7 @@ function parseLoadedData(data) {
|
|||
if (customizationMenu.offsetParent) styleTab.click();
|
||||
|
||||
const reliefIcons = document.getElementById("defs-relief").innerHTML; // save relief icons
|
||||
const hatching = document.getElementById("hatching").cloneNode(true); // save hatching
|
||||
const newHatching = document.getElementById("hatching").cloneNode(true); // save hatching
|
||||
|
||||
void (function parseParameters() {
|
||||
const params = data[0].split("|");
|
||||
|
|
@ -474,7 +474,7 @@ function parseLoadedData(data) {
|
|||
if (!layerIsOn("toggleStates")) regions.attr("display", "none").selectAll("path").remove();
|
||||
|
||||
// 1.0 adds hatching
|
||||
document.getElementsByTagName("defs")[0].appendChild(hatching);
|
||||
document.getElementsByTagName("defs")[0].appendChild(newHatching);
|
||||
|
||||
// 1.0 adds zones layer
|
||||
zones = viewbox.insert("g", "#borders").attr("id", "zones").attr("display", "none");
|
||||
|
|
@ -929,6 +929,13 @@ function parseLoadedData(data) {
|
|||
if (layerIsOn("markers")) drawMarkers();
|
||||
}
|
||||
}
|
||||
|
||||
if (version < 1.72) {
|
||||
// v 1.72 changed hatching data
|
||||
document.getElementById("hatching").remove();
|
||||
document.getElementsByTagName("defs")[0].appendChild(newHatching);
|
||||
};
|
||||
|
||||
})();
|
||||
|
||||
void (function checkDataIntegrity() {
|
||||
|
|
@ -1039,7 +1046,7 @@ function parseLoadedData(data) {
|
|||
// sort markers by index
|
||||
pack.markers.sort((a, b) => a.i - b.i);
|
||||
}
|
||||
})();
|
||||
})();
|
||||
|
||||
changeMapSize();
|
||||
|
||||
|
|
|
|||
|
|
@ -492,8 +492,8 @@ function createPicker() {
|
|||
.attr("id", "picker_" + d)
|
||||
.attr("fill", d)
|
||||
.attr("class", i ? "" : "selected")
|
||||
.attr("x", i * 22 + 4)
|
||||
.attr("y", 40)
|
||||
.attr("x", (i % 15) * 22 + 4)
|
||||
.attr("y", 40 + Math.floor(i / 15)*20)
|
||||
.attr("width", 16)
|
||||
.attr("height", 16);
|
||||
});
|
||||
|
|
@ -503,10 +503,11 @@ function createPicker() {
|
|||
.append("rect")
|
||||
.attr("id", "picker_" + this.id)
|
||||
.attr("fill", "url(#" + this.id + ")")
|
||||
.attr("x", i * 22 + 4)
|
||||
.attr("y", 61)
|
||||
.attr("x", (i % 15) * 22 + 4)
|
||||
.attr("y", Math.floor(i / 15)*20 + (number * 2))
|
||||
.attr("width", 16)
|
||||
.attr("height", 16);
|
||||
.attr("height", 16)
|
||||
.on("mousemove", () => tip("Click to fill with the hatching " + this.id));
|
||||
});
|
||||
|
||||
colors
|
||||
|
|
@ -516,7 +517,7 @@ function createPicker() {
|
|||
hatches
|
||||
.selectAll("rect")
|
||||
.on("click", pickerFillClicked)
|
||||
.on("mousemove", () => tip("Click to fill with the hatching"));
|
||||
//.on("mousemove", () => tip("Click to fill with the hatching " + #("#picker_" + hatch.id) ));
|
||||
|
||||
// append box
|
||||
const bbox = picker.node().getBBox();
|
||||
|
|
@ -532,10 +533,10 @@ function createPicker() {
|
|||
.attr("fill", "#ffffff")
|
||||
.attr("stroke", "#5d4651")
|
||||
.on("mousemove", pos);
|
||||
picker.insert("text", ":first-child").attr("x", 291).attr("y", -10).attr("id", "pickerCloseText").text("✕");
|
||||
picker.insert("text", ":first-child").attr("x", width-20).attr("y", -10).attr("id", "pickerCloseText").text("✕");
|
||||
picker
|
||||
.insert("rect", ":first-child")
|
||||
.attr("x", 288)
|
||||
.attr("x", width-23)
|
||||
.attr("y", -21)
|
||||
.attr("id", "pickerCloseRect")
|
||||
.attr("width", 14)
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ function editZones() {
|
|||
const focused = defs.select("#fog #focus" + this.id).size();
|
||||
|
||||
lines += `<div class="states" data-id="${this.id}" data-fill="${fill}" data-description="${description}" data-cells=${c.length} data-area=${area} data-population=${population}>
|
||||
<svg data-tip="Zone fill style. Click to change" width=".9em" height=".9em" style="margin-bottom:-1px"><rect x="0" y="0" width="100%" height="100%" fill="${fill}" class="fillRect pointer"></svg>
|
||||
<svg data-tip="Zone fill style. Click to change" width="1.5em" height="1.5em" style="margin-bottom:-4px"><rect x="0" y="0" width="100%" height="100%" fill="${fill}" class="fillRect pointer"></svg>
|
||||
<input data-tip="Zone description. Click and type to change" class="religionName" value="${description}" autocorrect="off" spellcheck="false">
|
||||
<span data-tip="Cells count" class="icon-check-empty hide"></span>
|
||||
<div data-tip="Cells count" class="stateCells hide">${c.length}</div>
|
||||
|
|
@ -344,12 +344,12 @@ function editZones() {
|
|||
function addZonesLayer() {
|
||||
const id = getNextId("zone");
|
||||
const description = "Unknown zone";
|
||||
const fill = "url(#hatch" + (id.slice(4) % 14) + ")";
|
||||
const fill = "url(#hatch" + (id.slice(4) % 60) + ")";
|
||||
zones.append("g").attr("id", id).attr("data-description", description).attr("data-cells", "").attr("fill", fill);
|
||||
const unit = areaUnit.value === "square" ? " " + distanceUnitInput.value + "²" : " " + areaUnit.value;
|
||||
|
||||
const line = `<div class="states" data-id="${id}" data-fill="${fill}" data-description="${description}" data-cells=0 data-area=0 data-population=0>
|
||||
<svg data-tip="Zone fill style. Click to change" width=".9em" height=".9em" style="margin-bottom:-1px"><rect x="0" y="0" width="100%" height="100%" fill="${fill}" class="fillRect pointer"></svg>
|
||||
<svg data-tip="Zone fill style. Click to change" width="1.5em" height="1.5em" style="margin-bottom:-4px"><rect x="0" y="0" width="100%" height="100%" fill="${fill}" class="fillRect pointer"></svg>
|
||||
<input data-tip="Zone description. Click and type to change" class="religionName" value="${description}" autocorrect="off" spellcheck="false">
|
||||
<span data-tip="Cells count" class="icon-check-empty hide"></span>
|
||||
<div data-tip="Cells count" class="stateCells hide">0</div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue