mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-21 19:41:23 +01:00
Add Load dropdown
This commit is contained in:
parent
2090d1c96b
commit
ccd5e322d6
3 changed files with 417 additions and 249 deletions
12
index.css
12
index.css
|
|
@ -845,22 +845,26 @@ div.slider .ui-slider-handle {
|
||||||
line-height: 1.6em;
|
line-height: 1.6em;
|
||||||
}
|
}
|
||||||
|
|
||||||
#saveDropdown {
|
.dropdown {
|
||||||
|
display: inline-block;
|
||||||
|
/* todo: float: left? */
|
||||||
|
}
|
||||||
|
|
||||||
|
.dropdown__options {
|
||||||
display: none;
|
display: none;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
left: 29%;
|
|
||||||
top: 100%;
|
top: 100%;
|
||||||
border: 1px solid #5e4fa2;
|
border: 1px solid #5e4fa2;
|
||||||
background-color: #a4879b;
|
background-color: #a4879b;
|
||||||
width: 44px;
|
width: 44px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#saveDropdown>div {
|
.dropdown__options > div {
|
||||||
padding: 2px 4px;
|
padding: 2px 4px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
#saveDropdown>div:hover {
|
.dropdown__options > div:hover {
|
||||||
color: white;
|
color: white;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
587
index.html
587
index.html
File diff suppressed because one or more lines are too long
|
|
@ -270,12 +270,14 @@ function fantasyMap() {
|
||||||
const mapLink = params.get("maplink");
|
const mapLink = params.get("maplink");
|
||||||
if (mapLink) {
|
if (mapLink) {
|
||||||
// set up global state
|
// set up global state
|
||||||
|
applyNamesData();
|
||||||
applyMapSize();
|
applyMapSize();
|
||||||
placePoints();
|
placePoints();
|
||||||
calculateVoronoi(points);
|
calculateVoronoi(points);
|
||||||
|
|
||||||
makeFileFromUrl(decodeURIComponent(mapLink)).then(blob => {
|
makeFileFromUrl(decodeURIComponent(mapLink)).then(blob => {
|
||||||
uploadFile(blob);
|
uploadFile(blob);
|
||||||
|
manorsAndRegions(); // namesBase global state
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
applyNamesData(); // apply default namesbase on load
|
applyNamesData(); // apply default namesbase on load
|
||||||
|
|
@ -7720,6 +7722,7 @@ function fantasyMap() {
|
||||||
zoom.scaleExtent([1, 20]).scaleTo(svg, 1);
|
zoom.scaleExtent([1, 20]).scaleTo(svg, 1);
|
||||||
}
|
}
|
||||||
if (id === "saveButton") {$("#saveDropdown").slideToggle();}
|
if (id === "saveButton") {$("#saveDropdown").slideToggle();}
|
||||||
|
if (id === "loadButton") {$("#loadDropdown").slideToggle();}
|
||||||
if (id === "loadMap") {mapToLoad.click();}
|
if (id === "loadMap") {mapToLoad.click();}
|
||||||
if (id === "zoomReset") {resetZoom(1000);}
|
if (id === "zoomReset") {resetZoom(1000);}
|
||||||
if (id === "zoomPlus") {
|
if (id === "zoomPlus") {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue