mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-17 01:41:22 +01:00
v1.4.09
This commit is contained in:
parent
bb0251c020
commit
617e8d4306
12 changed files with 86 additions and 163 deletions
|
|
@ -527,11 +527,26 @@ function changePickerSpace() {
|
|||
openPicker.updateFill();
|
||||
}
|
||||
|
||||
// remove all fogging
|
||||
function unfog() {
|
||||
defs.select("#fog").selectAll("path").remove();
|
||||
fogging.selectAll("path").remove();
|
||||
fogging.style("display", "none");
|
||||
// add fogging
|
||||
function fog(id, path) {
|
||||
if (defs.select("#fog #"+id).size()) return;
|
||||
const fadeIn = d3.transition().duration(2000).ease(d3.easeSinInOut);
|
||||
if (defs.select("#fog path").size()) {
|
||||
defs.select("#fog").append("path").attr("d", path).attr("id", id).attr("opacity", 0).transition(fadeIn).attr("opacity", 1);
|
||||
} else {
|
||||
defs.select("#fog").append("path").attr("d", path).attr("id", id).attr("opacity", 1);
|
||||
const opacity = fogging.attr("opacity");
|
||||
fogging.style("display", "block").attr("opacity", 0).transition(fadeIn).attr("opacity", opacity);
|
||||
}
|
||||
}
|
||||
|
||||
// remove fogging
|
||||
function unfog(id) {
|
||||
let el = defs.select("#fog #"+id);
|
||||
if (!id || !el.size()) el = defs.select("#fog").selectAll("path");
|
||||
|
||||
el.remove();
|
||||
if (!defs.selectAll("#fog path").size()) fogging.style("display", "none");
|
||||
}
|
||||
|
||||
function getFileName(dataType) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue