mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-16 17:31:24 +01:00
v. 0.60.13b
Enhancement: Borders highlight
This commit is contained in:
parent
f3cb6d8c73
commit
fe239ce29b
2 changed files with 13 additions and 6 deletions
|
|
@ -74,7 +74,7 @@ button, select, a {
|
|||
}
|
||||
|
||||
#regions {
|
||||
stroke-width: 0;
|
||||
stroke-width: 2;
|
||||
stroke: none;
|
||||
fill-rule: evenodd;
|
||||
stroke-linejoin: round;
|
||||
|
|
|
|||
17
script.js
17
script.js
|
|
@ -8481,6 +8481,7 @@ function fantasyMap() {
|
|||
countriesFooterArea.innerHTML = si(totalArea) + unit;
|
||||
countriesFooterPopulation.innerHTML = si(totalPopulation);
|
||||
// handle events
|
||||
$("#countriesBody .states").hover(focusOnState, unfocusState);
|
||||
$(".enlange").click(function() {
|
||||
const s = +(this.parentNode.id).slice(5);
|
||||
const capital = states[s].capital;
|
||||
|
|
@ -8498,7 +8499,7 @@ function fantasyMap() {
|
|||
$("div[aria-describedby='burgsEditor'] .ui-dialog-title").text("Burgs of " + this.value).prepend(color);
|
||||
}
|
||||
}
|
||||
}).hover(focusStates, unfocus);
|
||||
});
|
||||
$(".states > .stateColor").on("change", function() {
|
||||
const s = +(this.parentNode.id).slice(5);
|
||||
states[s].color = this.value;
|
||||
|
|
@ -8832,10 +8833,16 @@ function fantasyMap() {
|
|||
}
|
||||
|
||||
// onhover style functions
|
||||
function focusStates() {
|
||||
const s = +(this.parentNode.id).slice(5);
|
||||
const l = labels.select("#regionLabel" + s);
|
||||
l.classed("drag", true);
|
||||
function focusOnState() {
|
||||
const s = +(this.id).slice(5);
|
||||
labels.select("#regionLabel" + s).classed("drag", true);
|
||||
document.getElementsByClassName("region" + s)[0].style.stroke = "#000000";
|
||||
}
|
||||
|
||||
function unfocusState() {
|
||||
const s = +(this.id).slice(5);
|
||||
labels.select("#regionLabel" + s).classed("drag", false);
|
||||
document.getElementsByClassName("region" + s)[0].style.stroke = "none";
|
||||
}
|
||||
|
||||
function focusCapital() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue