diff --git a/index.css b/index.css index 373bf63c..ea78f087 100644 --- a/index.css +++ b/index.css @@ -19,6 +19,11 @@ font { pointer-events: none; } +form input:invalid { + outline: 1px solid #ed4337; + outline-offset: 1px; +} + input, select, button { @@ -53,6 +58,7 @@ input:read-only { input[type="radio"] { vertical-align: bottom; cursor: pointer; + accent-color: var(--header); } textarea { @@ -1506,12 +1512,6 @@ div.states > select { appearance: none; } -div.states > .burgName, -div.states > .burgState, -div.states > .burgCulture { - width: 6em; -} - div.states span.inactive { color: #c6c2c2; } @@ -1893,10 +1893,11 @@ div.editorLine { } #militaryOptionsTable input[type="number"] { - width: 4em; + width: 5em; } -#militaryOptionsTable button { +#militaryOptionsTable button, +#burgGroupsBody button { width: 100%; } @@ -1929,7 +1930,12 @@ ul.share-buttons img { width: 2em; } -input[type="checkbox"] { +input[type="checkbox"].native { + accent-color: var(--header); + cursor: pointer; +} + +input[type="checkbox"]:not(.native) { display: none; } diff --git a/index.html b/index.html index 0c8a1e58..d2d184b4 100644 --- a/index.html +++ b/index.html @@ -646,14 +646,6 @@ > Emblems -
  • - Labels -
  • Icons
  • +
  • + Labels +
  • + + + Icon + + + + + + + Icon size + + + + + + + Stroke linejoin + + + + + + + Fill opacity + + + + + + Type @@ -1175,7 +1230,7 @@ Stroke width - + @@ -1184,7 +1239,7 @@ Letter spacing - + @@ -1208,7 +1263,7 @@ Text shadow - + @@ -1234,24 +1289,12 @@ - - - Radius + + + Label shift - - - - - - - - - - Size - - - - + + @@ -1707,11 +1750,11 @@ - + - Towns number + Burgs number @@ -3373,6 +3416,12 @@ > +
    +
    Group:
    + + +
    +
    Type:
    - - - -
    - - + + + + + + + + + + + + + + + + + + + + ${count} + + + + + + `; + } + + function selectLimitation(el, data) { + const value = el.previousElementSibling.value; + const initial = value ? value.split(",").map(v => +v) : []; + + const filtered = data.filter(datum => datum.i && !datum.removed); + const lines = filtered.map( + ({i, name, fullName, color}) => /* html */ ` + + + ⬤ + + + + + + ` + ); + + alertMessage.innerHTML = /* html */ `Limit group by ${el.name}: + + + ${lines.join("")} + +
    `; + + $("#alert").dialog({ + width: fitContent(), + title: "Limit group", + buttons: { + Invert: function () { + alertMessage.querySelectorAll("input").forEach(el => (el.checked = !el.checked)); + }, + Apply: function () { + const inputs = Array.from(alertMessage.querySelectorAll("input")); + const selected = inputs.reduce((acc, input) => { + if (input.checked) acc.push(input.dataset.i); + return acc; + }, []); + + if (!selected.length) return tip("Select at least one element", false, "error"); + + const allAreSelected = selected.length === inputs.length; + el.previousElementSibling.value = allAreSelected ? "" : selected.join(","); + el.innerHTML = allAreSelected ? "all" : "some"; + $(this).dialog("close"); + }, + Cancel: function () { + $(this).dialog("close"); + } + } + }); + } + + function selectFeaturesLimitation(el) { + const value = el.previousElementSibling.value; + const initial = value ? JSON.parse(value) : {}; + + const features = [ + {name: "capital", icon: "icon-star"}, + {name: "port", icon: "icon-anchor"}, + {name: "citadel", icon: "icon-chess-rook"}, + {name: "walls", icon: "icon-fort-awesome"}, + {name: "plaza", icon: "icon-store"}, + {name: "temple", icon: "icon-chess-bishop"}, + {name: "shanty", icon: "icon-campground"} + ]; + + const lines = features.map( + // prettier-ignore + ({name, icon}) => /* html */ ` + + + + ${name} + + + + + + + + + + + ` + ); + + alertMessage.innerHTML = /* html */ ` +
    + + + + + + + + + ${lines.join("")} + +
    FeaturesTrueFalseAny
    +
    `; + + $("#alert").dialog({ + width: fitContent(), + title: "Limit group by features", + buttons: { + Apply: function () { + const form = byId("featuresLimitationForm"); + const values = features.reduce((acc, {name}) => { + const value = form[name].value; + if (value !== "undefined") acc[name] = value === "true"; + return acc; + }, {}); + + el.previousElementSibling.value = JSON.stringify(values); + el.innerHTML = Object.keys(values).length ? "some" : "any"; + + $(this).dialog("close"); + }, + Cancel: function () { + $(this).dialog("close"); + } + } + }); + } + + function removeLine(line) { + const lines = byId("burgGroupsBody").children; + if (lines.length < 2) return tip("At least one group should be defined", false, "error"); + + confirmationDialog({ + title: "Remove group", + message: + "Are you sure you want to remove the group?
    This WON'T change the burgs unless the changes are applied", + confirm: "Remove", + onConfirm: () => { + line.remove(); + validateForm(); + } + }); + } + + function validateForm() { + const form = byId("burgGroupsForm"); + + if (form.name.length) { + const names = Array.from(form.name).map(input => input.value); + form.name.forEach(nameInput => { + const value = nameInput.value; + const isUnique = names.filter(n => n === value).length === 1; + nameInput.setCustomValidity(isUnique ? "" : "Group name should be unique"); + nameInput.reportValidity(); + }); + } + + if (form.active.length) { + const active = Array.from(form.active).map(input => input.checked); + form.active[0].setCustomValidity(active.includes(true) ? "" : "At least one group should be active"); + form.active[0].reportValidity(); + } else { + const active = form.active.checked; + form.active.setCustomValidity(active ? "" : "At least one group should be active"); + form.active.reportValidity(); + } + + if (form.isDefault.length) { + const checked = Array.from(form.isDefault).map(input => input.checked); + form.isDefault[0].setCustomValidity(checked.includes(true) ? "" : "At least one group should be default"); + form.isDefault[0].reportValidity(); + } else { + const checked = form.isDefault.checked; + form.isDefault.setCustomValidity(checked ? "" : "At least one group should be default"); + form.isDefault.reportValidity(); + } + } + + function submitForm(event) { + event.preventDefault(); + + const lines = Array.from(byId("burgGroupsBody").children); + if (!lines.length) return tip("At least one group should be defined", false, "error"); + + function parseInput(input) { + if (input.name === "name") return sanitizeId(input.value); + if (input.name === "features") { + const isValid = JSON.isValid(input.value); + const parsed = isValid ? JSON.parse(input.value) : {}; + if (Object.keys(parsed).length) return parsed; + return null; + } + if (input.type === "hidden") return input.value || null; + if (input.type === "radio") return input.checked; + if (input.type === "checkbox") return input.checked; + if (input.type === "number") { + const value = input.valueAsNumber; + if (value === 0 || isNaN(value)) return null; + return value; + } + return input.value || null; + } + + options.burgs.groups = lines.map(line => { + const inputs = line.querySelectorAll("input, select"); + const group = Array.from(inputs).reduce((obj, input) => { + const value = parseInput(input); + if (value !== null) obj[input.name] = value; + return obj; + }, {}); + return group; + }); + localStorage.setItem("burg-groups", JSON.stringify(options.burgs.groups)); + + // put burgs to new groups + const validBurgs = pack.burgs.filter(b => b.i && !b.removed); + const populations = validBurgs.map(b => b.population).sort((a, b) => a - b); + validBurgs.forEach(burg => Burgs.defineGroup(burg, populations)); + + if (layerIsOn("toggleBurgIcons")) drawBurgIcons(); + if (layerIsOn("toggleLabels")) drawBurgLabels(); + if (byId("burgsOverviewRefresh")?.offsetParent) burgsOverviewRefresh.click(); + + $("#burgGroupsEditor").dialog("close"); + } +} diff --git a/modules/ui/burgs-overview.js b/modules/ui/burgs-overview.js index 2a487b67..ac18ab56 100644 --- a/modules/ui/burgs-overview.js +++ b/modules/ui/burgs-overview.js @@ -24,6 +24,7 @@ function overviewBurgs(settings = {stateId: null, cultureId: null}) { // add listeners byId("burgsOverviewRefresh").addEventListener("click", refreshBurgsEditor); + byId("burgsGroupsEditorButton").addEventListener("click", editBurgGroups); byId("burgsChart").addEventListener("click", showBurgsChart); byId("burgsFilterState").addEventListener("change", burgsOverviewAddLines); byId("burgsFilterCulture").addEventListener("change", burgsOverviewAddLines); @@ -88,29 +89,24 @@ function overviewBurgs(settings = {stateId: null, cultureId: null}) { data-state="${state}" data-province="${province}" data-culture="${culture}" + data-group="${b.group}" data-population=${population} data-features="${features}" > - - - - + + + + + - +
    - + data-tip="${b.capital ? " This burg is a state capital" : "This burg is a NOT state capital"}" + class="icon-star-empty${b.capital ? "" : " inactive"}" style="padding: 0 1px;"> +
    el.addEventListener("mouseenter", ev => burgHighlightOn(ev))); body.querySelectorAll("div.states").forEach(el => el.addEventListener("mouseleave", ev => burgHighlightOff(ev))); - body.querySelectorAll("div > input.burgName").forEach(el => el.addEventListener("input", changeBurgName)); body.querySelectorAll("div > span.icon-dot-circled").forEach(el => el.addEventListener("click", zoomIntoBurg)); - body.querySelectorAll("div > select.stateCulture").forEach(el => el.addEventListener("change", changeBurgCulture)); - body - .querySelectorAll("div > input.burgPopulation") - .forEach(el => el.addEventListener("change", changeBurgPopulation)); - body - .querySelectorAll("div > span.icon-star-empty") - .forEach(el => el.addEventListener("click", toggleCapitalStatus)); - body.querySelectorAll("div > span.icon-anchor").forEach(el => el.addEventListener("click", togglePortStatus)); body.querySelectorAll("div > span.locks").forEach(el => el.addEventListener("click", toggleBurgLockStatus)); body.querySelectorAll("div > span.icon-pencil").forEach(el => el.addEventListener("click", openBurgEditor)); body.querySelectorAll("div > span.icon-trash-empty").forEach(el => el.addEventListener("click", triggerBurgRemove)); @@ -164,15 +151,6 @@ function overviewBurgs(settings = {stateId: null, cultureId: null}) { burgLabels.selectAll("text.drag").classed("drag", false); } - function changeBurgName() { - if (this.value == "") tip("Please provide a name", false, "error"); - const burg = +this.parentNode.dataset.id; - pack.burgs[burg].name = this.value; - this.parentNode.dataset.name = this.value; - const label = document.querySelector("#burgLabels [data-id='" + burg + "']"); - if (label) label.innerHTML = this.value; - } - function zoomIntoBurg() { const burg = +this.parentNode.dataset.id; const label = document.querySelector("#burgLabels [data-id='" + burg + "']"); @@ -181,42 +159,6 @@ function overviewBurgs(settings = {stateId: null, cultureId: null}) { zoomTo(x, y, 8, 2000); } - function changeBurgCulture() { - const burg = +this.parentNode.dataset.id; - const v = +this.value; - pack.burgs[burg].culture = v; - this.parentNode.dataset.culture = pack.cultures[v].name; - } - - function changeBurgPopulation() { - const burg = +this.parentNode.dataset.id; - if (this.value == "" || isNaN(+this.value)) { - tip("Please provide an integer number (like 10000, not 10K)", false, "error"); - this.value = si(pack.burgs[burg].population * populationRate * urbanization); - return; - } - pack.burgs[burg].population = this.value / populationRate / urbanization; - this.parentNode.dataset.population = this.value; - this.value = si(this.value); - - const population = []; - body.querySelectorAll(":scope > div").forEach(el => population.push(+getInteger(el.dataset.population))); - burgsFooterPopulation.innerHTML = si(d3.mean(population)); - } - - function toggleCapitalStatus() { - const burg = +this.parentNode.parentNode.dataset.id; - toggleCapital(burg); - burgsOverviewAddLines(); - } - - function togglePortStatus() { - const burg = +this.parentNode.parentNode.dataset.id; - togglePort(burg); - if (this.classList.contains("inactive")) this.classList.remove("inactive"); - else this.classList.add("inactive"); - } - function toggleBurgLockStatus() { const burgId = +this.parentNode.dataset.id; @@ -240,16 +182,16 @@ function overviewBurgs(settings = {stateId: null, cultureId: null}) { } function triggerBurgRemove() { - const burg = +this.parentNode.dataset.id; - if (pack.burgs[burg].capital) - return tip("You cannot remove the capital. Please change the capital first", false, "error"); + const burgId = +this.parentNode.dataset.id; + if (pack.burgs[burgId].capital) + return tip("You cannot remove the capital. Please change the state capital first", false, "error"); confirmationDialog({ title: "Remove burg", message: "Are you sure you want to remove the burg?
    This action cannot be reverted", confirm: "Remove", onConfirm: () => { - removeBurg(burg); + Burgs.remove(burgId); burgsOverviewAddLines(); } }); @@ -286,7 +228,7 @@ function overviewBurgs(settings = {stateId: null, cultureId: null}) { if (pack.cells.burg[cell]) return tip("There is already a burg in this cell. Please select a free cell", false, "error"); - addBurg(point); // add new burg + Burgs.add(point); // add new burg if (d3.event.shiftKey === false) { exitAddBurgMode(); @@ -481,7 +423,7 @@ function overviewBurgs(settings = {stateId: null, cultureId: null}) { } function downloadBurgsData() { - let data = `Id,Burg,Province,Province Full Name,State,State Full Name,Culture,Religion,Population,X,Y,Latitude,Longitude,Elevation (${heightUnit.value}),Temperature,Temperature likeness,Capital,Port,Citadel,Walls,Plaza,Temple,Shanty Town,Emblem,City Generator Link\n`; // headers + let data = `Id,Burg,Province,Province Full Name,State,State Full Name,Culture,Religion,Group,Population,X,Y,Latitude,Longitude,Elevation (${heightUnit.value}),Temperature,Temperature likeness,Capital,Port,Citadel,Walls,Plaza,Temple,Shanty Town,Emblem,Preview link\n`; // headers const valid = pack.burgs.filter(b => b.i && !b.removed); // all valid burgs valid.forEach(b => { @@ -494,6 +436,7 @@ function overviewBurgs(settings = {stateId: null, cultureId: null}) { data += pack.states[b.state].fullName + ","; data += pack.cultures[b.culture].name + ","; data += pack.religions[pack.cells.religion[b.cell]].name + ","; + data += b.group + ","; data += rn(b.population * populationRate * urbanization) + ","; // add geography data @@ -515,7 +458,7 @@ function overviewBurgs(settings = {stateId: null, cultureId: null}) { data += b.temple ? "temple," : ","; data += b.shanty ? "shanty town," : ","; data += b.coa ? JSON.stringify(b.coa).replace(/"/g, "").replace(/,/g, ";") + "," : ","; - data += getBurgLink(b); + data += Burgs.getPreview(b).link; data += "\n"; }); @@ -593,17 +536,15 @@ function overviewBurgs(settings = {stateId: null, cultureId: null}) { title: `Remove ${number} burgs`, message: ` Are you sure you want to remove all unlocked burgs except for capitals? -
    To remove a capital you have to remove a state first`, +
    To remove a capital you have to remove its state first`, confirm: "Remove", - onConfirm: removeAllBurgs + onConfirm: () => { + pack.burgs.filter(b => b.i && !(b.capital || b.lock)).forEach(b => Burgs.remove(b.i)); + burgsOverviewAddLines(); + } }); } - function removeAllBurgs() { - pack.burgs.filter(b => b.i && !(b.capital || b.lock)).forEach(b => removeBurg(b.i)); - burgsOverviewAddLines(); - } - function toggleLockAll() { const activeBurgs = pack.burgs.filter(b => b.i && !b.removed); const allLocked = activeBurgs.every(burg => burg.lock); diff --git a/modules/ui/diplomacy-editor.js b/modules/ui/diplomacy-editor.js index 0f363b7b..f00bcda2 100644 --- a/modules/ui/diplomacy-editor.js +++ b/modules/ui/diplomacy-editor.js @@ -343,7 +343,7 @@ function editDiplomacy() { } function regenerateRelations() { - BurgsAndStates.generateDiplomacy(); + States.generateDiplomacy(); refreshDiplomacyEditor(); } diff --git a/modules/ui/editors.js b/modules/ui/editors.js index 3ebff350..77c391ee 100644 --- a/modules/ui/editors.js +++ b/modules/ui/editors.js @@ -128,308 +128,6 @@ function applySorting(headers) { .forEach(line => list.appendChild(line)); } -function addBurg(point) { - const {cells, states} = pack; - const x = rn(point[0], 2); - const y = rn(point[1], 2); - - const cellId = findCell(x, y); - const i = pack.burgs.length; - const culture = cells.culture[cellId]; - const name = Names.getCulture(culture); - const state = cells.state[cellId]; - const feature = cells.f[cellId]; - - const population = Math.max(cells.s[cellId] / 3 + i / 1000 + (cellId % 100) / 1000, 0.1); - const type = BurgsAndStates.getType(cellId, false); - - // generate emblem - const coa = COA.generate(states[state].coa, 0.25, null, type); - coa.shield = COA.getShield(culture, state); - COArenderer.add("burg", i, coa, x, y); - - const burg = { - name, - cell: cellId, - x, - y, - state, - i, - culture, - feature, - capital: 0, - port: 0, - temple: 0, - population, - coa, - type - }; - pack.burgs.push(burg); - cells.burg[cellId] = i; - - const townSize = burgIcons.select("#towns").attr("size") || 0.5; - burgIcons - .select("#towns") - .append("circle") - .attr("id", "burg" + i) - .attr("data-id", i) - .attr("cx", x) - .attr("cy", y) - .attr("r", townSize); - burgLabels - .select("#towns") - .append("text") - .attr("text-rendering", "optimizeSpeed") - .attr("id", "burgLabel" + i) - .attr("data-id", i) - .attr("x", x) - .attr("y", y) - .attr("dy", `${townSize * -1.5}px`) - .text(name); - - BurgsAndStates.defineBurgFeatures(burg); - - const newRoute = Routes.connect(cellId); - if (newRoute && layerIsOn("toggleRoutes")) { - routes - .select("#" + newRoute.group) - .append("path") - .attr("d", Routes.getPath(newRoute)) - .attr("id", "route" + newRoute.i); - } - - return i; -} - -function moveBurgToGroup(id, g) { - const label = document.querySelector("#burgLabels [data-id='" + id + "']"); - const icon = document.querySelector("#burgIcons [data-id='" + id + "']"); - const anchor = document.querySelector("#anchors [data-id='" + id + "']"); - if (!label || !icon) { - ERROR && console.error(`Cannot find label or icon elements for id ${id}`); - return; - } - - document.querySelector("#burgLabels > #" + g).appendChild(label); - document.querySelector("#burgIcons > #" + g).appendChild(icon); - - const iconSize = icon.parentNode.getAttribute("size"); - icon.setAttribute("r", iconSize); - label.setAttribute("dy", `${iconSize * -1.5}px`); - - if (anchor) { - document.querySelector("#anchors > #" + g).appendChild(anchor); - const anchorSize = +anchor.parentNode.getAttribute("size"); - anchor.setAttribute("width", anchorSize); - anchor.setAttribute("height", anchorSize); - anchor.setAttribute("x", rn(pack.burgs[id].x - anchorSize * 0.47, 2)); - anchor.setAttribute("y", rn(pack.burgs[id].y - anchorSize * 0.47, 2)); - } -} - -function moveAllBurgsToGroup(fromGroup, toGroup) { - const groupToMove = document.querySelector(`#burgIcons #${fromGroup}`); - const burgsToMove = Array.from(groupToMove.children).map(x => x.dataset.id); - addBurgsGroup(toGroup); - burgsToMove.forEach(x => moveBurgToGroup(x, toGroup)); -} - -function addBurgsGroup(group) { - if (document.querySelector(`#burgLabels > #${group}`)) return; - const labelCopy = document.querySelector("#burgLabels > #towns").cloneNode(false); - const iconCopy = document.querySelector("#burgIcons > #towns").cloneNode(false); - const anchorCopy = document.querySelector("#anchors > #towns").cloneNode(false); - - // FIXME: using the same id is against the spec! - document.querySelector("#burgLabels").appendChild(labelCopy).id = group; - document.querySelector("#burgIcons").appendChild(iconCopy).id = group; - document.querySelector("#anchors").appendChild(anchorCopy).id = group; -} - -function removeBurg(id) { - document.querySelector("#burgLabels [data-id='" + id + "']")?.remove(); - document.querySelector("#burgIcons [data-id='" + id + "']")?.remove(); - document.querySelector("#anchors [data-id='" + id + "']")?.remove(); - - const cells = pack.cells; - const burg = pack.burgs[id]; - - burg.removed = true; - cells.burg[burg.cell] = 0; - - const noteId = notes.findIndex(note => note.id === `burg${id}`); - if (noteId !== -1) notes.splice(noteId, 1); - - if (burg.coa) { - const coaId = "burgCOA" + id; - if (byId(coaId)) byId(coaId).remove(); - emblems.select(`#burgEmblems > use[data-i='${id}']`).remove(); - delete burg.coa; // remove to save data - } -} - -function toggleCapital(burgId) { - const {burgs, states} = pack; - if (burgs[burgId].capital) - return tip("To change capital please assign a capital status to another burg of this state", false, "error"); - - const stateId = burgs[burgId].state; - if (!stateId) return tip("Neutral lands cannot have a capital", false, "error"); - - const prevCapitalId = states[stateId].capital; - states[stateId].capital = burgId; - states[stateId].center = burgs[burgId].cell; - burgs[burgId].capital = 1; - burgs[prevCapitalId].capital = 0; - - moveBurgToGroup(burgId, "cities"); - moveBurgToGroup(prevCapitalId, "towns"); -} - -function togglePort(burg) { - const anchor = document.querySelector("#anchors [data-id='" + burg + "']"); - if (anchor) anchor.remove(); - const b = pack.burgs[burg]; - if (b.port) { - b.port = 0; - return; - } // not a port anymore - - const haven = pack.cells.haven[b.cell]; - const port = haven ? pack.cells.f[haven] : -1; - if (!haven) tip("Port haven is not found, system won't be able to make a searoute", false, "warn"); - b.port = port; - - const g = b.capital ? "cities" : "towns"; - const group = anchors.select("g#" + g); - const size = +group.attr("size"); - group - .append("use") - .attr("xlink:href", "#icon-anchor") - .attr("data-id", burg) - .attr("x", rn(b.x - size * 0.47, 2)) - .attr("y", rn(b.y - size * 0.47, 2)) - .attr("width", size) - .attr("height", size); -} - -function getBurgLink(burg) { - if (burg.link) return burg.link; - - const population = burg.population * populationRate * urbanization; - if (population >= options.villageMaxPopulation || burg.citadel || burg.walls || burg.temple || burg.shanty) - return createMfcgLink(burg); - - return createVillageGeneratorLink(burg); -} - -function createMfcgLink(burg) { - const {cells} = pack; - const {i, name, population: burgPopulation, cell} = burg; - const burgSeed = burg.MFCG || seed + String(burg.i).padStart(4, 0); - - const sizeRaw = 2.13 * Math.pow((burgPopulation * populationRate) / urbanDensity, 0.385); - const size = minmax(Math.ceil(sizeRaw), 6, 100); - const population = rn(burgPopulation * populationRate * urbanization); - - const river = cells.r[cell] ? 1 : 0; - const coast = Number(burg.port > 0); - const sea = (() => { - if (!coast || !cells.haven[cell]) return null; - - // calculate see direction: 0 = south, 0.5 = west, 1 = north, 1.5 = east - const p1 = cells.p[cell]; - const p2 = cells.p[cells.haven[cell]]; - let deg = (Math.atan2(p2[1] - p1[1], p2[0] - p1[0]) * 180) / Math.PI - 90; - if (deg < 0) deg += 360; - return rn(normalize(deg, 0, 360) * 2, 2); - })(); - - const arableBiomes = river ? [1, 2, 3, 4, 5, 6, 7, 8] : [5, 6, 7, 8]; - const farms = +arableBiomes.includes(cells.biome[cell]); - - const citadel = +burg.citadel; - const urban_castle = +(citadel && each(2)(i)); - - const hub = Routes.isCrossroad(cell); - const walls = +burg.walls; - const plaza = +burg.plaza; - const temple = +burg.temple; - const shantytown = +burg.shanty; - - const url = new URL("https://watabou.github.io/city-generator/"); - url.search = new URLSearchParams({ - name, - population, - size, - seed: burgSeed, - river, - coast, - farms, - citadel, - urban_castle, - hub, - plaza, - temple, - walls, - shantytown, - gates: -1 - }); - if (sea) url.searchParams.append("sea", sea); - - return url.toString(); -} - -function createVillageGeneratorLink(burg) { - const {cells, features} = pack; - const {i, population, cell} = burg; - - const pop = rn(population * populationRate * urbanization); - const burgSeed = seed + String(i).padStart(4, 0); - const tags = []; - - if (cells.r[cell] && cells.haven[cell]) tags.push("estuary"); - else if (cells.haven[cell] && features[cells.f[cell]].cells === 1) tags.push("island,district"); - else if (burg.port) tags.push("coast"); - else if (cells.conf[cell]) tags.push("confluence"); - else if (cells.r[cell]) tags.push("river"); - else if (pop < 200 && each(4)(cell)) tags.push("pond"); - - const roadsNumber = Object.values(pack.cells.routes[cell] || {}).filter(routeId => { - const route = pack.routes.find(route => route.i === routeId); - if (!route) return false; - return route.group === "roads" || route.group === "trails"; - }).length; - tags.push(roadsNumber > 1 ? "highway" : roadsNumber === 1 ? "dead end" : "isolated"); - - const biome = cells.biome[cell]; - const arableBiomes = cells.r[cell] ? [1, 2, 3, 4, 5, 6, 7, 8] : [5, 6, 7, 8]; - if (!arableBiomes.includes(biome)) tags.push("uncultivated"); - else if (each(6)(cell)) tags.push("farmland"); - - const temp = grid.cells.temp[cells.g[cell]]; - if (temp <= 0 || temp > 28 || (temp > 25 && each(3)(cell))) tags.push("no orchards"); - - if (!burg.plaza) tags.push("no square"); - - if (pop < 100) tags.push("sparse"); - else if (pop > 300) tags.push("dense"); - - const width = (() => { - if (pop > 1500) return 1600; - if (pop > 1000) return 1400; - if (pop > 500) return 1000; - if (pop > 200) return 800; - if (pop > 100) return 600; - return 400; - })(); - const height = rn(width / 2.2); - - const url = new URL("https://watabou.github.io/village-generator/"); - url.search = new URLSearchParams({pop, name: "", seed: burgSeed, width, height, tags}); - return url.toString(); -} - // draw legend box function drawLegend(name, data) { legend.selectAll("*").remove(); // fully redraw every time diff --git a/modules/ui/general.js b/modules/ui/general.js index 6e276bd6..ce285287 100644 --- a/modules/ui/general.js +++ b/modules/ui/general.js @@ -167,7 +167,7 @@ function showMapTooltip(point, e, i, g) { if (burgId) { const burg = pack.burgs[burgId]; const population = si(burg.population * populationRate * urbanization); - tip(`${burg.name}. Population: ${population}. Click to edit`); + tip(`${burg.name} ${burg.group}. Population: ${population}. Click to edit`); if (burgsOverview?.offsetParent) highlightEditorLine(burgsOverview, burgId, 5000); return; } diff --git a/modules/ui/heightmap-editor.js b/modules/ui/heightmap-editor.js index 20fa201c..f49f9a73 100644 --- a/modules/ui/heightmap-editor.js +++ b/modules/ui/heightmap-editor.js @@ -238,18 +238,22 @@ function editHeightmap(options) { } Biomes.define(); - rankCells(); + rankCells(); Cultures.generate(); Cultures.expand(); - BurgsAndStates.generate(); + Burgs.generate(); + States.generate(); Routes.generate(); Religions.generate(); - BurgsAndStates.defineStateForms(); + + Burgs.specify(); + States.collectStatistics(); + States.defineStateForms(); + Provinces.generate(); Provinces.getPoles(); - BurgsAndStates.defineBurgFeatures(); Rivers.specify(); Features.specify(); @@ -405,7 +409,7 @@ function editHeightmap(options) { b.feature = pack.cells.f[b.cell]; pack.cells.burg[b.cell] = b.i; - if (!b.capital && pack.cells.h[b.cell] < 20) removeBurg(b.i); + if (!b.capital && pack.cells.h[b.cell] < 20) Burgs.remove(b.i); if (b.capital) pack.states[b.state].center = b.cell; } diff --git a/modules/ui/layers.js b/modules/ui/layers.js index a1e3b503..5037a5ee 100644 --- a/modules/ui/layers.js +++ b/modules/ui/layers.js @@ -845,6 +845,14 @@ function drawRoutes() { TIME && console.timeEnd("drawRoutes"); } +function drawRoute(route) { + routes + .select("#" + route.group) + .append("path") + .attr("d", Routes.getPath(route)) + .attr("id", "route" + route.i); +} + function toggleMilitary(event) { if (!layerIsOn("toggleMilitary")) { turnButtonOn("toggleMilitary"); diff --git a/modules/ui/military-overview.js b/modules/ui/military-overview.js index 1a916f7a..9518ef61 100644 --- a/modules/ui/military-overview.js +++ b/modules/ui/military-overview.js @@ -381,14 +381,17 @@ function overviewMilitary() { const filtered = data.filter(datum => datum.i && !datum.removed); const lines = filtered.map( - ({i, name, fullName, color}) => - `⬤ - - - ` + ({i, name, fullName, color}) => /* html */ ` + + ⬤ + + + + + ` ); + alertMessage.innerHTML = /* html */ `Limit unit by ${type}: @@ -398,7 +401,7 @@ function overviewMilitary() { $("#alert").dialog({ width: fitContent(), - title: `Limit unit`, + title: "Limit unit", buttons: { Invert: function () { alertMessage.querySelectorAll("input").forEach(el => (el.checked = !el.checked)); @@ -427,7 +430,7 @@ function overviewMilitary() { function applyMilitaryOptions() { const unitLines = Array.from(tableBody.querySelectorAll("tr")); - const names = unitLines.map(r => r.querySelector("input").value.replace(/[&\/\\#, +()$~%.'":*?<>{}]/g, "_")); + const names = unitLines.map(r => sanitizeId(r.querySelector("input").value)); if (new Set(names).size !== names.length) return tip("All units should have unique names", false, "error"); $("#militaryOptions").dialog("close"); diff --git a/modules/ui/options.js b/modules/ui/options.js index 537a6a4e..551a78e6 100644 --- a/modules/ui/options.js +++ b/modules/ui/options.js @@ -392,7 +392,7 @@ function changeEmblemShape(emblemShape) { function changeStatesNumber(value) { byId("statesNumber").style.color = +value ? null : "#b12117"; - burgLabels.select("#capitals").attr("data-size", Math.max(rn(6 - value / 20), 3)); + burgLabels.select("#capital").attr("data-size", Math.max(rn(6 - value / 20), 3)); labels.select("#countries").attr("data-size", Math.max(rn(18 - value / 6), 4)); } @@ -1051,7 +1051,7 @@ function toggle3dOptions() { byId("options3dMeshSky").addEventListener("input", changeColors); byId("options3dMeshWater").addEventListener("input", changeColors); byId("options3dGlobeResolution").addEventListener("change", changeResolution); - // byId("options3dMeshWireframeMode").addEventListener("change",toggleWireframe3d); + byId("options3dMeshWireframeMode").addEventListener("change", toggleWireframe3d); byId("options3dSunColor").addEventListener("input", changeSunColor); byId("options3dSubdivide").addEventListener("change", toggle3dSubdivision); @@ -1116,9 +1116,9 @@ function toggle3dOptions() { ThreeD.toggle3dSubdivision(); } - // function toggleWireframe3d() { - // ThreeD.toggleWireframe(); - // } + function toggleWireframe3d() { + ThreeD.toggleWireframe(); + } function toggleSkyMode() { const hide = ThreeD.options.extendedWater; diff --git a/modules/ui/provinces-editor.js b/modules/ui/provinces-editor.js index 69707b95..35121b94 100644 --- a/modules/ui/provinces-editor.js +++ b/modules/ui/provinces-editor.js @@ -296,8 +296,9 @@ function editProvinces() { const newStateId = states.length; // turn province burg into a capital - burgs[burgId].capital = 1; - moveBurgToGroup(burgId, "cities"); + const capital = burgs[burgId]; + capital.capital = 1; + Burgs.changeGroup(capital); // move all burgs to a new state province.burgs.forEach(b => (burgs[b].state = newStateId)); @@ -367,9 +368,14 @@ function editProvinces() { function updateStatesPostRelease(oldStates, newStates) { const allStates = unique([...oldStates, ...newStates]); - BurgsAndStates.getPoles(); - BurgsAndStates.collectStatistics(); - BurgsAndStates.defineStateForms(newStates); + layerIsOn("toggleProvinces") && toggleProvinces(); + layerIsOn("toggleStates") ? drawStates() : toggleStates(); + layerIsOn("toggleBorders") ? drawBorders() : toggleBorders(); + + States.getPoles(); + States.findNeighbors(); + States.collectStatistics(); + States.defineStateForms(newStates); drawStateLabels(allStates); // redraw emblems @@ -1032,7 +1038,7 @@ function editProvinces() { // generate emblem const kinship = burg ? 0.8 : 0.4; const parent = burg ? pack.burgs[burg].coa : pack.states[state].coa; - const type = BurgsAndStates.getType(center, parent.port); + const type = Burgs.getType(center, parent.port); const coa = COA.generate(parent, kinship, P(0.1), type); coa.shield = COA.getShield(c, state); COArenderer.add("province", province, coa, point[0], point[1]); diff --git a/modules/ui/style-presets.js b/modules/ui/style-presets.js index 01626205..f1b6b167 100644 --- a/modules/ui/style-presets.js +++ b/modules/ui/style-presets.js @@ -71,24 +71,35 @@ async function fetchSystemPreset(preset) { } } -function applyStyle(style) { - for (const selector in style) { +function applyStyle(styleJSON) { + for (const selector in styleJSON) { + if (selector.startsWith("#burgLabels")) { + const group = selector.split("#").pop(); + style.burgLabels[group] = styleJSON[selector]; + } + + if (selector.startsWith("#burgIcons")) { + const group = selector.split("#").pop(); + style.burgIcons[group] = styleJSON[selector]; + } + + if (selector.startsWith("#anchors")) { + const group = selector.split("#").pop(); + style.anchors[group] = styleJSON[selector]; + } + const el = document.querySelector(selector); if (!el) continue; - for (const attribute in style[selector]) { - const value = style[selector][attribute]; + for (const attribute in styleJSON[selector]) { + const value = styleJSON[selector][attribute]; if (value === "null" || value === null) { el.removeAttribute(attribute); continue; } - if (attribute === "text-shadow") { - el.style[attribute] = value; - } else { - el.setAttribute(attribute, value); - } + el.setAttribute(attribute, value); if (selector === "#texture") { const image = document.querySelector("#texture > image"); @@ -130,6 +141,11 @@ async function changeStyle(desiredPreset) { const [presetName, style] = styleData; localStorage.setItem("presetStyle", presetName); applyStyleWithUiRefresh(style); + if (layerIsOn("toggleBurgIcons")) drawBurgIcons(); + if (layerIsOn("toggleLabels")) { + drawBurgLabels(); + drawStateLabels(); + } } function applyStyleWithUiRefresh(style) { @@ -271,52 +287,12 @@ function addStylePreset() { "data-columns" ], "#legendBox": ["fill", "fill-opacity"], - "#burgLabels > #cities": [ - "opacity", - "fill", - "text-shadow", - "letter-spacing", - "data-size", - "font-size", - "font-family" - ], - "#burgIcons > #cities": [ - "opacity", - "fill", - "fill-opacity", - "size", - "stroke", - "stroke-width", - "stroke-dasharray", - "stroke-linecap" - ], - "#anchors > #cities": ["opacity", "fill", "size", "stroke", "stroke-width"], - "#burgLabels > #towns": [ - "opacity", - "fill", - "text-shadow", - "letter-spacing", - "data-size", - "font-size", - "font-family" - ], - "#burgIcons > #towns": [ - "opacity", - "fill", - "fill-opacity", - "size", - "stroke", - "stroke-width", - "stroke-dasharray", - "stroke-linecap" - ], - "#anchors > #towns": ["opacity", "fill", "size", "stroke", "stroke-width"], "#labels > #states": [ "opacity", "fill", "stroke", "stroke-width", - "text-shadow", + "style", "letter-spacing", "data-size", "font-size", @@ -328,7 +304,7 @@ function addStylePreset() { "fill", "stroke", "stroke-width", - "text-shadow", + "style", "letter-spacing", "data-size", "font-size", @@ -352,6 +328,39 @@ function addStylePreset() { ] }; + const burgLabelsAttributes = [ + "opacity", + "fill", + "stroke", + "stroke-width", + "style", + "letter-spacing", + "data-size", + "font-size", + "font-family", + "data-dx", + "data-dy" + ]; + const burgIconsAttributes = [ + "opacity", + "data-icon", + "font-size", + "fill", + "fill-opacity", + "stroke", + "stroke-width", + "stroke-dasharray", + "stroke-linecap", + "stroke-linejoin", + "filter" + ]; + const anchorsAttributes = ["opacity", "fill", "font-size", "stroke", "stroke-width", "filter"]; + options.burgs.groups.forEach(({name}) => { + attributes[`#burgLabels > g#${name}`] = burgLabelsAttributes; + attributes[`#burgIcons > g#${name}`] = burgIconsAttributes; + attributes[`#anchors > g#${name}`] = anchorsAttributes; + }); + for (const selector in attributes) { const el = document.querySelector(selector); if (!el) continue; diff --git a/modules/ui/style.js b/modules/ui/style.js index d8f16ad7..16d94b5c 100644 --- a/modules/ui/style.js +++ b/modules/ui/style.js @@ -248,6 +248,16 @@ function selectStyleElement() { styleStatesHaloBlur.value = parseFloat(statesHalo.attr("filter")?.match(/blur\(([^)]+)\)/)?.[1]) || 0; } + if (styleElement === "provs") { + styleFill.style.display = "block"; + styleSize.style.display = "block"; + styleFillInput.value = styleFillOutput.value = el.attr("fill") || "#111111"; + + styleFont.style.display = "block"; + styleSelectFont.value = el.attr("font-family"); + styleFontSize.value = el.attr("font-size"); + } + if (styleElement === "labels") { styleFill.style.display = "block"; styleStroke.style.display = "block"; @@ -261,46 +271,46 @@ function selectStyleElement() { styleStrokeInput.value = styleStrokeOutput.value = el.attr("stroke") || "#3a3a3a"; styleStrokeWidthInput.value = el.attr("stroke-width") || 0; styleLetterSpacingInput.value = el.attr("letter-spacing") || 0; - styleShadowInput.value = el.style("text-shadow") || "white 0 0 4px"; + styleShadowInput.value = el.style("text-shadow") || ""; styleFont.style.display = "block"; styleSelectFont.value = el.attr("font-family"); styleFontSize.value = el.attr("data-size"); + + if (el.node().parentNode.id === "burgLabels") { + styleFontShift.style.display = "block"; + styleFontShiftX.value = el.attr("data-dx") || 0; + styleFontShiftY.value = el.attr("data-dy") || 0; + } } - if (styleElement === "provs") { - styleFill.style.display = "block"; - styleSize.style.display = "block"; - styleFillInput.value = styleFillOutput.value = el.attr("fill") || "#111111"; + if (styleElement === "burgIcons") { + styleBurgIcons.style.display = "block"; + styleBurgIconsIcon.value = el.attr("data-icon"); + styleBurgIconsIconSize.value = el.attr("font-size"); + styleBurgIconsStrokeLinejoin.value = el.attr("stroke-linejoin"); + styleBurgIconsFillOpacity.value = el.attr("fill-opacity"); - styleFont.style.display = "block"; - styleSelectFont.value = el.attr("font-family"); - styleFontSize.value = el.attr("font-size"); - } - - if (styleElement == "burgIcons") { styleFill.style.display = "block"; styleStroke.style.display = "block"; styleStrokeWidth.style.display = "block"; styleStrokeDash.style.display = "block"; - styleRadius.style.display = "block"; styleFillInput.value = styleFillOutput.value = el.attr("fill") || "#ffffff"; styleStrokeInput.value = styleStrokeOutput.value = el.attr("stroke") || "#3e3e4b"; styleStrokeWidthInput.value = el.attr("stroke-width") || 0.24; styleStrokeDasharrayInput.value = el.attr("stroke-dasharray") || ""; styleStrokeLinecapInput.value = el.attr("stroke-linecap") || "inherit"; - styleRadiusInput.value = el.attr("size") || 1; } - if (styleElement == "anchors") { + if (styleElement === "anchors") { styleFill.style.display = "block"; styleStroke.style.display = "block"; styleStrokeWidth.style.display = "block"; - styleIconSize.style.display = "block"; + styleSize.style.display = "block"; styleFillInput.value = styleFillOutput.value = el.attr("fill") || "#ffffff"; styleStrokeInput.value = styleStrokeOutput.value = el.attr("stroke") || "#3e3e4b"; styleStrokeWidthInput.value = el.attr("stroke-width") || 0.24; - styleIconSizeInput.value = el.attr("size") || 2; + styleFontSize.value = el.attr("font-size") || 1; } if (styleElement === "legend") { @@ -758,6 +768,22 @@ stylePopulationUrbanStrokeInput.on("input", e => { stylePopulationUrbanStrokeOutput.value = e.target.value; }); +styleBurgIconsIcon.on("change", e => { + getEl().attr("data-icon", e.target.value).selectAll("use").attr("href", e.target.value); +}); + +styleBurgIconsIconSize.on("input", e => { + getEl().attr("font-size", e.target.value); +}); + +styleBurgIconsStrokeLinejoin.on("change", e => { + getEl().attr("stroke-linejoin", e.target.value); +}); + +styleBurgIconsFillOpacity.on("input", e => { + getEl().attr("fill-opacity", e.target.value); +}); + styleCompassSizeInput.on("input", shiftCompass); styleCompassShiftX.on("input", shiftCompass); styleCompassShiftY.on("input", shiftCompass); @@ -840,12 +866,12 @@ styleFontSize.on("change", function () { styleFontPlus.on("click", function () { const current = +styleFontSize.value || 12; - changeFontSize(getEl(), Math.min(current + 1, 999)); + changeFontSize(getEl(), Math.min(rn(current + 0.1, 1), 999)); }); styleFontMinus.on("click", function () { const current = +styleFontSize.value || 12; - changeFontSize(getEl(), Math.max(current - 1, 1)); + changeFontSize(getEl(), Math.max(rn(current - 0.1, 1), 0.1)); }); function changeFontSize(el, size) { @@ -866,71 +892,20 @@ function changeFontSize(el, size) { if (styleElementSelect.value === "legend") redrawLegend(); } -styleRadiusInput.on("change", function () { - changeRadius(+this.value); -}); - -styleRadiusPlus.on("click", function () { - const size = Math.max(rn(getEl().attr("size") * 1.1, 2), 0.2); - changeRadius(size); -}); - -styleRadiusMinus.on("click", function () { - const size = Math.max(rn(getEl().attr("size") * 0.9, 2), 0.2); - changeRadius(size); -}); - -function changeRadius(size, group) { - const el = group ? burgIcons.select("#" + group) : getEl(); - const g = el.attr("id"); - el.attr("size", size); - el.selectAll("circle").each(function () { - this.setAttribute("r", size); - }); - styleRadiusInput.value = size; - burgLabels - .select("g#" + g) +styleFontShiftX.on("input", e => { + getEl() + .attr("data-dx", e.target.value) .selectAll("text") - .each(function () { - this.setAttribute("dy", `${size * -1.5}px`); - }); - changeIconSize(size * 2, g); // change also anchor icons -} - -styleIconSizeInput.on("change", function () { - changeIconSize(+this.value); + .attr("dx", e.target.value + "em"); }); -styleIconSizePlus.on("click", function () { - const size = Math.max(rn(getEl().attr("size") * 1.1, 2), 0.2); - changeIconSize(size); +styleFontShiftY.on("input", e => { + getEl() + .attr("data-dy", e.target.value) + .selectAll("text") + .attr("dy", e.target.value + "em"); }); -styleIconSizeMinus.on("click", function () { - const size = Math.max(rn(getEl().attr("size") * 0.9, 2), 0.2); - changeIconSize(size); -}); - -function changeIconSize(size, group) { - const el = group ? anchors.select("#" + group) : getEl(); - if (!el.size()) { - console.warn(`Group ${group} not found. Can not set icon size!`); - return; - } - const oldSize = +el.attr("size"); - const shift = (size - oldSize) / 2; - el.attr("size", size); - el.selectAll("use").each(function () { - const x = +this.getAttribute("x"); - const y = +this.getAttribute("y"); - this.setAttribute("x", x - shift); - this.setAttribute("y", y - shift); - this.setAttribute("width", size); - this.setAttribute("height", size); - }); - styleIconSizeInput.value = size; -} - styleStatesBodyOpacity.on("input", e => { statesBody.attr("opacity", e.target.value); }); @@ -1133,39 +1108,6 @@ styleScaleBar.on("input", function (event) { }); function updateElements() { - // burgIcons to desired size - burgIcons.selectAll("g").each(function () { - const size = +this.getAttribute("size"); - d3.select(this) - .selectAll("circle") - .each(function () { - this.setAttribute("r", size); - }); - burgLabels - .select("g#" + this.id) - .selectAll("text") - .each(function () { - this.setAttribute("dy", `${size * -1.5}px`); - }); - }); - - // anchor icons to desired size - anchors.selectAll("g").each(function (d) { - const size = +this.getAttribute("size"); - d3.select(this) - .selectAll("use") - .each(function () { - const id = +this.dataset.id; - const x = pack.burgs[id].x, - y = pack.burgs[id].y; - this.setAttribute("x", rn(x - size * 0.47, 2)); - this.setAttribute("y", rn(y - size * 0.47, 2)); - this.setAttribute("width", size); - this.setAttribute("height", size); - }); - }); - - // redraw elements if (layerIsOn("toggleHeight")) drawHeightmap(); if (legend.selectAll("*").size() && window.redrawLegend) redrawLegend(); oceanLayers.selectAll("path").remove(); diff --git a/modules/ui/submap-tool.js b/modules/ui/submap-tool.js index 1c992b7a..d1d7a312 100644 --- a/modules/ui/submap-tool.js +++ b/modules/ui/submap-tool.js @@ -82,10 +82,11 @@ function openSubmapTool() { function rescaleBurgStyles(scale) { const burgIcons = [...byId("burgIcons").querySelectorAll("g")]; for (const group of burgIcons) { - const newRadius = rn(minmax(group.getAttribute("size") * scale, 0.2, 10), 2); - changeRadius(newRadius, group.id); - const strokeWidth = group.attributes["stroke-width"]; - strokeWidth.value = strokeWidth.value * scale; + const newSize = rn(minmax(group.getAttribute("size") * scale, 0.2, 10), 2); + group.setAttribute("font-size", newSize); + + const newStroke = rn(group.getAttribute("stroke-width") * scale, 2); + group.setAttribute("stroke-width", newStroke); } const burgLabels = [...byId("burgLabels").querySelectorAll("g")]; diff --git a/modules/ui/tools.js b/modules/ui/tools.js index 22c1aec8..5a170026 100644 --- a/modules/ui/tools.js +++ b/modules/ui/tools.js @@ -154,14 +154,16 @@ function regenerateStates() { if (!newStates) return; pack.states = newStates; - BurgsAndStates.expandStates(); - BurgsAndStates.normalizeStates(); - BurgsAndStates.getPoles(); - BurgsAndStates.collectStatistics(); - BurgsAndStates.assignColors(); - BurgsAndStates.generateCampaigns(); - BurgsAndStates.generateDiplomacy(); - BurgsAndStates.defineStateForms(); + States.expandStates(); + States.normalize(); + States.getPoles(); + States.findNeighbors(); + States.collectStatistics(); + States.assignColors(); + States.generateCampaigns(); + States.generateDiplomacy(); + States.defineStateForms(); + Provinces.generate(true); Provinces.getPoles(); @@ -209,13 +211,13 @@ function recreateStates() { return null; } - // turn all old capitals into towns, except for the capitals of locked states + // turn all old capitals into town, except for the capitals of locked states for (const burg of validBurgs) { - if (!burg.capital) continue; - if (lockedStatesCapitals.includes(burg.i)) continue; - - moveBurgToGroup(burg.i, "towns"); - burg.capital = 0; + if (burg.capital) { + if (lockedStatesCapitals.includes(burg.i)) continue; + burg.capital = 0; + Burgs.changeGroup(burg); + } } // remove labels and emblems for non-locked states @@ -302,7 +304,7 @@ function recreateStates() { burg.capital = 1; capital = burg; capitalsTree.add([x, y]); - moveBurgToGroup(burg.i, "cities"); + Burgs.changeGroup(capital); break; } @@ -400,7 +402,7 @@ function regenerateBurgs() { const burgsCount = (manorsInput.value === "1000" ? rn(sorted.length / 5 / (grid.points.length / 10000) ** 0.8) : +manorsInput.value) + existingStatesCount; - const spacing = (graphWidth + graphHeight) / 150 / (burgsCount ** 0.7 / 66); // base min distance between towns + const spacing = (graphWidth + graphHeight) / 150 / (burgsCount ** 0.7 / 66); // base min distance between town for (let i = 0; i < sorted.length && newBurgs.length < burgsCount; i++) { const id = newBurgs.length; @@ -431,20 +433,21 @@ function regenerateBurgs() { .filter(s => s.i && !s.removed && !s.capital) .forEach(s => { const [x, y] = cells.p[s.center]; - const burgId = addBurg([x, y]); + const burgId = Burgs.add([x, y]); s.capital = burgId; s.center = pack.burgs[burgId].cell; - pack.burgs[burgId].capital = 1; - pack.burgs[burgId].state = s.i; - moveBurgToGroup(burgId, "cities"); + + const burg = pack.burgs[burgId]; + burg.state = s.i; + burg.capital = 1; + Burgs.changeGroup(burg); }); features.forEach(f => { if (f.port) f.port = 0; // reset features ports counter }); - BurgsAndStates.specifyBurgs(); - BurgsAndStates.defineBurgFeatures(); + Burgs.specify(); regenerateRoutes(); drawBurgIcons(); @@ -503,7 +506,7 @@ function regenerateEmblems() { const nameByBurg = province.burg && province.name.slice(0, 3) === parent.name.slice(0, 3); const kinship = dominion ? 0 : nameByBurg ? 0.8 : 0.4; const culture = pack.cells.culture[province.center]; - const type = BurgsAndStates.getType(province.center, parent.port); + const type = Burgs.getType(province.center, parent.port); province.coa = COA.generate(parent.coa, kinship, dominion, type); province.coa.shield = COA.getShield(culture, province.state); }); @@ -521,8 +524,24 @@ function regenerateReligions() { function regenerateCultures() { Cultures.generate(); Cultures.expand(); - BurgsAndStates.updateCultures(); - Religions.updateCultures(); + + // update culture for states + pack.states = pack.states.map(state => { + if (!state.i || state.removed) return state; + return {...state, culture: pack.cells.culture[state.center]}; + }); + + // update culture for burgs + pack.burgs = pack.burgs.map(burg => { + if (!burg.i || burg.removed) return burg; + return {...burg, culture: pack.cells.culture[burg.cell]}; + }); + + // update culture for religions + pack.religions = pack.religions.map(religion => { + if (!religion.i || religion.removed) return religion; + return {...religion, culture: pack.cells.culture[religion.center]}; + }); layerIsOn("toggleCultures") ? drawCultures() : toggleCultures(); refreshAllEditors(); diff --git a/styles/ancient.json b/styles/ancient.json index d57aa524..d6ed402c 100644 --- a/styles/ancient.json +++ b/styles/ancient.json @@ -162,11 +162,11 @@ "filter": null }, "#sea_island": { - "opacity": 0.5, - "stroke": "#1f3846", - "stroke-width": 0.7, - "filter": "url(#dropShadow)", - "auto-filter": 1 + "opacity": 1, + "stroke": "#c1a884", + "stroke-width": 0.3, + "filter": "none", + "auto-filter": 0 }, "#lake_island": { "opacity": 1, @@ -194,7 +194,7 @@ "#roads": { "opacity": 0.7, "stroke": "#8d502a", - "stroke-width": 1, + "stroke-width": 0.8, "stroke-dasharray": 3, "stroke-linecap": "inherit", "filter": "", @@ -202,7 +202,7 @@ }, "#trails": { "opacity": 0.7, - "stroke": "#924217", + "stroke": "#8d502a", "stroke-width": 0.5, "stroke-dasharray": "1 2", "stroke-linecap": "butt", @@ -211,16 +211,14 @@ }, "#searoutes": { "opacity": 0.8, - "stroke": "#b16925", - "stroke-width": 0.8, - "stroke-dasharray": "1 2", - "stroke-linecap": "round", - "filter": null, - "mask": null + "stroke": "#aa7658", + "stroke-width": 0.6, + "stroke-dasharray": "2 2", + "stroke-linecap": "butt" }, "#statesBody": { "opacity": 0.2, - "filter": "url(#filter-sepia)" + "filter": null }, "#statesHalo": { "opacity": 0.4, @@ -328,64 +326,282 @@ "data-y": 93, "data-columns": 8 }, - "#burgLabels > #cities": { - "opacity": 1, + "#burgLabels > g#capital": { + "opacity": 0.9, "fill": "#3e3e4b", - "text-shadow": "white 0px 0px 4px", + "style": "text-shadow: white 0px 0px 4px", "letter-spacing": 0, - "data-size": 12, - "font-size": 12, - "font-family": "Great Vibes" + "data-size": 6, + "font-size": 6, + "font-family": "UnifrakturMaguntia", + "data-dy": 0.85 }, - "#burgIcons > #cities": { + "#burgIcons > g#capital": { + "data-icon": "#icon-watabou-capital", "opacity": 1, - "fill": "#fdfab9", - "fill-opacity": 0.7, - "size": 1, - "stroke": "#6f4e1f", - "stroke-width": 0.3, - "stroke-dasharray": ".3 .4", - "stroke-linecap": "butt" + "fill": "#E59189", + "fill-opacity": 1, + "font-size": 2, + "stroke": "#4D3F36", + "stroke-width": 1.4, + "stroke-dasharray": null, + "stroke-linecap": "round", + "stroke-linejoin": "round", + "filter": null }, - "#anchors > #cities": { + "#anchors > g#capital": { "opacity": 1, - "fill": "#ffffff", - "size": 2, - "stroke": "#3e3e4b", - "stroke-width": 1.2 + "fill": "#EBE8DF", + "font-size": 1.5, + "stroke": "#4D3F36", + "stroke-width": 1 }, - "#burgLabels > #towns": { - "opacity": 1, + "#burgLabels > g#city": { + "opacity": 0.9, "fill": "#3e3e4b", - "text-shadow": "white 0px 0px 4px", + "style": "text-shadow: white 0px 0px 4px", "letter-spacing": 0, "data-size": 5, "font-size": 5, - "font-family": "Great Vibes" + "font-family": "UnifrakturMaguntia", + "data-dy": 0.85 }, - "#burgIcons > #towns": { + "#burgIcons > g#city": { + "data-icon": "#icon-watabou-city", "opacity": 1, - "fill": "#fef4d8", - "fill-opacity": 0.7, - "size": 0.5, - "stroke": "#72472c", - "stroke-width": 0.12, - "stroke-dasharray": "", - "stroke-linecap": "butt" + "fill": "#E59189", + "fill-opacity": 1, + "font-size": 2, + "stroke": "#4D3F36", + "stroke-width": 1.4, + "stroke-dasharray": null, + "stroke-linecap": "round", + "stroke-linejoin": "round", + "filter": null }, - "#anchors > #towns": { + "#anchors > g#city": { "opacity": 1, - "fill": "#ffffff", - "size": 1, - "stroke": "#3e3e4b", - "stroke-width": 1.2 + "fill": "#EBE8DF", + "font-size": 1.5, + "stroke": "#4D3F36", + "stroke-width": 1 + }, + "#burgLabels > g#fort": { + "opacity": 0.9, + "fill": "#3e3e4b", + "style": "text-shadow: white 0px 0px 4px", + "letter-spacing": 0, + "data-size": 3, + "font-size": 3, + "font-family": "UnifrakturMaguntia", + "data-dy": 0.85 + }, + "#burgIcons > g#fort": { + "data-icon": "#icon-watabou-fort", + "opacity": 1, + "fill": "#E59189", + "fill-opacity": 1, + "font-size": 2, + "stroke": "#4D3F36", + "stroke-width": 1.8, + "stroke-dasharray": null, + "stroke-linecap": "round", + "stroke-linejoin": "round", + "filter": null + }, + "#anchors > g#fort": { + "opacity": 1, + "fill": "#EBE8DF", + "font-size": 1, + "stroke": "#4D3F36", + "stroke-width": 1 + }, + "#burgLabels > g#monastery": { + "opacity": 0.9, + "fill": "#3e3e4b", + "style": "text-shadow: white 0px 0px 4px", + "letter-spacing": 0, + "data-size": 2, + "font-size": 2, + "font-family": "UnifrakturMaguntia", + "data-dy": 0.85 + }, + "#burgIcons > g#monastery": { + "data-icon": "#icon-watabou-monastery", + "opacity": 1, + "fill": "#E59189", + "fill-opacity": 1, + "font-size": 2, + "stroke": "#4D3F36", + "stroke-width": 1.4, + "stroke-dasharray": null, + "stroke-linecap": "round", + "stroke-linejoin": "round", + "filter": null + }, + "#anchors > g#monastery": { + "opacity": 1, + "fill": "#EBE8DF", + "font-size": 1, + "stroke": "#4D3F36", + "stroke-width": 1 + }, + "#burgLabels > g#caravanserai": { + "opacity": 0.9, + "fill": "#3e3e4b", + "style": "text-shadow: white 0px 0px 4px", + "letter-spacing": 0, + "data-size": 2, + "font-size": 2, + "font-family": "UnifrakturMaguntia", + "data-dy": 0.85 + }, + "#burgIcons > g#caravanserai": { + "data-icon": "#icon-watabou-caravanserai", + "opacity": 1, + "fill": "#E59189", + "fill-opacity": 1, + "font-size": 2, + "stroke": "#4D3F36", + "stroke-width": 1.4, + "stroke-dasharray": null, + "stroke-linecap": "round", + "stroke-linejoin": "round", + "filter": null + }, + "#anchors > g#caravanserai": { + "opacity": 1, + "fill": "#EBE8DF", + "font-size": 1, + "stroke": "#4D3F36", + "stroke-width": 1 + }, + "#burgLabels > g#trading_post": { + "opacity": 0.9, + "fill": "#3e3e4b", + "style": "text-shadow: white 0px 0px 4px", + "letter-spacing": 0, + "data-size": 2, + "font-size": 2, + "font-family": "UnifrakturMaguntia", + "data-dy": 0.85 + }, + "#burgIcons > g#trading_post": { + "data-icon": "#icon-watabou-post", + "opacity": 1, + "fill": "#E59189", + "fill-opacity": 1, + "font-size": 2, + "stroke": "#4D3F36", + "stroke-width": 1.4, + "stroke-dasharray": null, + "stroke-linecap": "round", + "stroke-linejoin": "round", + "filter": null + }, + "#anchors > g#trading_post": { + "opacity": 1, + "fill": "#EBE8DF", + "font-size": 1, + "stroke": "#4D3F36", + "stroke-width": 1 + }, + "#burgLabels > g#village": { + "opacity": 0.9, + "fill": "#3e3e4b", + "style": "text-shadow: white 0px 0px 4px", + "letter-spacing": 0, + "data-size": 3, + "font-size": 3, + "font-family": "UnifrakturMaguntia", + "data-dy": 0.85 + }, + "#burgIcons > g#village": { + "data-icon": "#icon-watabou-village", + "opacity": 1, + "fill": "#E59189", + "fill-opacity": 1, + "font-size": 2, + "stroke": "#4D3F36", + "stroke-width": 1.4, + "stroke-dasharray": null, + "stroke-linecap": "round", + "stroke-linejoin": "round", + "filter": null + }, + "#anchors > g#village": { + "opacity": 1, + "fill": "#EBE8DF", + "font-size": 1, + "stroke": "#4D3F36", + "stroke-width": 1 + }, + "#burgLabels > g#hamlet": { + "opacity": 0.9, + "fill": "#3e3e4b", + "style": "text-shadow: white 0px 0px 4px", + "letter-spacing": 0, + "data-size": 2, + "font-size": 2, + "font-family": "UnifrakturMaguntia", + "data-dy": 0.85 + }, + "#burgIcons > g#hamlet": { + "data-icon": "#icon-watabou-hamlet", + "opacity": 0.9, + "fill": "#E59189", + "fill-opacity": 1, + "font-size": 2, + "stroke": "#4D3F36", + "stroke-width": 1.4, + "stroke-dasharray": null, + "stroke-linecap": "round", + "stroke-linejoin": "round", + "filter": null + }, + "#anchors > g#hamlet": { + "opacity": 1, + "fill": "#EBE8DF", + "font-size": 1, + "stroke": "#4D3F36", + "stroke-width": 1 + }, + "#burgLabels > g#town": { + "opacity": 0.9, + "fill": "#3e3e4b", + "style": "text-shadow: white 0px 0px 4px", + "letter-spacing": 0, + "data-size": 3, + "font-size": 3, + "font-family": "UnifrakturMaguntia", + "data-dy": 0.85 + }, + "#burgIcons > g#town": { + "data-icon": "#icon-watabou-town", + "opacity": 1, + "fill": "#E59189", + "fill-opacity": 1, + "font-size": 2, + "stroke": "#4D3F36", + "stroke-width": 1.4, + "stroke-dasharray": null, + "stroke-linecap": "round", + "stroke-linejoin": "round", + "filter": null + }, + "#anchors > g#town": { + "opacity": 1, + "fill": "#EBE8DF", + "font-size": 1, + "stroke": "#4D3F36", + "stroke-width": 1 }, "#labels > #states": { "opacity": 1, "fill": "#3e3e4b", "stroke": "#3a3a3a", "stroke-width": 0, - "text-shadow": "white 0px 0px 4px", + "style": "text-shadow: white 0px 0px 4px", "letter-spacing": 0, "data-size": 22, "font-size": 22, @@ -397,7 +613,7 @@ "fill": "#3e3e4b", "stroke": "#3a3a3a", "stroke-width": 0, - "text-shadow": "white 0px 0px 4px", + "style": "text-shadow: white 0px 0px 4px", "letter-spacing": 0, "data-size": 18, "font-size": 18, diff --git a/styles/atlas.json b/styles/atlas.json index ef7d7f8a..144362be 100644 --- a/styles/atlas.json +++ b/styles/atlas.json @@ -328,55 +328,255 @@ "data-y": 93, "data-columns": 8 }, - "#burgLabels > #cities": { + "#burgLabels > g#city": { "opacity": 1, "fill": "#000000", - "text-shadow": "white 0px 0px 4px", + "style": "text-shadow: white 0px 0px 4px", "letter-spacing": 0, - "data-size": 5, - "font-size": 5, - "font-family": "Amarante" + "data-size": 6, + "font-size": 6, + "font-family": "Amarante", + "data-dy": -0.4 }, - "#burgIcons > #cities": { + "#burgIcons > g#city": { + "data-icon": "#icon-circle", "opacity": 1, "fill": "#000000", "fill-opacity": 0.7, - "size": 1, + "font-size": 2, "stroke": "#000000", - "stroke-width": 0.24, + "stroke-width": 1, "stroke-dasharray": "", "stroke-linecap": "round" }, - "#anchors > #cities": { + "#anchors > g#city": { "opacity": 1, "fill": "#ffffff", - "size": 2, + "font-size": 2, "stroke": "#3e3e4b", "stroke-width": 1.2 }, - "#burgLabels > #towns": { + "#burgLabels > g#town": { "opacity": 1, "fill": "#000000", - "text-shadow": "white 0px 0px 4px", + "style": "text-shadow: white 0px 0px 4px", "letter-spacing": 0, "data-size": 4, "font-size": 4, - "font-family": "Amarante" + "font-family": "Amarante", + "data-dy": -0.4 }, - "#burgIcons > #towns": { + "#burgIcons > g#town": { + "data-icon": "#icon-circle", "opacity": 1, "fill": "#000000", "fill-opacity": 0.7, - "size": 0.5, + "font-size": 1.2, "stroke": "#000000", - "stroke-width": 0.12, + "stroke-width": 1, "stroke-dasharray": "", "stroke-linecap": "round" }, - "#anchors > #towns": { + "#anchors > g#town": { "opacity": 1, "fill": "#ffffff", - "size": 1, + "font-size": 1.2, + "stroke": "#3e3e4b", + "stroke-width": 1.2 + }, + "#burgLabels > g#capital": { + "opacity": 1, + "fill": "#000000", + "style": "text-shadow: white 0px 0px 4px", + "letter-spacing": 0, + "data-size": 7, + "font-size": 7, + "font-family": "Amarante", + "data-dy": -0.4 + }, + "#burgIcons > g#capital": { + "data-icon": "#icon-square", + "opacity": 1, + "fill": "#000000", + "fill-opacity": 0.7, + "font-size": 2, + "stroke": "#000000", + "stroke-width": 1, + "stroke-dasharray": "", + "stroke-linecap": "butt" + }, + "#anchors > g#capital": { + "opacity": 1, + "fill": "#ffffff", + "font-size": 1.9, + "stroke": "#3e3e4b", + "stroke-width": 1.2 + }, + "#burgLabels > g#fort": { + "opacity": 1, + "fill": "#000000", + "style": "text-shadow: white 0px 0px 4px", + "letter-spacing": 0, + "data-size": 2, + "font-size": 2, + "font-family": "Amarante", + "data-dy": -0.4 + }, + "#burgIcons > g#fort": { + "data-icon": "#icon-triangle", + "opacity": 1, + "fill": "#000000", + "fill-opacity": 0.7, + "font-size": 0.7, + "stroke": "#000000", + "stroke-width": 1, + "stroke-dasharray": "", + "stroke-linecap": "round" + }, + "#anchors > g#fort": { + "opacity": 1, + "fill": "#ffffff", + "font-size": 0.7, + "stroke": "#3e3e4b", + "stroke-width": 1.2 + }, + "#burgLabels > g#monastery": { + "opacity": 1, + "fill": "#000000", + "style": "text-shadow: white 0px 0px 4px", + "letter-spacing": 0, + "data-size": 2, + "font-size": 2, + "font-family": "Amarante", + "data-dy": -0.4 + }, + "#burgIcons > g#monastery": { + "data-icon": "#icon-cross", + "opacity": 1, + "fill": "#000000", + "fill-opacity": 0.7, + "font-size": 0.7, + "stroke": "#000000", + "stroke-width": 1, + "stroke-dasharray": "", + "stroke-linecap": "round" + }, + "#anchors > g#monastery": { + "opacity": 1, + "fill": "#ffffff", + "font-size": 0.7, + "stroke": "#3e3e4b", + "stroke-width": 1.2 + }, + "#burgLabels > g#caravanserai": { + "opacity": 1, + "fill": "#000000", + "style": "text-shadow: white 0px 0px 4px", + "letter-spacing": 0, + "data-size": 2, + "font-size": 2, + "font-family": "Amarante", + "data-dy": -0.4 + }, + "#burgIcons > g#caravanserai": { + "data-icon": "#icon-triangle", + "opacity": 1, + "fill": "#000000", + "fill-opacity": 0.7, + "font-size": 0.7, + "stroke": "#000000", + "stroke-width": 1, + "stroke-dasharray": "", + "stroke-linecap": "round" + }, + "#anchors > g#caravanserai": { + "opacity": 1, + "fill": "#ffffff", + "font-size": 0.7, + "stroke": "#3e3e4b", + "stroke-width": 1.2 + }, + "#burgLabels > g#trading_post": { + "opacity": 1, + "fill": "#000000", + "style": "text-shadow: white 0px 0px 4px", + "letter-spacing": 0, + "data-size": 2, + "font-size": 2, + "font-family": "Amarante", + "data-dy": -0.4 + }, + "#burgIcons > g#trading_post": { + "data-icon": "#icon-triangle", + "opacity": 1, + "fill": "#000000", + "fill-opacity": 0.7, + "font-size": 0.7, + "stroke": "#000000", + "stroke-width": 1, + "stroke-dasharray": "", + "stroke-linecap": "round" + }, + "#anchors > g#trading_post": { + "opacity": 1, + "fill": "#ffffff", + "font-size": 0.7, + "stroke": "#3e3e4b", + "stroke-width": 1.2 + }, + "#burgLabels > g#village": { + "opacity": 1, + "fill": "#000000", + "style": "text-shadow: white 0px 0px 4px", + "letter-spacing": 0, + "data-size": 3, + "font-size": 3, + "font-family": "Amarante", + "data-dy": -0.4 + }, + "#burgIcons > g#village": { + "data-icon": "#icon-circle", + "opacity": 1, + "fill": "#000000", + "fill-opacity": 0.7, + "font-size": 0.7, + "stroke": "#000000", + "stroke-width": 1, + "stroke-dasharray": "", + "stroke-linecap": "round" + }, + "#anchors > g#village": { + "opacity": 1, + "fill": "#ffffff", + "font-size": 0.7, + "stroke": "#3e3e4b", + "stroke-width": 1.2 + }, + "#burgLabels > g#hamlet": { + "opacity": 1, + "fill": "#000000", + "style": "text-shadow: white 0px 0px 4px", + "letter-spacing": 0, + "data-size": 2, + "font-size": 2, + "font-family": "Amarante", + "data-dy": -0.4 + }, + "#burgIcons > g#hamlet": { + "data-icon": "#icon-circle", + "opacity": 1, + "fill": "#000000", + "fill-opacity": 0.7, + "font-size": 0.5, + "stroke": "#000000", + "stroke-width": 1, + "stroke-dasharray": "", + "stroke-linecap": "round" + }, + "#anchors > g#hamlet": { + "opacity": 1, + "fill": "#ffffff", + "font-size": 0.5, "stroke": "#3e3e4b", "stroke-width": 1.2 }, @@ -385,7 +585,7 @@ "fill": "#000000", "stroke": "#000000", "stroke-width": 0, - "text-shadow": "white 0px 0px 4px", + "style": "text-shadow: white 0px 0px 4px", "letter-spacing": 0, "data-size": 21, "font-size": 21, @@ -397,7 +597,7 @@ "fill": "#000000", "stroke": "#000000", "stroke-width": 0, - "text-shadow": "white 0px 0px 4px", + "style": "text-shadow: white 0px 0px 4px", "letter-spacing": 0, "data-size": 18, "font-size": 18, diff --git a/styles/clean.json b/styles/clean.json index c5aad094..9698edc0 100644 --- a/styles/clean.json +++ b/styles/clean.json @@ -330,64 +330,271 @@ "data-y": 93, "data-columns": 8 }, - "#burgLabels > #cities": { + "#burgLabels > g#city": { "opacity": 1, "fill": "#414141", - "text-shadow": "white 0 0 4px", + "style": "text-shadow: white 0 0 4px", "letter-spacing": 0, "data-size": 7, "font-size": 7, - "font-family": "Arial" + "font-family": "Arial", + "data-dy": -0.4 }, - "#burgIcons > #cities": { + "#burgIcons > g#city": { + "data-icon": "#icon-circle", "opacity": 1, "fill": "#ffffff", "fill-opacity": 0.7, - "size": 1, + "font-size": 1.5, "stroke": "#3e3e4b", - "stroke-width": 0.24, + "stroke-width": 1, "stroke-dasharray": "", "stroke-linecap": "butt" }, - "#anchors > #cities": { + "#anchors > g#city": { "opacity": 1, "fill": "#ffffff", - "size": 2, + "font-size": 1.5, "stroke": "#303030", "stroke-width": 1.7 }, - "#burgLabels > #towns": { + "#burgLabels > g#town": { "opacity": 1, "fill": "#414141", - "text-shadow": "none", + "style": "text-shadow: none", "letter-spacing": 0, "data-size": 3, "font-size": 3, - "font-family": "Arial" + "font-family": "Arial", + "data-dy": -0.4 }, - "#burgIcons > #towns": { + "#burgIcons > g#town": { + "data-icon": "#icon-circle", "opacity": 1, "fill": "#ffffff", "fill-opacity": 0.7, - "size": 0.5, + "font-size": 1, "stroke": "#3e3e4b", - "stroke-width": 0.12, + "stroke-width": 1, "stroke-dasharray": "", "stroke-linecap": "butt" }, - "#anchors > #towns": { + "#anchors > g#town": { "opacity": 1, "fill": "#ffffff", - "size": 1, + "font-size": 1, "stroke": "#3e3e4b", - "stroke-width": 1.06 + "stroke-width": 1 + }, + "#burgLabels > g#capital": { + "opacity": 1, + "fill": "#3e3e4b", + "style": "text-shadow: white 0px 0px 4px", + "letter-spacing": 0, + "data-size": 7, + "font-size": 7, + "font-family": "Arial", + "data-dy": -0.4 + }, + "#burgIcons > g#capital": { + "data-icon": "#icon-square", + "opacity": 1, + "fill": "#ffffff", + "fill-opacity": 0.7, + "font-size": 2, + "stroke": "#3e3e4b", + "stroke-width": 1, + "stroke-dasharray": null, + "stroke-linecap": "butt", + "stroke-linejoin": "round" + }, + "#anchors > g#capital": { + "opacity": 1, + "fill": "#ffffff", + "font-size": 1.9, + "stroke": "#3e3e4b", + "stroke-width": 1.2 + }, + "#burgLabels > g#fort": { + "opacity": 1, + "fill": "#3e3e4b", + "style": "text-shadow: white 0px 0px 4px", + "letter-spacing": 0, + "data-size": 2, + "font-size": 2, + "font-family": "Arial", + "data-dy": -0.4 + }, + "#burgIcons > g#fort": { + "data-icon": "#icon-triangle", + "opacity": 1, + "fill": "#ffffff", + "fill-opacity": 0.7, + "font-size": 0.7, + "stroke": "#3e3e4b", + "stroke-width": 1, + "stroke-dasharray": null, + "stroke-linecap": "butt", + "stroke-linejoin": "round" + }, + "#anchors > g#fort": { + "opacity": 1, + "fill": "#ffffff", + "font-size": 0.7, + "stroke": "#3e3e4b", + "stroke-width": 1.2 + }, + "#burgLabels > g#monastery": { + "opacity": 1, + "fill": "#3e3e4b", + "style": "text-shadow: white 0px 0px 4px", + "letter-spacing": 0, + "data-size": 2, + "font-size": 2, + "font-family": "Arial", + "data-dy": -0.4 + }, + "#burgIcons > g#monastery": { + "data-icon": "#icon-cross", + "opacity": 1, + "fill": "#ffffff", + "fill-opacity": 0.7, + "font-size": 0.7, + "stroke": "#3e3e4b", + "stroke-width": 1, + "stroke-dasharray": null, + "stroke-linecap": "butt", + "stroke-linejoin": "round" + }, + "#anchors > g#monastery": { + "opacity": 1, + "fill": "#ffffff", + "font-size": 0.7, + "stroke": "#3e3e4b", + "stroke-width": 1.2 + }, + "#burgLabels > g#caravanserai": { + "opacity": 1, + "fill": "#3e3e4b", + "style": "text-shadow: white 0px 0px 4px", + "letter-spacing": 0, + "data-size": 2, + "font-size": 2, + "font-family": "Arial", + "data-dy": -0.4 + }, + "#burgIcons > g#caravanserai": { + "data-icon": "#icon-triangle", + "opacity": 1, + "fill": "#ffffff", + "fill-opacity": 0.7, + "font-size": 0.7, + "stroke": "#3e3e4b", + "stroke-width": 1, + "stroke-dasharray": null, + "stroke-linecap": "butt", + "stroke-linejoin": "round" + }, + "#anchors > g#caravanserai": { + "opacity": 1, + "fill": "#ffffff", + "font-size": 0.7, + "stroke": "#3e3e4b", + "stroke-width": 1.2 + }, + "#burgLabels > g#trading_post": { + "opacity": 1, + "fill": "#3e3e4b", + "style": "text-shadow: white 0px 0px 4px", + "letter-spacing": 0, + "data-size": 2, + "font-size": 2, + "font-family": "Arial", + "data-dy": -0.4 + }, + "#burgIcons > g#trading_post": { + "data-icon": "#icon-triangle", + "opacity": 1, + "fill": "#ffffff", + "fill-opacity": 0.7, + "font-size": 0.7, + "stroke": "#3e3e4b", + "stroke-width": 1, + "stroke-dasharray": null, + "stroke-linecap": "butt", + "stroke-linejoin": "round" + }, + "#anchors > g#trading_post": { + "opacity": 1, + "fill": "#ffffff", + "font-size": 0.7, + "stroke": "#3e3e4b", + "stroke-width": 1.2 + }, + "#burgLabels > g#village": { + "opacity": 1, + "fill": "#3e3e4b", + "style": "text-shadow: white 0px 0px 4px", + "letter-spacing": 0, + "data-size": 3, + "font-size": 3, + "font-family": "Arial", + "data-dy": -0.4 + }, + "#burgIcons > g#village": { + "data-icon": "#icon-circle", + "opacity": 1, + "fill": "#ffffff", + "fill-opacity": 0.7, + "font-size": 0.7, + "stroke": "#3e3e4b", + "stroke-width": 1.2, + "stroke-dasharray": null, + "stroke-linecap": "butt", + "stroke-linejoin": "round" + }, + "#anchors > g#village": { + "opacity": 1, + "fill": "#ffffff", + "font-size": 0.7, + "stroke": "#3e3e4b", + "stroke-width": 1.2 + }, + "#burgLabels > g#hamlet": { + "opacity": 1, + "fill": "#3e3e4b", + "style": "text-shadow: white 0px 0px 4px", + "letter-spacing": 0, + "data-size": 2, + "font-size": 2, + "font-family": "Arial", + "data-dy": -0.4 + }, + "#burgIcons > g#hamlet": { + "data-icon": "#icon-circle", + "opacity": 1, + "fill": "#ffffff", + "fill-opacity": 0.7, + "font-size": 0.5, + "stroke": "#3e3e4b", + "stroke-width": 1.2, + "stroke-dasharray": null, + "stroke-linecap": "butt", + "stroke-linejoin": "round" + }, + "#anchors > g#hamlet": { + "opacity": 1, + "fill": "#ffffff", + "font-size": 0.5, + "stroke": "#3e3e4b", + "stroke-width": 1.2 }, "#labels > #states": { "opacity": 1, "fill": "#292929", "stroke": "#303030", "stroke-width": 0, - "text-shadow": "white 0 0 2px", + "style": "text-shadow: white 0 0 2px", "letter-spacing": 0, "data-size": 10, "font-size": 10, @@ -399,7 +606,7 @@ "fill": "#414141", "stroke": "#3a3a3a", "stroke-width": 0, - "text-shadow": "white 0 0 4px", + "style": "text-shadow: white 0 0 4px", "letter-spacing": 0, "data-size": 18, "font-size": 18, diff --git a/styles/cyberpunk.json b/styles/cyberpunk.json index 93f22284..c5796f9c 100644 --- a/styles/cyberpunk.json +++ b/styles/cyberpunk.json @@ -328,64 +328,271 @@ "data-y": 93, "data-columns": 8 }, - "#burgLabels > #cities": { + "#burgLabels > g#city": { "opacity": 1, "fill": "#ffffff", - "text-shadow": "white 0px 0px 4px", + "style": "text-shadow: white 0px 0px 4px", "letter-spacing": 0, "data-size": 8, "font-size": 8, - "font-family": "Orbitron" + "font-family": "Orbitron", + "data-dy": -0.4 }, - "#burgIcons > #cities": { + "#burgIcons > g#city": { + "data-icon": "#icon-circle", "opacity": 1, "fill": "#ffffff", "fill-opacity": 0.7, - "size": 2, + "font-size": 2, "stroke": "#444444", - "stroke-width": 0.25, + "stroke-width": 1.2, "stroke-dasharray": "", "stroke-linecap": "butt" }, - "#anchors > #cities": { + "#anchors > g#city": { "opacity": 1, "fill": "#ffffff", - "size": 4, + "font-size": 2, "stroke": "#3e3e4b", "stroke-width": 1 }, - "#burgLabels > #towns": { + "#burgLabels > g#town": { "opacity": 1, "fill": "#ffffff", - "text-shadow": "white 0px 0px 4px", + "style": "text-shadow: white 0px 0px 4px", + "letter-spacing": 0, + "data-size": 4, + "font-size": 4, + "font-family": "Orbitron", + "data-dy": -0.4 + }, + "#burgIcons > g#town": { + "data-icon": "#icon-circle", + "opacity": 1, + "fill": "#ffffff", + "fill-opacity": 0.7, + "font-size": 1, + "stroke": "#3e3e4b", + "stroke-width": 1.2, + "stroke-dasharray": "", + "stroke-linecap": "butt" + }, + "#anchors > g#town": { + "opacity": 1, + "fill": "#ffffff", + "font-size": 1, + "stroke": "#3e3e4b", + "stroke-width": 1 + }, + "#burgLabels > g#capital": { + "opacity": 1, + "fill": "#ffffff", + "style": "text-shadow: white 0px 0px 4px", + "letter-spacing": 0, + "data-size": 9, + "font-size": 9, + "font-family": "Orbitron", + "data-dy": -0.4 + }, + "#burgIcons > g#capital": { + "data-icon": "#icon-square", + "opacity": 1, + "fill": "#ffffff", + "fill-opacity": 0.7, + "font-size": 2, + "stroke": "#3e3e4b", + "stroke-width": 1, + "stroke-dasharray": null, + "stroke-linecap": "butt", + "stroke-linejoin": "round" + }, + "#anchors > g#capital": { + "opacity": 1, + "fill": "#ffffff", + "font-size": 1.9, + "stroke": "#3e3e4b", + "stroke-width": 1.2 + }, + "#burgLabels > g#fort": { + "opacity": 1, + "fill": "#ffffff", + "style": "text-shadow: white 0px 0px 4px", "letter-spacing": 0, "data-size": 3, "font-size": 3, - "font-family": "Orbitron" + "font-family": "Orbitron", + "data-dy": -0.4 }, - "#burgIcons > #towns": { - "opacity": 0.95, - "fill": "#ffffff", - "fill-opacity": 0.7, - "size": 0.8, - "stroke": "#3e3e4b", - "stroke-width": 0.2, - "stroke-dasharray": "", - "stroke-linecap": "butt" - }, - "#anchors > #towns": { + "#burgIcons > g#fort": { + "data-icon": "#icon-triangle", "opacity": 1, "fill": "#ffffff", - "size": 1.6, + "fill-opacity": 0.7, + "font-size": 0.7, "stroke": "#3e3e4b", - "stroke-width": 1 + "stroke-width": 1, + "stroke-dasharray": null, + "stroke-linecap": "butt", + "stroke-linejoin": "round" + }, + "#anchors > g#fort": { + "opacity": 1, + "fill": "#ffffff", + "font-size": 0.7, + "stroke": "#3e3e4b", + "stroke-width": 1.2 + }, + "#burgLabels > g#monastery": { + "opacity": 1, + "fill": "#ffffff", + "style": "text-shadow: white 0px 0px 4px", + "letter-spacing": 0, + "data-size": 3, + "font-size": 3, + "font-family": "Orbitron", + "data-dy": -0.4 + }, + "#burgIcons > g#monastery": { + "data-icon": "#icon-cross", + "opacity": 1, + "fill": "#ffffff", + "fill-opacity": 0.7, + "font-size": 0.7, + "stroke": "#3e3e4b", + "stroke-width": 1, + "stroke-dasharray": null, + "stroke-linecap": "butt", + "stroke-linejoin": "round" + }, + "#anchors > g#monastery": { + "opacity": 1, + "fill": "#ffffff", + "font-size": 0.7, + "stroke": "#3e3e4b", + "stroke-width": 1.2 + }, + "#burgLabels > g#caravanserai": { + "opacity": 1, + "fill": "#ffffff", + "style": "text-shadow: white 0px 0px 4px", + "letter-spacing": 0, + "data-size": 3, + "font-size": 3, + "font-family": "Orbitron", + "data-dy": -0.4 + }, + "#burgIcons > g#caravanserai": { + "data-icon": "#icon-triangle", + "opacity": 1, + "fill": "#ffffff", + "fill-opacity": 0.7, + "font-size": 0.7, + "stroke": "#3e3e4b", + "stroke-width": 1, + "stroke-dasharray": null, + "stroke-linecap": "butt", + "stroke-linejoin": "round" + }, + "#anchors > g#caravanserai": { + "opacity": 1, + "fill": "#ffffff", + "font-size": 0.7, + "stroke": "#3e3e4b", + "stroke-width": 1.2 + }, + "#burgLabels > g#trading_post": { + "opacity": 1, + "fill": "#ffffff", + "style": "text-shadow: white 0px 0px 4px", + "letter-spacing": 0, + "data-size": 3, + "font-size": 3, + "font-family": "Orbitron", + "data-dy": -0.4 + }, + "#burgIcons > g#trading_post": { + "data-icon": "#icon-triangle", + "opacity": 1, + "fill": "#ffffff", + "fill-opacity": 0.7, + "font-size": 0.7, + "stroke": "#3e3e4b", + "stroke-width": 1, + "stroke-dasharray": null, + "stroke-linecap": "butt", + "stroke-linejoin": "round" + }, + "#anchors > g#trading_post": { + "opacity": 1, + "fill": "#ffffff", + "font-size": 0.7, + "stroke": "#3e3e4b", + "stroke-width": 1.2 + }, + "#burgLabels > g#village": { + "opacity": 1, + "fill": "#ffffff", + "style": "text-shadow: white 0px 0px 4px", + "letter-spacing": 0, + "data-size": 3, + "font-size": 3, + "font-family": "Orbitron", + "data-dy": -0.4 + }, + "#burgIcons > g#village": { + "data-icon": "#icon-circle", + "opacity": 1, + "fill": "#ffffff", + "fill-opacity": 0.7, + "font-size": 0.7, + "stroke": "#3e3e4b", + "stroke-width": 1.2, + "stroke-dasharray": null, + "stroke-linecap": "butt", + "stroke-linejoin": "round" + }, + "#anchors > g#village": { + "opacity": 1, + "fill": "#ffffff", + "font-size": 0.7, + "stroke": "#3e3e4b", + "stroke-width": 1.2 + }, + "#burgLabels > g#hamlet": { + "opacity": 1, + "fill": "#ffffff", + "style": "text-shadow: white 0px 0px 4px", + "letter-spacing": 0, + "data-size": 3, + "font-size": 3, + "font-family": "Orbitron", + "data-dy": -0.4 + }, + "#burgIcons > g#hamlet": { + "data-icon": "#icon-circle", + "opacity": 1, + "fill": "#ffffff", + "fill-opacity": 0.7, + "font-size": 0.5, + "stroke": "#3e3e4b", + "stroke-width": 1.2, + "stroke-dasharray": null, + "stroke-linecap": "butt", + "stroke-linejoin": "round" + }, + "#anchors > g#hamlet": { + "opacity": 1, + "fill": "#ffffff", + "font-size": 0.5, + "stroke": "#3e3e4b", + "stroke-width": 1.2 }, "#labels > #states": { "opacity": 1, "fill": "#ffffff", "stroke": "#000000", "stroke-width": 0, - "text-shadow": "white 0px 0px 4px", + "style": "text-shadow: white 0px 0px 4px", "letter-spacing": 0, "data-size": 18, "font-size": 18, @@ -397,7 +604,7 @@ "fill": "#ffffff", "stroke": "#000000", "stroke-width": 0, - "text-shadow": "white 0px 0px 4px", + "style": "text-shadow: white 0px 0px 4px", "letter-spacing": 0, "data-size": 18, "font-size": 18, diff --git a/styles/darkSeas.json b/styles/darkSeas.json index 2bc90fa6..5c1840ca 100644 --- a/styles/darkSeas.json +++ b/styles/darkSeas.json @@ -183,7 +183,7 @@ "#roads": { "opacity": 1, "stroke": "#ff6000", - "stroke-width": 1.75, + "stroke-width": 1.25, "stroke-dasharray": 0, "stroke-linecap": "butt", "filter": null, @@ -192,7 +192,7 @@ "#trails": { "opacity": 1, "stroke": "#ff6000", - "stroke-width": 1, + "stroke-width": 0.75, "stroke-dasharray": 0, "stroke-linecap": "butt", "filter": null, @@ -317,53 +317,246 @@ "data-y": 93, "data-columns": 8 }, - "#burgLabels > #cities": { + "#burgLabels > g#city": { "opacity": 1, "fill": "#000000", - "text-shadow": "white 0px 0px 4px", + "style": "text-shadow: white 0px 0px 4px", "letter-spacing": 0, "data-size": 7, "font-size": 7, - "font-family": "Lugrasimo" + "font-family": "Lugrasimo", + "data-dy": -0.4 }, - "#burgIcons > #cities": { + "#burgIcons > g#city": { + "data-icon": "#icon-circle", "opacity": 0.7, "fill": "#000000", - "size": 1.75, + "font-size": 2, "stroke": "#000000", "stroke-width": 0, "stroke-dasharray": 0, "stroke-linecap": "butt" }, - "#anchors > #cities": { + "#anchors > g#city": { "opacity": 1, "fill": "#ffffff", - "size": 3.5, + "font-size": 2, "stroke": "#3e3e4b", "stroke-width": 1.2 }, - "#burgLabels > #towns": { + "#burgLabels > g#town": { "opacity": 1, "fill": "#000000", - "text-shadow": "white 0px 0px 4px", + "style": "text-shadow: white 0px 0px 4px", "letter-spacing": 0, "data-size": 5, "font-size": 5, - "font-family": "Lugrasimo" + "font-family": "Lugrasimo", + "data-dy": -0.4 }, - "#burgIcons > #towns": { + "#burgIcons > g#town": { + "data-icon": "#icon-circle", "opacity": 0.7, "fill": "#000000", - "size": 1.25, + "font-size": 1.25, "stroke": "#000000", "stroke-width": 0, "stroke-dasharray": 0, "stroke-linecap": "butt" }, - "#anchors > #towns": { + "#anchors > g#town": { "opacity": 1, "fill": "#ffffff", - "size": 2, + "font-size": 1.25, + "stroke": "#3e3e4b", + "stroke-width": 1.2 + }, + "#burgLabels > g#capital": { + "opacity": 1, + "fill": "#000000", + "style": "text-shadow: white 0px 0px 4px", + "letter-spacing": 0, + "data-size": 7, + "font-size": 7, + "font-family": "Lugrasimo", + "data-dy": -0.4 + }, + "#burgIcons > g#capital": { + "data-icon": "#icon-square", + "opacity": 0.7, + "fill": "#000000", + "font-size": 2, + "stroke": "#000000", + "stroke-width": 0, + "stroke-dasharray": 0, + "stroke-linecap": "butt" + }, + "#anchors > g#capital": { + "opacity": 1, + "fill": "#ffffff", + "font-size": 1.9, + "stroke": "#3e3e4b", + "stroke-width": 1.2 + }, + "#burgLabels > g#fort": { + "opacity": 1, + "fill": "#000000", + "style": "text-shadow: white 0px 0px 4px", + "letter-spacing": 0, + "data-size": 2, + "font-size": 2, + "font-family": "Lugrasimo", + "data-dy": -0.4 + }, + "#burgIcons > g#fort": { + "data-icon": "#icon-triangle", + "opacity": 0.7, + "fill": "#000000", + "font-size": 0.7, + "stroke": "#000000", + "stroke-width": 0, + "stroke-dasharray": 0, + "stroke-linecap": "butt" + }, + "#anchors > g#fort": { + "opacity": 1, + "fill": "#ffffff", + "font-size": 0.7, + "stroke": "#3e3e4b", + "stroke-width": 1.2 + }, + "#burgLabels > g#monastery": { + "opacity": 1, + "fill": "#000000", + "style": "text-shadow: white 0px 0px 4px", + "letter-spacing": 0, + "data-size": 2, + "font-size": 2, + "font-family": "Lugrasimo", + "data-dy": -0.4 + }, + "#burgIcons > g#monastery": { + "data-icon": "#icon-cross", + "opacity": 0.7, + "fill": "#000000", + "font-size": 0.7, + "stroke": "#000000", + "stroke-width": 0, + "stroke-dasharray": 0, + "stroke-linecap": "butt" + }, + "#anchors > g#monastery": { + "opacity": 1, + "fill": "#ffffff", + "font-size": 0.7, + "stroke": "#3e3e4b", + "stroke-width": 1.2 + }, + "#burgLabels > g#caravanserai": { + "opacity": 1, + "fill": "#000000", + "style": "text-shadow: white 0px 0px 4px", + "letter-spacing": 0, + "data-size": 2, + "font-size": 2, + "font-family": "Lugrasimo", + "data-dy": -0.4 + }, + "#burgIcons > g#caravanserai": { + "data-icon": "#icon-triangle", + "opacity": 0.7, + "fill": "#000000", + "font-size": 0.7, + "stroke": "#000000", + "stroke-width": 0, + "stroke-dasharray": 0, + "stroke-linecap": "butt" + }, + "#anchors > g#caravanserai": { + "opacity": 1, + "fill": "#ffffff", + "font-size": 0.7, + "stroke": "#3e3e4b", + "stroke-width": 1.2 + }, + "#burgLabels > g#trading_post": { + "opacity": 1, + "fill": "#000000", + "style": "text-shadow: white 0px 0px 4px", + "letter-spacing": 0, + "data-size": 2, + "font-size": 2, + "font-family": "Lugrasimo", + "data-dy": -0.4 + }, + "#burgIcons > g#trading_post": { + "data-icon": "#icon-triangle", + "opacity": 0.7, + "fill": "#000000", + "font-size": 0.7, + "stroke": "#000000", + "stroke-width": 0, + "stroke-dasharray": 0, + "stroke-linecap": "butt" + }, + "#anchors > g#trading_post": { + "opacity": 1, + "fill": "#ffffff", + "font-size": 0.7, + "stroke": "#3e3e4b", + "stroke-width": 1.2 + }, + "#burgLabels > g#village": { + "opacity": 1, + "fill": "#000000", + "style": "text-shadow: white 0px 0px 4px", + "letter-spacing": 0, + "data-size": 3, + "font-size": 3, + "font-family": "Lugrasimo", + "data-dy": -0.4 + }, + "#burgIcons > g#village": { + "data-icon": "#icon-circle", + "opacity": 0.7, + "fill": "#000000", + "font-size": 0.7, + "stroke": "#000000", + "stroke-width": 0, + "stroke-dasharray": 0, + "stroke-linecap": "butt" + }, + "#anchors > g#village": { + "opacity": 1, + "fill": "#ffffff", + "font-size": 0.7, + "stroke": "#3e3e4b", + "stroke-width": 1.2 + }, + "#burgLabels > g#hamlet": { + "opacity": 1, + "fill": "#000000", + "style": "text-shadow: white 0px 0px 4px", + "letter-spacing": 0, + "data-size": 2, + "font-size": 2, + "font-family": "Lugrasimo", + "data-dy": -0.4 + }, + "#burgIcons > g#hamlet": { + "data-icon": "#icon-circle", + "opacity": 0.7, + "fill": "#000000", + "font-size": 0.5, + "stroke": "#000000", + "stroke-width": 0, + "stroke-dasharray": 0, + "stroke-linecap": "butt" + }, + "#anchors > g#hamlet": { + "opacity": 1, + "fill": "#ffffff", + "font-size": 0.5, "stroke": "#3e3e4b", "stroke-width": 1.2 }, @@ -372,7 +565,7 @@ "fill": "#000000", "stroke": "#000000", "stroke-width": 0, - "text-shadow": "white 0px 0px 4px", + "style": "text-shadow: white 0px 0px 4px", "letter-spacing": 0, "data-size": 21, "font-size": 21, @@ -384,7 +577,7 @@ "fill": "#000000", "stroke": "#000000", "stroke-width": 0, - "text-shadow": "white 0px 0px 4px", + "style": "text-shadow: white 0px 0px 4px", "letter-spacing": 0, "data-size": 18, "font-size": 18, diff --git a/styles/default.json b/styles/default.json index 23b06487..42d1fbf7 100644 --- a/styles/default.json +++ b/styles/default.json @@ -328,55 +328,264 @@ "data-y": 93, "data-columns": 8 }, - "#burgLabels > #cities": { + "#burgLabels > g#capital": { "opacity": 1, "fill": "#3e3e4b", - "text-shadow": "white 0px 0px 4px", + "style": "text-shadow: white 0px 0px 4px", "letter-spacing": 0, - "data-size": 7, - "font-size": 7, - "font-family": "Almendra SC" + "data-size": 6, + "font-size": 6, + "font-family": "Almendra SC", + "data-dy": -0.5 }, - "#burgIcons > #cities": { + "#burgIcons > g#capital": { + "data-icon": "#icon-square", "opacity": 1, "fill": "#ffffff", "fill-opacity": 0.7, - "size": 1, + "font-size": 2, "stroke": "#3e3e4b", - "stroke-width": 0.24, - "stroke-dasharray": "", - "stroke-linecap": "butt" + "stroke-width": 1, + "stroke-dasharray": null, + "stroke-linecap": "butt", + "stroke-linejoin": "round" }, - "#anchors > #cities": { + "#anchors > g#capital": { "opacity": 1, "fill": "#ffffff", - "size": 2, + "font-size": 1.9, "stroke": "#3e3e4b", "stroke-width": 1.2 }, - "#burgLabels > #towns": { + "#burgLabels > g#city": { "opacity": 1, "fill": "#3e3e4b", - "text-shadow": "white 0px 0px 4px", + "style": "text-shadow: white 0px 0px 4px", "letter-spacing": 0, - "data-size": 4, - "font-size": 4, - "font-family": "Almendra SC" + "data-size": 5, + "font-size": 5, + "font-family": "Almendra SC", + "data-dy": -0.4 }, - "#burgIcons > #towns": { + "#burgIcons > g#city": { + "data-icon": "#icon-circle", "opacity": 1, "fill": "#ffffff", "fill-opacity": 0.7, - "size": 0.5, + "font-size": 1.5, "stroke": "#3e3e4b", - "stroke-width": 0.12, - "stroke-dasharray": "", - "stroke-linecap": "butt" + "stroke-width": 1, + "stroke-dasharray": null, + "stroke-linecap": "butt", + "stroke-linejoin": "round" }, - "#anchors > #towns": { + "#anchors > g#city": { "opacity": 1, "fill": "#ffffff", - "size": 1, + "font-size": 1.5, + "stroke": "#3e3e4b", + "stroke-width": 1.2 + }, + "#burgLabels > g#fort": { + "opacity": 1, + "fill": "#3e3e4b", + "style": "text-shadow: white 0px 0px 4px", + "letter-spacing": 0, + "data-size": 2, + "font-size": 2, + "font-family": "Almendra SC", + "data-dy": -0.5 + }, + "#burgIcons > g#fort": { + "data-icon": "#icon-square", + "opacity": 1, + "fill": "#ffffff", + "fill-opacity": 0.7, + "font-size": 0.7, + "stroke": "#3e3e4b", + "stroke-width": 1, + "stroke-dasharray": null, + "stroke-linecap": "butt", + "stroke-linejoin": "round" + }, + "#anchors > g#fort": { + "opacity": 1, + "fill": "#ffffff", + "font-size": 0.7, + "stroke": "#3e3e4b", + "stroke-width": 1.2 + }, + "#burgLabels > g#monastery": { + "opacity": 1, + "fill": "#3e3e4b", + "style": "text-shadow: white 0px 0px 4px", + "letter-spacing": 0, + "data-size": 2, + "font-size": 2, + "font-family": "Almendra SC", + "data-dy": -0.5 + }, + "#burgIcons > g#monastery": { + "data-icon": "#icon-cross", + "opacity": 1, + "fill": "#ffffff", + "fill-opacity": 0.7, + "font-size": 0.7, + "stroke": "#3e3e4b", + "stroke-width": 1, + "stroke-dasharray": null, + "stroke-linecap": "butt", + "stroke-linejoin": "round" + }, + "#anchors > g#monastery": { + "opacity": 1, + "fill": "#ffffff", + "font-size": 0.7, + "stroke": "#3e3e4b", + "stroke-width": 1.2 + }, + "#burgLabels > g#caravanserai": { + "opacity": 1, + "fill": "#3e3e4b", + "style": "text-shadow: white 0px 0px 4px", + "letter-spacing": 0, + "data-size": 2, + "font-size": 2, + "font-family": "Almendra SC", + "data-dy": -0.5 + }, + "#burgIcons > g#caravanserai": { + "data-icon": "#icon-triangle", + "opacity": 1, + "fill": "#ffffff", + "fill-opacity": 0.7, + "font-size": 0.7, + "stroke": "#3e3e4b", + "stroke-width": 1, + "stroke-dasharray": null, + "stroke-linecap": "butt", + "stroke-linejoin": "round" + }, + "#anchors > g#caravanserai": { + "opacity": 1, + "fill": "#ffffff", + "font-size": 0.7, + "stroke": "#3e3e4b", + "stroke-width": 1.2 + }, + "#burgLabels > g#trading_post": { + "opacity": 1, + "fill": "#3e3e4b", + "style": "text-shadow: white 0px 0px 4px", + "letter-spacing": 0, + "data-size": 2, + "font-size": 2, + "font-family": "Almendra SC", + "data-dy": -0.5 + }, + "#burgIcons > g#trading_post": { + "data-icon": "#icon-triangle", + "opacity": 1, + "fill": "#ffffff", + "fill-opacity": 0.7, + "font-size": 0.7, + "stroke": "#3e3e4b", + "stroke-width": 1, + "stroke-dasharray": null, + "stroke-linecap": "butt", + "stroke-linejoin": "round" + }, + "#anchors > g#trading_post": { + "opacity": 1, + "fill": "#ffffff", + "font-size": 0.7, + "stroke": "#3e3e4b", + "stroke-width": 1.2 + }, + "#burgLabels > g#village": { + "opacity": 1, + "fill": "#3e3e4b", + "style": "text-shadow: white 0px 0px 4px", + "letter-spacing": 0, + "data-size": 3, + "font-size": 3, + "font-family": "Almendra SC", + "data-dy": -0.4 + }, + "#burgIcons > g#village": { + "data-icon": "#icon-circle", + "opacity": 1, + "fill": "#ffffff", + "fill-opacity": 0.7, + "font-size": 0.7, + "stroke": "#3e3e4b", + "stroke-width": 1.2, + "stroke-dasharray": null, + "stroke-linecap": "butt", + "stroke-linejoin": "round" + }, + "#anchors > g#village": { + "opacity": 1, + "fill": "#ffffff", + "font-size": 0.7, + "stroke": "#3e3e4b", + "stroke-width": 1.2 + }, + "#burgLabels > g#hamlet": { + "opacity": 1, + "fill": "#3e3e4b", + "style": "text-shadow: white 0px 0px 4px", + "letter-spacing": 0, + "data-size": 2, + "font-size": 2, + "font-family": "Almendra SC", + "data-dy": -0.4 + }, + "#burgIcons > g#hamlet": { + "data-icon": "#icon-circle", + "opacity": 1, + "fill": "#ffffff", + "fill-opacity": 0.7, + "font-size": 0.5, + "stroke": "#3e3e4b", + "stroke-width": 1.2, + "stroke-dasharray": null, + "stroke-linecap": "butt", + "stroke-linejoin": "round" + }, + "#anchors > g#hamlet": { + "opacity": 1, + "fill": "#ffffff", + "font-size": 0.5, + "stroke": "#3e3e4b", + "stroke-width": 1.2 + }, + "#burgLabels > g#town": { + "opacity": 1, + "fill": "#3e3e4b", + "style": "text-shadow: white 0px 0px 4px", + "letter-spacing": 0, + "data-size": 4, + "font-size": 4, + "font-family": "Almendra SC", + "data-dy": -0.4 + }, + "#burgIcons > g#town": { + "data-icon": "#icon-circle", + "opacity": 1, + "fill": "#ffffff", + "fill-opacity": 0.7, + "font-size": 1, + "stroke": "#3e3e4b", + "stroke-width": 1.2, + "stroke-dasharray": null, + "stroke-linecap": "butt", + "stroke-linejoin": "round" + }, + "#anchors > g#town": { + "opacity": 1, + "fill": "#ffffff", + "font-size": 1, "stroke": "#3e3e4b", "stroke-width": 1.2 }, @@ -385,7 +594,7 @@ "fill": "#3e3e4b", "stroke": "#3a3a3a", "stroke-width": 0, - "text-shadow": "white 0px 0px 4px", + "style": "text-shadow: white 0px 0px 4px", "letter-spacing": 0, "data-size": 22, "font-size": 22, @@ -397,7 +606,7 @@ "fill": "#3e3e4b", "stroke": "#3a3a3a", "stroke-width": 0, - "text-shadow": "white 0px 0px 4px", + "style": "text-shadow: white 0px 0px 4px", "letter-spacing": 0, "data-size": 18, "font-size": 18, diff --git a/styles/gloom.json b/styles/gloom.json index 19318882..f06a67db 100644 --- a/styles/gloom.json +++ b/styles/gloom.json @@ -226,7 +226,7 @@ "#statesHalo": { "opacity": 0.5, "data-width": 12, - "stroke-width": 12, + "stroke-width": 10, "filter": "blur(10px)" }, "#provs": { @@ -331,64 +331,318 @@ "data-columns": 8 }, "#legendBox": {}, - "#burgLabels > #cities": { + "#burgLabels > g#capital": { "opacity": 1, "fill": "#3e3e4b", - "text-shadow": "white 0 0 2px", - "letter-spacing": 0, - "data-size": 8, - "font-size": 8, - "font-family": "Underdog" + "stroke": null, + "stroke-width": null, + "style": "text-shadow: white 0px 0px 4px", + "letter-spacing": null, + "data-size": 7, + "font-size": 7, + "font-family": "Underdog", + "data-dx": null, + "data-dy": -0.4 }, - "#burgIcons > #cities": { + "#burgIcons > g#capital": { + "data-icon": "#icon-watabou-capital", + "opacity": 1, + "font-size": 2, + "fill": "#8c8c8c", + "fill-opacity": 1, + "stroke": "#4D3F36", + "stroke-width": 1.4, + "stroke-dasharray": null, + "stroke-linecap": "round", + "stroke-linejoin": "round", + "filter": null + }, + "#anchors > g#capital": { "opacity": 1, "fill": "#ffffff", - "fill-opacity": 0.7, - "size": 2, - "stroke": "#444444", - "stroke-width": 0.25, - "stroke-dasharray": "", - "stroke-linecap": "butt" - }, - "#anchors > #cities": { - "opacity": 0.8, - "fill": "#ffffff", - "size": 4, + "font-size": 1.9, "stroke": "#3e3e4b", - "stroke-width": 1 + "stroke-width": 1.2, + "filter": null }, - "#burgLabels > #towns": { + "#burgLabels > g#city": { "opacity": 1, "fill": "#3e3e4b", - "text-shadow": "none", - "letter-spacing": 0, + "stroke": null, + "stroke-width": null, + "style": "text-shadow: white 0px 0px 2px", + "letter-spacing": null, + "data-size": 6, + "font-size": 6, + "font-family": "Underdog", + "data-dx": null, + "data-dy": -0.7 + }, + "#burgIcons > g#city": { + "data-icon": "#icon-watabou-city", + "opacity": 1, + "font-size": 2, + "fill": "#8c8c8c", + "fill-opacity": 1, + "stroke": "#4D3F36", + "stroke-width": 1.4, + "stroke-dasharray": null, + "stroke-linecap": "round", + "stroke-linejoin": "round", + "filter": null + }, + "#anchors > g#city": { + "opacity": 1, + "fill": "#ffffff", + "font-size": 1.2, + "stroke": "#3e3e4b", + "stroke-width": 1.2, + "filter": null + }, + "#burgLabels > g#fort": { + "opacity": 1, + "fill": "#3e3e4b", + "stroke": null, + "stroke-width": null, + "style": "text-shadow: white 0px 0px 4px", + "letter-spacing": null, + "data-size": 2, + "font-size": 2, + "font-family": "Underdog", + "data-dx": null, + "data-dy": -2 + }, + "#burgIcons > g#fort": { + "data-icon": "#icon-watabou-fort", + "opacity": 1, + "fill": "#8c8c8c", + "fill-opacity": 1, + "font-size": 2, + "stroke": "#4D3F36", + "stroke-width": 1.8, + "stroke-dasharray": null, + "stroke-linecap": "round", + "stroke-linejoin": "round", + "filter": null + }, + "#anchors > g#fort": { + "opacity": 1, + "fill": "#ffffff", + "font-size": 0.7, + "stroke": "#3e3e4b", + "stroke-width": 1.2, + "filter": null + }, + "#burgLabels > g#monastery": { + "opacity": 1, + "fill": "#3e3e4b", + "stroke": null, + "stroke-width": null, + "style": "text-shadow: white 0px 0px 4px", + "letter-spacing": null, + "data-size": 2, + "font-size": 2, + "font-family": "Underdog", + "data-dx": null, + "data-dy": -1.8 + }, + "#burgIcons > g#monastery": { + "opacity": 1, + "data-icon": "#icon-watabou-monastery", + "font-size": 2.3, + "fill": "#8c8c8c", + "fill-opacity": 1, + "stroke": "#4D3F36", + "stroke-width": 1.4, + "stroke-dasharray": null, + "stroke-linecap": "round", + "stroke-linejoin": "round", + "filter": null + }, + "#anchors > g#monastery": { + "opacity": 1, + "fill": "#ffffff", + "font-size": 0.7, + "stroke": "#3e3e4b", + "stroke-width": 1.2, + "filter": null + }, + "#burgLabels > g#caravanserai": { + "opacity": 1, + "fill": "#3e3e4b", + "stroke": null, + "stroke-width": null, + "style": "text-shadow: white 0px 0px 4px", + "letter-spacing": null, + "data-size": 2, + "font-size": 2, + "font-family": "Underdog", + "data-dx": null, + "data-dy": -1 + }, + "#burgIcons > g#caravanserai": { + "opacity": 1, + "data-icon": "#icon-watabou-caravanserai", + "font-size": 2.75, + "fill": "#8c8c8c", + "fill-opacity": 1, + "stroke": "#4D3F36", + "stroke-width": 1.4, + "stroke-dasharray": null, + "stroke-linecap": "round", + "stroke-linejoin": "round", + "filter": null + }, + "#anchors > g#caravanserai": { + "opacity": 1, + "fill": "#ffffff", + "font-size": 0.7, + "stroke": "#3e3e4b", + "stroke-width": 1.2, + "filter": null + }, + "#burgLabels > g#trading_post": { + "opacity": 1, + "fill": "#3e3e4b", + "stroke": null, + "stroke-width": null, + "style": "text-shadow: white 0px 0px 4px", + "letter-spacing": null, + "data-size": 2, + "font-size": 2, + "font-family": "Underdog", + "data-dx": null, + "data-dy": -1.2 + }, + "#burgIcons > g#trading_post": { + "opacity": 1, + "data-icon": "#icon-watabou-post", + "font-size": 2, + "fill": "#8c8c8c", + "fill-opacity": 1, + "stroke": "#4D3F36", + "stroke-width": 1.4, + "stroke-dasharray": null, + "stroke-linecap": "round", + "stroke-linejoin": "round", + "filter": null + }, + "#anchors > g#trading_post": { + "opacity": 1, + "fill": "#ffffff", + "font-size": 0.7, + "stroke": "#3e3e4b", + "stroke-width": 1.2, + "filter": null + }, + "#burgLabels > g#village": { + "opacity": 1, + "fill": "#3e3e4b", + "stroke": null, + "stroke-width": null, + "style": "text-shadow: white 0px 0px 4px", + "letter-spacing": null, + "data-size": 3, + "font-size": 3, + "font-family": "Underdog", + "data-dx": null, + "data-dy": -0.6 + }, + "#burgIcons > g#village": { + "opacity": 1, + "data-icon": "#icon-watabou-village", + "font-size": 1.7, + "fill": "#8c8c8c", + "fill-opacity": 1, + "stroke": "#4D3F36", + "stroke-width": 1.4, + "stroke-dasharray": null, + "stroke-linecap": "round", + "stroke-linejoin": "round", + "filter": null + }, + "#anchors > g#village": { + "opacity": 1, + "fill": "#ffffff", + "font-size": 0.7, + "stroke": "#3e3e4b", + "stroke-width": 1.2, + "filter": null + }, + "#burgLabels > g#hamlet": { + "opacity": 1, + "fill": "#3e3e4b", + "stroke": null, + "stroke-width": null, + "style": "text-shadow: white 0px 0px 4px", + "letter-spacing": null, + "data-size": 2, + "font-size": 2, + "font-family": "Underdog", + "data-dx": 0, + "data-dy": -1 + }, + "#burgIcons > g#hamlet": { + "opacity": 1, + "data-icon": "#icon-watabou-hamlet", + "font-size": 1.8, + "fill": "#8c8c8c", + "fill-opacity": 1, + "stroke": "#4D3F36", + "stroke-width": 1.4, + "stroke-dasharray": null, + "stroke-linecap": "round", + "stroke-linejoin": "round", + "filter": null + }, + "#anchors > g#hamlet": { + "opacity": 1, + "fill": "#ffffff", + "font-size": 0.5, + "stroke": "#3e3e4b", + "stroke-width": 1.2, + "filter": null + }, + "#burgLabels > g#town": { + "opacity": 1, + "fill": "#3e3e4b", + "stroke": null, + "stroke-width": null, + "style": "text-shadow: white 0px 0px 2px", + "letter-spacing": null, "data-size": 4, "font-size": 4, - "font-family": "Underdog" + "font-family": "Underdog", + "data-dx": null, + "data-dy": -0.6 }, - "#burgIcons > #towns": { - "opacity": 0.95, - "fill": "#ffffff", - "fill-opacity": 0.7, - "size": 0.8, - "stroke": "#3e3e4b", - "stroke-width": 0.2, - "stroke-dasharray": "", - "stroke-linecap": "butt" + "#burgIcons > g#town": { + "opacity": 1, + "data-icon": "#icon-watabou-town", + "font-size": 1.8, + "fill": "#8c8c8c", + "fill-opacity": 1, + "stroke": "#4D3F36", + "stroke-width": 1.4, + "stroke-dasharray": null, + "stroke-linecap": "round", + "stroke-linejoin": "round", + "filter": null }, - "#anchors > #towns": { + "#anchors > g#town": { "opacity": 1, "fill": "#ffffff", - "size": 1.6, + "font-size": 1, "stroke": "#3e3e4b", - "stroke-width": 1.2 + "stroke-width": 1.2, + "filter": null }, "#labels > #states": { "opacity": 1, "fill": "#4e4e4e", "stroke": "#b5b5b5", "stroke-width": 0, - "text-shadow": "white 0 0 2px", + "style": "text-shadow: white 0 0 2px", "letter-spacing": 0, "data-size": 20, "font-size": 20, @@ -400,7 +654,7 @@ "fill": "#3e3e4b", "stroke": "#3a3a3a", "stroke-width": 0, - "text-shadow": "white 0 0 4px", + "style": "text-shadow: white 0 0 4px", "letter-spacing": 0, "data-size": 18, "font-size": 18, diff --git a/styles/light.json b/styles/light.json index de539872..c28bbd97 100644 --- a/styles/light.json +++ b/styles/light.json @@ -328,64 +328,318 @@ "data-y": 62.98, "data-columns": 8 }, - "#burgLabels > #cities": { - "opacity": 1, - "fill": "#3a3a3a", - "text-shadow": "white 0px 0px 4px", - "letter-spacing": 0, - "data-size": 8, - "font-size": 8, - "font-family": "IM Fell English" - }, - "#burgIcons > #cities": { - "opacity": 1, - "fill": "#ffffff", - "fill-opacity": 0.7, - "size": 3, - "stroke": "#3e3e4b", - "stroke-width": 0.4, - "stroke-dasharray": "0.5 0.25", - "stroke-linecap": "butt" - }, - "#anchors > #cities": { - "opacity": 1, - "fill": "#ffffff", - "size": 5.5, - "stroke": "#3e3e4b", - "stroke-width": 1.2 - }, - "#burgLabels > #towns": { + "#burgLabels > g#capital": { "opacity": 1, "fill": "#3e3e4b", - "text-shadow": "white 0px 0px 4px", + "stroke": null, + "stroke-width": null, + "style": "text-shadow: white 0px 0px 4px", + "letter-spacing": 0, + "data-size": 7, + "font-size": 7, + "font-family": "IM Fell English", + "data-dx": null, + "data-dy": -0.4 + }, + "#burgIcons > g#capital": { + "data-icon": "#icon-star-circled", + "opacity": 1, + "font-size": 2, + "fill": "#ffffff", + "fill-opacity": 0.7, + "stroke": "#3e3e4b", + "stroke-width": 1, + "stroke-dasharray": null, + "stroke-linecap": "butt", + "stroke-linejoin": null, + "filter": null + }, + "#anchors > g#capital": { + "opacity": 1, + "fill": "#ffffff", + "font-size": 0.6, + "stroke": "#3e3e4b", + "stroke-width": 0.5, + "filter": null + }, + "#burgLabels > g#city": { + "opacity": 1, + "fill": "#3a3a3a", + "stroke": null, + "stroke-width": null, + "style": "text-shadow: white 0px 0px 4px", + "letter-spacing": 0, + "data-size": 6, + "font-size": 6, + "font-family": "IM Fell English", + "data-dx": null, + "data-dy": -0.4 + }, + "#burgIcons > g#city": { + "data-icon": "#icon-circled", + "opacity": 1, + "font-size": 1.8, + "fill": "#ffffff", + "fill-opacity": 0.7, + "stroke": "#3e3e4b", + "stroke-width": 1.2, + "stroke-dasharray": null, + "stroke-linecap": "butt", + "stroke-linejoin": null, + "filter": null + }, + "#anchors > g#city": { + "opacity": 1, + "fill": "#ffffff", + "font-size": 0.6, + "stroke": "#3e3e4b", + "stroke-width": 0.5, + "filter": null + }, + "#burgLabels > g#fort": { + "opacity": 1, + "fill": "#3e3e4b", + "stroke": null, + "stroke-width": null, + "style": "text-shadow: white 0px 0px 4px", + "letter-spacing": 0, + "data-size": 2, + "font-size": 2, + "font-family": "IM Fell English", + "data-dx": null, + "data-dy": -0.5 + }, + "#burgIcons > g#fort": { + "data-icon": "#icon-square", + "opacity": 1, + "font-size": 0.7, + "fill": "#ffffff", + "fill-opacity": 0.7, + "stroke": "#3e3e4b", + "stroke-width": 1, + "stroke-dasharray": null, + "stroke-linecap": "butt", + "stroke-linejoin": null, + "filter": null + }, + "#anchors > g#fort": { + "opacity": 1, + "fill": "#ffffff", + "font-size": 0.7, + "stroke": "#3e3e4b", + "stroke-width": 1.2, + "filter": null + }, + "#burgLabels > g#monastery": { + "opacity": 1, + "fill": "#3e3e4b", + "stroke": null, + "stroke-width": null, + "style": "text-shadow: white 0px 0px 4px", + "letter-spacing": 0, + "data-size": 2, + "font-size": 2, + "font-family": "IM Fell English", + "data-dx": null, + "data-dy": -0.5 + }, + "#burgIcons > g#monastery": { + "data-icon": "#icon-cross", + "opacity": 1, + "font-size": 0.8, + "fill": "#ffffff", + "fill-opacity": 0.7, + "stroke": "#3e3e4b", + "stroke-width": 1, + "stroke-dasharray": null, + "stroke-linecap": "butt", + "stroke-linejoin": null, + "filter": null + }, + "#anchors > g#monastery": { + "opacity": 1, + "fill": "#ffffff", + "font-size": 0.5, + "stroke": "#3e3e4b", + "stroke-width": 2, + "filter": null + }, + "#burgLabels > g#caravanserai": { + "opacity": 1, + "fill": "#3e3e4b", + "stroke": null, + "stroke-width": null, + "style": "text-shadow: white 0px 0px 4px", + "letter-spacing": 0, + "data-size": 2, + "font-size": 2, + "font-family": "IM Fell English", + "data-dx": null, + "data-dy": -0.5 + }, + "#burgIcons > g#caravanserai": { + "data-icon": "#icon-triangle", + "opacity": 1, + "font-size": 0.7, + "fill": "#ffffff", + "fill-opacity": 0.7, + "stroke": "#3e3e4b", + "stroke-width": 1, + "stroke-dasharray": null, + "stroke-linecap": "butt", + "stroke-linejoin": null, + "filter": null + }, + "#anchors > g#caravanserai": { + "opacity": 1, + "fill": "#ffffff", + "font-size": 0.7, + "stroke": "#3e3e4b", + "stroke-width": 1.2, + "filter": null + }, + "#burgLabels > g#trading_post": { + "opacity": 1, + "fill": "#3e3e4b", + "stroke": null, + "stroke-width": null, + "style": "text-shadow: white 0px 0px 4px", + "letter-spacing": 0, + "data-size": 2, + "font-size": 2, + "font-family": "IM Fell English", + "data-dx": null, + "data-dy": -0.5 + }, + "#burgIcons > g#trading_post": { + "data-icon": "#icon-triangle", + "opacity": 1, + "font-size": 0.7, + "fill": "#ffffff", + "fill-opacity": 0.7, + "stroke": "#3e3e4b", + "stroke-width": 1, + "stroke-dasharray": null, + "stroke-linecap": "butt", + "stroke-linejoin": null, + "filter": null + }, + "#anchors > g#trading_post": { + "opacity": 1, + "fill": "#ffffff", + "font-size": 0.7, + "stroke": "#3e3e4b", + "stroke-width": 1.2, + "filter": null + }, + "#burgLabels > g#village": { + "opacity": 1, + "fill": "#3e3e4b", + "stroke": null, + "stroke-width": null, + "style": "text-shadow: white 0px 0px 4px", + "letter-spacing": 0, + "data-size": 3, + "font-size": 3, + "font-family": "IM Fell English", + "data-dx": null, + "data-dy": -0.4 + }, + "#burgIcons > g#village": { + "data-icon": "#icon-circle", + "opacity": 1, + "font-size": 0.8, + "fill": "#ffffff", + "fill-opacity": 0.7, + "stroke": "#3e3e4b", + "stroke-width": 1.2, + "stroke-dasharray": null, + "stroke-linecap": "butt", + "stroke-linejoin": null, + "filter": null + }, + "#anchors > g#village": { + "opacity": 1, + "fill": "#ffffff", + "font-size": 0.5, + "stroke": "#3e3e4b", + "stroke-width": 1.8, + "filter": null + }, + "#burgLabels > g#hamlet": { + "opacity": 1, + "fill": "#3e3e4b", + "stroke": null, + "stroke-width": null, + "style": "text-shadow: white 0px 0px 4px", + "letter-spacing": 0, + "data-size": 2, + "font-size": 2, + "font-family": "IM Fell English", + "data-dx": null, + "data-dy": -0.4 + }, + "#burgIcons > g#hamlet": { + "data-icon": "#icon-circle", + "opacity": 1, + "font-size": 0.5, + "fill": "#ffffff", + "fill-opacity": 0.7, + "stroke": "#3e3e4b", + "stroke-width": 1.2, + "stroke-dasharray": null, + "stroke-linecap": "butt", + "stroke-linejoin": null, + "filter": null + }, + "#anchors > g#hamlet": { + "opacity": 1, + "fill": "#ffffff", + "font-size": 0.4, + "stroke": "#3e3e4b", + "stroke-width": 1.6, + "filter": null + }, + "#burgLabels > g#town": { + "opacity": 1, + "fill": "#3e3e4b", + "stroke": null, + "stroke-width": null, + "style": "text-shadow: white 0px 0px 4px", "letter-spacing": 0, "data-size": 4, "font-size": 4, - "font-family": "IM Fell English" + "font-family": "IM Fell English", + "data-dx": null, + "data-dy": -0.4 }, - "#burgIcons > #towns": { + "#burgIcons > g#town": { + "data-icon": "#icon-circle", "opacity": 1, + "font-size": 1, "fill": "#ffffff", "fill-opacity": 0.7, - "size": 1.2, "stroke": "#3e3e4b", - "stroke-width": 0.2, - "stroke-dasharray": "", - "stroke-linecap": "butt" + "stroke-width": 1.2, + "stroke-dasharray": null, + "stroke-linecap": "butt", + "stroke-linejoin": null, + "filter": null }, - "#anchors > #towns": { + "#anchors > g#town": { "opacity": 1, "fill": "#ffffff", - "size": 2.2, + "font-size": 0.6, "stroke": "#3e3e4b", - "stroke-width": 1.2 + "stroke-width": 2, + "filter": null }, "#labels > #states": { "opacity": 1, "fill": "#3e3e3e", "stroke": "#000000", "stroke-width": 0.3, - "text-shadow": "white 0px 0px 6px", + "style": "text-shadow: white 0px 0px 6px", "letter-spacing": 0, "data-size": 14, "font-size": 14, @@ -397,7 +651,7 @@ "fill": "#f24706", "stroke": "#701b05", "stroke-width": 0.1, - "text-shadow": "white 0px 0px 4px", + "style": "text-shadow: white 0px 0px 4px", "letter-spacing": 0, "data-size": 6, "font-size": 6, diff --git a/styles/monochrome.json b/styles/monochrome.json index 1ee17c43..f05e2a37 100644 --- a/styles/monochrome.json +++ b/styles/monochrome.json @@ -324,55 +324,260 @@ "data-columns": 8 }, "#legendBox": {}, - "#burgLabels > #cities": { + "#burgLabels > g#city": { "opacity": 1, "fill": "#000000", - "text-shadow": "white 0px 0px 4px", "letter-spacing": 0, "data-size": 7, "font-size": 7, - "font-family": "Courier New" + "font-family": "Courier New", + "data-dy": -0.4 }, - "#burgIcons > #cities": { + "#burgIcons > g#city": { + "data-icon": "#icon-circle", "opacity": 1, "fill": "#ffffff", "fill-opacity": 0.7, - "size": 1, + "font-size": 1.5, "stroke": "#3e3e4b", - "stroke-width": 0.24, + "stroke-width": 1, "stroke-dasharray": "", "stroke-linecap": "butt" }, - "#anchors > #cities": { + "#anchors > g#city": { "opacity": 1, "fill": "#ffffff", - "size": 2, + "font-size": 1.5, "stroke": "#3e3e4b", "stroke-width": 1.2 }, - "#burgLabels > #towns": { + "#burgLabels > g#town": { "opacity": 1, "fill": "#000000", - "text-shadow": "white 0px 0px 4px", "letter-spacing": 0, "data-size": 4, "font-size": 4, - "font-family": "Courier New" + "font-family": "Courier New", + "data-dy": -0.4 }, - "#burgIcons > #towns": { + "#burgIcons > g#town": { + "data-icon": "#icon-circle", "opacity": 1, "fill": "#ffffff", "fill-opacity": 0.7, - "size": 0.5, + "font-size": 1, "stroke": "#3e3e4b", - "stroke-width": 0.12, + "stroke-width": 1.2, "stroke-dasharray": "", "stroke-linecap": "butt" }, - "#anchors > #towns": { + "#anchors > g#town": { "opacity": 1, "fill": "#ffffff", - "size": 1, + "font-size": 1, + "stroke": "#3e3e4b", + "stroke-width": 1.2 + }, + "#burgLabels > g#capital": { + "opacity": 1, + "fill": "#3e3e4b", + "style": "text-shadow: white 0px 0px 4px", + "letter-spacing": 0, + "data-size": 7, + "font-size": 7, + "font-family": "Courier New", + "data-dy": -0.4 + }, + "#burgIcons > g#capital": { + "data-icon": "#icon-square", + "opacity": 1, + "fill": "#ffffff", + "fill-opacity": 0.7, + "font-size": 2, + "stroke": "#3e3e4b", + "stroke-width": 1, + "stroke-dasharray": null, + "stroke-linecap": "butt", + "stroke-linejoin": "round" + }, + "#anchors > g#capital": { + "opacity": 1, + "fill": "#ffffff", + "font-size": 1.9, + "stroke": "#3e3e4b", + "stroke-width": 1.2 + }, + "#burgLabels > g#fort": { + "opacity": 1, + "fill": "#3e3e4b", + "style": "text-shadow: white 0px 0px 4px", + "letter-spacing": 0, + "data-size": 2, + "font-size": 2, + "font-family": "Courier New", + "data-dy": -0.4 + }, + "#burgIcons > g#fort": { + "data-icon": "#icon-triangle", + "opacity": 1, + "fill": "#ffffff", + "fill-opacity": 0.7, + "font-size": 0.7, + "stroke": "#3e3e4b", + "stroke-width": 1, + "stroke-dasharray": null, + "stroke-linecap": "butt", + "stroke-linejoin": "round" + }, + "#anchors > g#fort": { + "opacity": 1, + "fill": "#ffffff", + "font-size": 0.7, + "stroke": "#3e3e4b", + "stroke-width": 1.2 + }, + "#burgLabels > g#monastery": { + "opacity": 1, + "fill": "#3e3e4b", + "style": "text-shadow: white 0px 0px 4px", + "letter-spacing": 0, + "data-size": 2, + "font-size": 2, + "font-family": "Courier New", + "data-dy": -0.4 + }, + "#burgIcons > g#monastery": { + "data-icon": "#icon-cross", + "opacity": 1, + "fill": "#ffffff", + "fill-opacity": 0.7, + "font-size": 0.7, + "stroke": "#3e3e4b", + "stroke-width": 1, + "stroke-dasharray": null, + "stroke-linecap": "butt", + "stroke-linejoin": "round" + }, + "#anchors > g#monastery": { + "opacity": 1, + "fill": "#ffffff", + "font-size": 0.7, + "stroke": "#3e3e4b", + "stroke-width": 1.2 + }, + "#burgLabels > g#caravanserai": { + "opacity": 1, + "fill": "#3e3e4b", + "style": "text-shadow: white 0px 0px 4px", + "letter-spacing": 0, + "data-size": 2, + "font-size": 2, + "font-family": "Courier New", + "data-dy": -0.4 + }, + "#burgIcons > g#caravanserai": { + "data-icon": "#icon-triangle", + "opacity": 1, + "fill": "#ffffff", + "fill-opacity": 0.7, + "font-size": 0.7, + "stroke": "#3e3e4b", + "stroke-width": 1, + "stroke-dasharray": null, + "stroke-linecap": "butt", + "stroke-linejoin": "round" + }, + "#anchors > g#caravanserai": { + "opacity": 1, + "fill": "#ffffff", + "font-size": 0.7, + "stroke": "#3e3e4b", + "stroke-width": 1.2 + }, + "#burgLabels > g#trading_post": { + "opacity": 1, + "fill": "#3e3e4b", + "style": "text-shadow: white 0px 0px 4px", + "letter-spacing": 0, + "data-size": 2, + "font-size": 2, + "font-family": "Courier New", + "data-dy": -0.4 + }, + "#burgIcons > g#trading_post": { + "data-icon": "#icon-triangle", + "opacity": 1, + "fill": "#ffffff", + "fill-opacity": 0.7, + "font-size": 0.7, + "stroke": "#3e3e4b", + "stroke-width": 1, + "stroke-dasharray": null, + "stroke-linecap": "butt", + "stroke-linejoin": "round" + }, + "#anchors > g#trading_post": { + "opacity": 1, + "fill": "#ffffff", + "font-size": 0.7, + "stroke": "#3e3e4b", + "stroke-width": 1.2 + }, + "#burgLabels > g#village": { + "opacity": 1, + "fill": "#3e3e4b", + "style": "text-shadow: white 0px 0px 4px", + "letter-spacing": 0, + "data-size": 3, + "font-size": 3, + "font-family": "Courier New", + "data-dy": -0.4 + }, + "#burgIcons > g#village": { + "data-icon": "#icon-circle", + "opacity": 1, + "fill": "#ffffff", + "fill-opacity": 0.7, + "font-size": 0.7, + "stroke": "#3e3e4b", + "stroke-width": 1.2, + "stroke-dasharray": null, + "stroke-linecap": "butt", + "stroke-linejoin": "round" + }, + "#anchors > g#village": { + "opacity": 1, + "fill": "#ffffff", + "font-size": 0.7, + "stroke": "#3e3e4b", + "stroke-width": 1.2 + }, + "#burgLabels > g#hamlet": { + "opacity": 1, + "fill": "#3e3e4b", + "style": "text-shadow: white 0px 0px 4px", + "letter-spacing": 0, + "data-size": 2, + "font-size": 2, + "font-family": "Courier New", + "data-dy": -0.4 + }, + "#burgIcons > g#hamlet": { + "data-icon": "#icon-circle", + "opacity": 1, + "fill": "#ffffff", + "fill-opacity": 0.7, + "font-size": 0.5, + "stroke": "#3e3e4b", + "stroke-width": 1.2, + "stroke-dasharray": null, + "stroke-linecap": "butt", + "stroke-linejoin": "round" + }, + "#anchors > g#hamlet": { + "opacity": 1, + "fill": "#ffffff", + "font-size": 0.5, "stroke": "#3e3e4b", "stroke-width": 1.2 }, @@ -381,7 +586,7 @@ "fill": "#000000", "stroke": "#3a3a3a", "stroke-width": 0, - "text-shadow": "white 0px 0px 4px", + "style": "text-shadow: white 0px 0px 4px", "letter-spacing": 0, "data-size": 18, "font-size": 18, @@ -393,7 +598,7 @@ "fill": "#3e3e4b", "stroke": "#3a3a3a", "stroke-width": 0, - "text-shadow": "white 0px 0px 4px", + "style": "text-shadow: white 0px 0px 4px", "letter-spacing": 0, "data-size": 18, "font-size": 18, diff --git a/styles/night.json b/styles/night.json index 67a5e799..d890db4e 100644 --- a/styles/night.json +++ b/styles/night.json @@ -328,64 +328,271 @@ "data-y": 99.37, "data-columns": null }, - "#burgLabels > #cities": { + "#burgLabels > g#city": { "opacity": 1, "fill": "#dbdbe1", - "text-shadow": "black 0px 0px 4px", + "style": "text-shadow: black 0px 0px 4px", "letter-spacing": 0, - "data-size": 8, - "font-size": 8, - "font-family": "Courier New" + "data-size": 7, + "font-size": 7, + "font-family": "Courier New", + "data-dy": -0.4 }, - "#burgIcons > #cities": { + "#burgIcons > g#city": { + "data-icon": "#icon-circle", "opacity": 1, "fill": "#ffffff", "fill-opacity": 0.7, - "size": 2.1, + "font-size": 2, "stroke": "#000000", - "stroke-width": 0.2, + "stroke-width": 1, "stroke-dasharray": "", "stroke-linecap": "butt" }, - "#anchors > #cities": { + "#anchors > g#city": { "opacity": 1, "fill": "#ffffff", - "size": 4.2, + "font-size": 2, "stroke": "#000000", "stroke-width": 1.46 }, - "#burgLabels > #towns": { + "#burgLabels > g#town": { "opacity": 1, "fill": "#ffffff", - "text-shadow": "black 0px 0px 4px", + "style": "text-shadow: black 0px 0px 4px", "letter-spacing": 0, - "data-size": 4.28, - "font-size": 4.28, - "font-family": "Courier New" + "data-size": 4, + "font-size": 4, + "font-family": "Courier New", + "data-dy": -0.4 }, - "#burgIcons > #towns": { + "#burgIcons > g#town": { + "data-icon": "#icon-circle", "opacity": 1, "fill": "#ffffff", "fill-opacity": 0.7, - "size": 0.8, + "font-size": 1, "stroke": "#000000", - "stroke-width": 0.1, + "stroke-width": 1, "stroke-dasharray": "", "stroke-linecap": "butt" }, - "#anchors > #towns": { + "#anchors > g#town": { "opacity": 1, "fill": "#ffffff", - "size": 1.6, + "font-size": 1, "stroke": "#000000", "stroke-width": 1.53 }, + "#burgLabels > g#capital": { + "opacity": 1, + "fill": "#ffffff", + "style": "text-shadow: black 0px 0px 4px", + "letter-spacing": 0, + "data-size": 8, + "font-size": 8, + "font-family": "Courier New", + "data-dy": -0.4 + }, + "#burgIcons > g#capital": { + "data-icon": "#icon-square", + "opacity": 1, + "fill": "#ffffff", + "fill-opacity": 0.7, + "font-size": 2, + "stroke": "#000000", + "stroke-width": 1, + "stroke-dasharray": null, + "stroke-linecap": "butt", + "stroke-linejoin": "round" + }, + "#anchors > g#capital": { + "opacity": 1, + "fill": "#ffffff", + "font-size": 1.9, + "stroke": "#3e3e4b", + "stroke-width": 1.2 + }, + "#burgLabels > g#fort": { + "opacity": 1, + "fill": "#ffffff", + "style": "text-shadow: black 0px 0px 4px", + "letter-spacing": 0, + "data-size": 3, + "font-size": 3, + "font-family": "Courier New", + "data-dy": -0.4 + }, + "#burgIcons > g#fort": { + "data-icon": "#icon-triangle", + "opacity": 1, + "fill": "#ffffff", + "fill-opacity": 0.7, + "font-size": 0.7, + "stroke": "#000000", + "stroke-width": 1, + "stroke-dasharray": null, + "stroke-linecap": "butt", + "stroke-linejoin": "round" + }, + "#anchors > g#fort": { + "opacity": 1, + "fill": "#ffffff", + "font-size": 0.7, + "stroke": "#3e3e4b", + "stroke-width": 1.2 + }, + "#burgLabels > g#monastery": { + "opacity": 1, + "fill": "#ffffff", + "style": "text-shadow: black 0px 0px 4px", + "letter-spacing": 0, + "data-size": 3, + "font-size": 3, + "font-family": "Courier New", + "data-dy": -0.4 + }, + "#burgIcons > g#monastery": { + "data-icon": "#icon-cross", + "opacity": 1, + "fill": "#ffffff", + "fill-opacity": 0.7, + "font-size": 0.7, + "stroke": "#000000", + "stroke-width": 1, + "stroke-dasharray": null, + "stroke-linecap": "butt", + "stroke-linejoin": "round" + }, + "#anchors > g#monastery": { + "opacity": 1, + "fill": "#ffffff", + "font-size": 0.7, + "stroke": "#3e3e4b", + "stroke-width": 1.2 + }, + "#burgLabels > g#caravanserai": { + "opacity": 1, + "fill": "#ffffff", + "style": "text-shadow: black 0px 0px 4px", + "letter-spacing": 0, + "data-size": 3, + "font-size": 3, + "font-family": "Courier New", + "data-dy": -0.4 + }, + "#burgIcons > g#caravanserai": { + "data-icon": "#icon-triangle", + "opacity": 1, + "fill": "#ffffff", + "fill-opacity": 0.7, + "font-size": 0.7, + "stroke": "#000000", + "stroke-width": 1, + "stroke-dasharray": null, + "stroke-linecap": "butt", + "stroke-linejoin": "round" + }, + "#anchors > g#caravanserai": { + "opacity": 1, + "fill": "#ffffff", + "font-size": 0.7, + "stroke": "#3e3e4b", + "stroke-width": 1.2 + }, + "#burgLabels > g#trading_post": { + "opacity": 1, + "fill": "#ffffff", + "style": "text-shadow: black 0px 0px 4px", + "letter-spacing": 0, + "data-size": 3, + "font-size": 3, + "font-family": "Courier New", + "data-dy": -0.4 + }, + "#burgIcons > g#trading_post": { + "data-icon": "#icon-triangle", + "opacity": 1, + "fill": "#ffffff", + "fill-opacity": 0.7, + "font-size": 0.7, + "stroke": "#000000", + "stroke-width": 1, + "stroke-dasharray": null, + "stroke-linecap": "butt", + "stroke-linejoin": "round" + }, + "#anchors > g#trading_post": { + "opacity": 1, + "fill": "#ffffff", + "font-size": 0.7, + "stroke": "#3e3e4b", + "stroke-width": 1.2 + }, + "#burgLabels > g#village": { + "opacity": 1, + "fill": "#ffffff", + "style": "text-shadow: black 0px 0px 4px", + "letter-spacing": 0, + "data-size": 3, + "font-size": 3, + "font-family": "Courier New", + "data-dy": -0.4 + }, + "#burgIcons > g#village": { + "data-icon": "#icon-circle", + "opacity": 1, + "fill": "#ffffff", + "fill-opacity": 0.7, + "font-size": 0.7, + "stroke": "#000000", + "stroke-width": 1.2, + "stroke-dasharray": null, + "stroke-linecap": "butt", + "stroke-linejoin": "round" + }, + "#anchors > g#village": { + "opacity": 1, + "fill": "#ffffff", + "font-size": 0.7, + "stroke": "#3e3e4b", + "stroke-width": 1.2 + }, + "#burgLabels > g#hamlet": { + "opacity": 1, + "fill": "#ffffff", + "style": "text-shadow: black 0px 0px 4px", + "letter-spacing": 0, + "data-size": 3, + "font-size": 3, + "font-family": "Courier New", + "data-dy": -0.4 + }, + "#burgIcons > g#hamlet": { + "data-icon": "#icon-circle", + "opacity": 1, + "fill": "#ffffff", + "fill-opacity": 0.7, + "font-size": 0.5, + "stroke": "#000000", + "stroke-width": 1.2, + "stroke-dasharray": null, + "stroke-linecap": "butt", + "stroke-linejoin": "round" + }, + "#anchors > g#hamlet": { + "opacity": 1, + "fill": "#ffffff", + "font-size": 0.5, + "stroke": "#3e3e4b", + "stroke-width": 1.2 + }, "#labels > #states": { "opacity": 1, "fill": "#5d77a2", "stroke": "#7a83ae", "stroke-width": 0.3, - "text-shadow": "black 0px 0px 0.1px", + "style": "text-shadow: black 0px 0px 0.1px", "letter-spacing": 0, "data-size": 14, "font-size": 14, @@ -397,7 +604,7 @@ "fill": "#3e3e4b", "stroke": "#3a3a3a", "stroke-width": 0, - "text-shadow": "black 0px 0px 4px", + "style": "text-shadow: black 0px 0px 4px", "letter-spacing": 0, "data-size": 18, "font-size": 18, diff --git a/styles/pale.json b/styles/pale.json index 8e839600..b9ce1a6b 100644 --- a/styles/pale.json +++ b/styles/pale.json @@ -328,64 +328,271 @@ "data-y": 62.98, "data-columns": 8 }, - "#burgLabels > #cities": { + "#burgLabels > g#city": { "opacity": 0.8, "fill": "#3a3a3a", - "text-shadow": "white 0px 0px 4px", + "style": "text-shadow: white 0px 0px 4px", "letter-spacing": 0, "data-size": 7, "font-size": 7, - "font-family": "Arima Madurai" + "font-family": "Arima Madurai", + "data-dy": -0.4 }, - "#burgIcons > #cities": { + "#burgIcons > g#city": { + "data-icon": "#icon-circle", "opacity": 1, "fill": "#ffffff", "fill-opacity": 0.7, - "size": 1.5, + "font-size": 1.5, "stroke": "#4f4f4f", - "stroke-width": 0.2, + "stroke-width": 1, "stroke-dasharray": "", "stroke-linecap": "butt" }, - "#anchors > #cities": { + "#anchors > g#city": { "opacity": 1, "fill": "#ffffff", - "size": 3, + "font-size": 1.5, "stroke": "#3e3e4b", "stroke-width": 1.2 }, - "#burgLabels > #towns": { + "#burgLabels > g#town": { "opacity": 0.8, - "fill": "#3e3e4b", - "text-shadow": "white 0px 0px 4px", + "fill": "#3a3a3a", + "style": "text-shadow: white 0px 0px 4px", "letter-spacing": 0, "data-size": 4, "font-size": 4, - "font-family": "Arima Madurai" + "font-family": "Arima Madurai", + "data-dy": -0.4 }, - "#burgIcons > #towns": { + "#burgIcons > g#town": { + "data-icon": "#icon-circle", "opacity": 1, "fill": "#ffffff", "fill-opacity": 0.7, - "size": 0.6, + "font-size": 0.6, "stroke": "#4f4f4f", - "stroke-width": 0.12, + "stroke-width": 1, "stroke-dasharray": "", "stroke-linecap": "butt" }, - "#anchors > #towns": { + "#anchors > g#town": { "opacity": 1, "fill": "#ffffff", - "size": 1.2, + "font-size": 0.6, "stroke": "#3e3e4b", "stroke-width": 1 }, + "#burgLabels > g#capital": { + "opacity": 0.8, + "fill": "#3a3a3a", + "style": "text-shadow: white 0px 0px 4px", + "letter-spacing": 0, + "data-size": 7, + "font-size": 7, + "font-family": "Arima Madurai", + "data-dy": -0.4 + }, + "#burgIcons > g#capital": { + "data-icon": "#icon-square", + "opacity": 1, + "fill": "#ffffff", + "fill-opacity": 0.7, + "font-size": 2, + "stroke": "#3e3e4b", + "stroke-width": 1, + "stroke-dasharray": null, + "stroke-linecap": "butt", + "stroke-linejoin": "round" + }, + "#anchors > g#capital": { + "opacity": 1, + "fill": "#ffffff", + "font-size": 1.9, + "stroke": "#3e3e4b", + "stroke-width": 1.2 + }, + "#burgLabels > g#fort": { + "opacity": 0.8, + "fill": "#3a3a3a", + "style": "text-shadow: white 0px 0px 4px", + "letter-spacing": 0, + "data-size": 2, + "font-size": 2, + "font-family": "Arima Madurai", + "data-dy": -0.4 + }, + "#burgIcons > g#fort": { + "data-icon": "#icon-triangle", + "opacity": 1, + "fill": "#ffffff", + "fill-opacity": 0.7, + "font-size": 0.7, + "stroke": "#3e3e4b", + "stroke-width": 1, + "stroke-dasharray": null, + "stroke-linecap": "butt", + "stroke-linejoin": "round" + }, + "#anchors > g#fort": { + "opacity": 1, + "fill": "#ffffff", + "font-size": 0.7, + "stroke": "#3e3e4b", + "stroke-width": 1.2 + }, + "#burgLabels > g#monastery": { + "opacity": 0.8, + "fill": "#3a3a3a", + "style": "text-shadow: white 0px 0px 4px", + "letter-spacing": 0, + "data-size": 2, + "font-size": 2, + "font-family": "Arima Madurai", + "data-dy": -0.4 + }, + "#burgIcons > g#monastery": { + "data-icon": "#icon-cross", + "opacity": 1, + "fill": "#ffffff", + "fill-opacity": 0.7, + "font-size": 0.7, + "stroke": "#3e3e4b", + "stroke-width": 1, + "stroke-dasharray": null, + "stroke-linecap": "butt", + "stroke-linejoin": "round" + }, + "#anchors > g#monastery": { + "opacity": 1, + "fill": "#ffffff", + "font-size": 0.7, + "stroke": "#3e3e4b", + "stroke-width": 1.2 + }, + "#burgLabels > g#caravanserai": { + "opacity": 0.8, + "fill": "#3a3a3a", + "style": "text-shadow: white 0px 0px 4px", + "letter-spacing": 0, + "data-size": 2, + "font-size": 2, + "font-family": "Arima Madurai", + "data-dy": -0.4 + }, + "#burgIcons > g#caravanserai": { + "data-icon": "#icon-triangle", + "opacity": 1, + "fill": "#ffffff", + "fill-opacity": 0.7, + "font-size": 0.7, + "stroke": "#3e3e4b", + "stroke-width": 1, + "stroke-dasharray": null, + "stroke-linecap": "butt", + "stroke-linejoin": "round" + }, + "#anchors > g#caravanserai": { + "opacity": 1, + "fill": "#ffffff", + "font-size": 0.7, + "stroke": "#3e3e4b", + "stroke-width": 1.2 + }, + "#burgLabels > g#trading_post": { + "opacity": 0.8, + "fill": "#3a3a3a", + "style": "text-shadow: white 0px 0px 4px", + "letter-spacing": 0, + "data-size": 2, + "font-size": 2, + "font-family": "Arima Madurai", + "data-dy": -0.4 + }, + "#burgIcons > g#trading_post": { + "data-icon": "#icon-triangle", + "opacity": 1, + "fill": "#ffffff", + "fill-opacity": 0.7, + "font-size": 0.7, + "stroke": "#3e3e4b", + "stroke-width": 1, + "stroke-dasharray": null, + "stroke-linecap": "butt", + "stroke-linejoin": "round" + }, + "#anchors > g#trading_post": { + "opacity": 1, + "fill": "#ffffff", + "font-size": 0.7, + "stroke": "#3e3e4b", + "stroke-width": 1.2 + }, + "#burgLabels > g#village": { + "opacity": 0.8, + "fill": "#3a3a3a", + "style": "text-shadow: white 0px 0px 4px", + "letter-spacing": 0, + "data-size": 3, + "font-size": 3, + "font-family": "Arima Madurai", + "data-dy": -0.4 + }, + "#burgIcons > g#village": { + "data-icon": "#icon-circle", + "opacity": 1, + "fill": "#ffffff", + "fill-opacity": 0.7, + "font-size": 0.7, + "stroke": "#3e3e4b", + "stroke-width": 1.2, + "stroke-dasharray": null, + "stroke-linecap": "butt", + "stroke-linejoin": "round" + }, + "#anchors > g#village": { + "opacity": 1, + "fill": "#ffffff", + "font-size": 0.7, + "stroke": "#3e3e4b", + "stroke-width": 1.2 + }, + "#burgLabels > g#hamlet": { + "opacity": 0.8, + "fill": "#3a3a3a", + "style": "text-shadow: white 0px 0px 4px", + "letter-spacing": 0, + "data-size": 2, + "font-size": 2, + "font-family": "Arima Madurai", + "data-dy": -0.4 + }, + "#burgIcons > g#hamlet": { + "data-icon": "#icon-circle", + "opacity": 1, + "fill": "#ffffff", + "fill-opacity": 0.7, + "font-size": 0.5, + "stroke": "#3e3e4b", + "stroke-width": 1.2, + "stroke-dasharray": null, + "stroke-linecap": "butt", + "stroke-linejoin": "round" + }, + "#anchors > g#hamlet": { + "opacity": 1, + "fill": "#ffffff", + "font-size": 0.5, + "stroke": "#3e3e4b", + "stroke-width": 1.2 + }, "#labels > #states": { "opacity": 0.8, - "fill": "#3e3e3e", + "fill": "#3a3a3a", "stroke": "#000000", "stroke-width": 0, - "text-shadow": "white 0px 0px 6px", + "style": "text-shadow: white 0px 0px 6px", "letter-spacing": 0, "data-size": 14, "font-size": 14, @@ -397,7 +604,7 @@ "fill": "#f24706", "stroke": "#701b05", "stroke-width": 0.1, - "text-shadow": "white 0px 0px 4px", + "style": "text-shadow: white 0px 0px 4px", "letter-spacing": 0, "data-size": 6, "font-size": 6, diff --git a/styles/watercolor.json b/styles/watercolor.json index 982c1b49..b1632825 100644 --- a/styles/watercolor.json +++ b/styles/watercolor.json @@ -328,55 +328,262 @@ "data-y": 93, "data-columns": 8 }, - "#burgLabels > #cities": { + "#burgLabels > g#city": { "opacity": 1, "fill": "#043449", - "text-shadow": "white 0px 0px 2px", + "style": "text-shadow: white 0px 0px 2px", "letter-spacing": 0, "data-size": 5, "font-size": 5, - "font-family": "Comfortaa" + "font-family": "Comfortaa", + "data-dy": -0.4 }, - "#burgIcons > #cities": { + "#burgIcons > g#city": { + "data-icon": "#icon-circle", "opacity": 1, "fill": "#ffffff", "fill-opacity": 0.7, - "size": 1, + "font-size": 1.5, "stroke": "#3e3e4b", - "stroke-width": 0.24, + "stroke-width": 1.2, "stroke-dasharray": "", "stroke-linecap": "butt" }, - "#anchors > #cities": { + "#anchors > g#city": { "opacity": 1, "fill": "#ffffff", - "size": 2, + "font-size": 1.5, "stroke": "#3e3e4b", "stroke-width": 1.2 }, - "#burgLabels > #towns": { + "#burgLabels > g#town": { "opacity": 1, - "fill": "#3e3e4b", - "text-shadow": "white 0px 0px 4px", + "fill": "#043449", + "style": "text-shadow: white 0px 0px 4px", "letter-spacing": 0, "data-size": 3, "font-size": 3, - "font-family": "Comfortaa" + "font-family": "Comfortaa", + "data-dy": -0.4 }, - "#burgIcons > #towns": { + "#burgIcons > g#town": { + "data-icon": "#icon-circle", "opacity": 1, "fill": "#ffffff", "fill-opacity": 0.7, - "size": 0.5, + "font-size": 1, "stroke": "#3e3e4b", - "stroke-width": 0.12, + "stroke-width": 1.2, "stroke-dasharray": "", "stroke-linecap": "butt" }, - "#anchors > #towns": { + "#anchors > g#town": { "opacity": 1, "fill": "#ffffff", - "size": 1, + "font-size": 1, + "stroke": "#3e3e4b", + "stroke-width": 1.2 + }, + "#burgLabels > g#capital": { + "opacity": 1, + "fill": "#043449", + "style": "text-shadow: white 0px 0px 4px", + "letter-spacing": 0, + "data-size": 7, + "font-size": 7, + "font-family": "Comfortaa", + "data-dy": -0.4 + }, + "#burgIcons > g#capital": { + "data-icon": "#icon-square", + "opacity": 1, + "fill": "#ffffff", + "fill-opacity": 0.7, + "font-size": 2, + "stroke": "#3e3e4b", + "stroke-width": 1, + "stroke-dasharray": null, + "stroke-linecap": "butt", + "stroke-linejoin": "round" + }, + "#anchors > g#capital": { + "opacity": 1, + "fill": "#ffffff", + "font-size": 1.9, + "stroke": "#3e3e4b", + "stroke-width": 1.2 + }, + "#burgLabels > g#fort": { + "opacity": 1, + "fill": "#043449", + "style": "text-shadow: white 0px 0px 4px", + "letter-spacing": 0, + "data-size": 2, + "font-size": 2, + "font-family": "Comfortaa", + "data-dy": -0.4 + }, + "#burgIcons > g#fort": { + "data-icon": "#icon-triangle", + "opacity": 1, + "fill": "#ffffff", + "fill-opacity": 0.7, + "font-size": 0.7, + "stroke": "#3e3e4b", + "stroke-width": 1, + "stroke-dasharray": null, + "stroke-linecap": "butt", + "stroke-linejoin": "round" + }, + "#anchors > g#fort": { + "opacity": 1, + "fill": "#ffffff", + "font-size": 0.7, + "stroke": "#3e3e4b", + "stroke-width": 1.2 + }, + "#burgLabels > g#monastery": { + "opacity": 1, + "fill": "#043449", + "style": "text-shadow: white 0px 0px 4px", + "letter-spacing": 0, + "data-size": 2, + "font-size": 2, + "font-family": "Comfortaa", + "data-dy": -0.4 + }, + "#burgIcons > g#monastery": { + "data-icon": "#icon-cross", + "opacity": 1, + "fill": "#ffffff", + "fill-opacity": 0.7, + "font-size": 0.7, + "stroke": "#3e3e4b", + "stroke-width": 1, + "stroke-dasharray": null, + "stroke-linecap": "butt", + "stroke-linejoin": "round" + }, + "#anchors > g#monastery": { + "opacity": 1, + "fill": "#ffffff", + "font-size": 0.7, + "stroke": "#3e3e4b", + "stroke-width": 1.2 + }, + "#burgLabels > g#caravanserai": { + "opacity": 1, + "fill": "#043449", + "style": "text-shadow: white 0px 0px 4px", + "letter-spacing": 0, + "data-size": 2, + "font-size": 2, + "font-family": "Comfortaa", + "data-dy": -0.4 + }, + "#burgIcons > g#caravanserai": { + "data-icon": "#icon-triangle", + "opacity": 1, + "fill": "#ffffff", + "fill-opacity": 0.7, + "font-size": 0.7, + "stroke": "#3e3e4b", + "stroke-width": 1, + "stroke-dasharray": null, + "stroke-linecap": "butt", + "stroke-linejoin": "round" + }, + "#anchors > g#caravanserai": { + "opacity": 1, + "fill": "#ffffff", + "font-size": 0.7, + "stroke": "#3e3e4b", + "stroke-width": 1.2 + }, + "#burgLabels > g#trading_post": { + "opacity": 1, + "fill": "#043449", + "style": "text-shadow: white 0px 0px 4px", + "letter-spacing": 0, + "data-size": 2, + "font-size": 2, + "font-family": "Comfortaa", + "data-dy": -0.4 + }, + "#burgIcons > g#trading_post": { + "data-icon": "#icon-triangle", + "opacity": 1, + "fill": "#ffffff", + "fill-opacity": 0.7, + "font-size": 0.7, + "stroke": "#3e3e4b", + "stroke-width": 1, + "stroke-dasharray": null, + "stroke-linecap": "butt", + "stroke-linejoin": "round" + }, + "#anchors > g#trading_post": { + "opacity": 1, + "fill": "#ffffff", + "font-size": 0.7, + "stroke": "#3e3e4b", + "stroke-width": 1.2 + }, + "#burgLabels > g#village": { + "opacity": 1, + "fill": "#043449", + "style": "text-shadow: white 0px 0px 4px", + "letter-spacing": 0, + "data-size": 3, + "font-size": 3, + "font-family": "Comfortaa", + "data-dy": -0.4 + }, + "#burgIcons > g#village": { + "data-icon": "#icon-circle", + "opacity": 1, + "fill": "#ffffff", + "fill-opacity": 0.7, + "font-size": 0.7, + "stroke": "#3e3e4b", + "stroke-width": 1.2, + "stroke-dasharray": null, + "stroke-linecap": "butt", + "stroke-linejoin": "round" + }, + "#anchors > g#village": { + "opacity": 1, + "fill": "#ffffff", + "font-size": 0.7, + "stroke": "#3e3e4b", + "stroke-width": 1.2 + }, + "#burgLabels > g#hamlet": { + "opacity": 1, + "fill": "#043449", + "style": "text-shadow: white 0px 0px 4px", + "letter-spacing": 0, + "data-size": 2, + "font-size": 2, + "font-family": "Comfortaa", + "data-dy": -0.4 + }, + "#burgIcons > g#hamlet": { + "data-icon": "#icon-circle", + "opacity": 1, + "fill": "#ffffff", + "fill-opacity": 0.7, + "font-size": 0.5, + "stroke": "#3e3e4b", + "stroke-width": 1.2, + "stroke-dasharray": null, + "stroke-linecap": "butt", + "stroke-linejoin": "round" + }, + "#anchors > g#hamlet": { + "opacity": 1, + "fill": "#ffffff", + "font-size": 0.5, "stroke": "#3e3e4b", "stroke-width": 1.2 }, @@ -385,7 +592,7 @@ "fill": "#ffffff", "stroke": "#000000", "stroke-width": 0.15, - "text-shadow": "black 1px 1px 3px", + "style": "text-shadow: black 1px 1px 3px", "letter-spacing": 0, "data-size": 18, "font-size": 18, @@ -397,7 +604,7 @@ "fill": "#3e3e4b", "stroke": "#3a3a3a", "stroke-width": 0, - "text-shadow": "white 0px 0px 4px", + "style": "text-shadow: white 0px 0px 4px", "letter-spacing": 0, "data-size": 16, "font-size": 16, diff --git a/utils/commonUtils.js b/utils/commonUtils.js index 2be3e36d..58f3f0be 100644 --- a/utils/commonUtils.js +++ b/utils/commonUtils.js @@ -169,6 +169,7 @@ void (function () { input.required = options.required === false ? false : true; input.placeholder = "type a " + type; input.value = options.default; + input.style.width = promptText.length > 10 ? "100%" : "auto"; prompt.style.display = "block"; form.addEventListener( diff --git a/utils/stringUtils.js b/utils/stringUtils.js index 1027ee8f..a3182f14 100644 --- a/utils/stringUtils.js +++ b/utils/stringUtils.js @@ -51,10 +51,10 @@ function parseTransform(string) { JSON.isValid = str => { try { JSON.parse(str); + return true; } catch (e) { return false; } - return true; }; JSON.safeParse = str => { @@ -64,3 +64,18 @@ JSON.safeParse = str => { return null; } }; + +function sanitizeId(string) { + if (!string) throw new Error("No string provided"); + + let sanitized = string + .toLowerCase() + .trim() + .replace(/[^a-z0-9-_]/g, "") // no invalid characters + .replace(/\s+/g, "-"); // replace spaces with hyphens + + // remove leading numbers + if (sanitized.match(/^\d/)) sanitized = "_" + sanitized; + + return sanitized; +} diff --git a/versioning.js b/versioning.js index 1094599c..152199f6 100644 --- a/versioning.js +++ b/versioning.js @@ -13,7 +13,7 @@ * Example: 1.102.2 -> Major version 1, Minor version 102, Patch version 2 */ -const VERSION = "1.108.12"; +const VERSION = "1.109.0"; if (parseMapVersion(VERSION) !== VERSION) alert("versioning.js: Invalid format or parsing function"); { @@ -33,10 +33,11 @@ if (parseMapVersion(VERSION) !== VERSION) alert("versioning.js: Invalid format o const patreon = "https://www.patreon.com/azgaar"; alertMessage.innerHTML = /* html */ `The Fantasy Map Generator is updated up to version ${VERSION}. This version is compatible with previous versions, loaded save files will be auto-updated. - ${storedVersion ? "Click on OK and then reload the page to fetch fresh code." : ""} + ${storedVersion ? "In case of errors reload the page to update the code." : ""}