diff --git a/modules/heightmap-templates.js b/config/heightmap-templates.js similarity index 77% rename from modules/heightmap-templates.js rename to config/heightmap-templates.js index 7e0cd20c..29738609 100644 --- a/modules/heightmap-templates.js +++ b/config/heightmap-templates.js @@ -1,6 +1,6 @@ "use strict"; -window.HeightmapTemplates = (function () { +const heightmapTemplates = (function () { const volcano = `Hill 1 90-100 44-56 40-60 Multiply 0.8 50-100 0 0 Range 1.5 30-55 45-55 40-60 @@ -148,20 +148,19 @@ window.HeightmapTemplates = (function () { Range 6-8 40-50 5-95 10-90`; return { - volcano, - highIsland, - lowIsland, - continents, - archipelago, - atoll, - mediterranean, - peninsula, - peninsula, - pangea, - isthmus, - shattered, - taklamakan, - oldWorld, - fractious + volcano: {id: 0, name: "Volcano", template: volcano, probability: 3}, + highIsland: {id: 1, name: "High Island", template: highIsland, probability: 19}, + lowIsland: {id: 2, name: "Low Island", template: lowIsland, probability: 9}, + continents: {id: 3, name: "Continents", template: continents, probability: 16}, + archipelago: {id: 4, name: "Archipelago", template: archipelago, probability: 18}, + atoll: {id: 5, name: "Atoll", template: atoll, probability: 1}, + mediterranean: {id: 6, name: "Mediterranean", template: mediterranean, probability: 5}, + peninsula: {id: 7, name: "Peninsula", template: peninsula, probability: 3}, + pangea: {id: 8, name: "Pangea", template: pangea, probability: 5}, + isthmus: {id: 9, name: "Isthmus", template: isthmus, probability: 2}, + shattered: {id: 10, name: "Shattered", template: shattered, probability: 7}, + taklamakan: {id: 11, name: "Taklamakan", template: taklamakan, probability: 1}, + oldWorld: {id: 12, name: "Old World", template: oldWorld, probability: 8}, + fractious: {id: 13, name: "Fractious", template: fractious, probability: 3} }; })(); diff --git a/config/precreated-heightmaps.js b/config/precreated-heightmaps.js new file mode 100644 index 00000000..22f45abd --- /dev/null +++ b/config/precreated-heightmaps.js @@ -0,0 +1,27 @@ +"use strict"; + +const precreatedHeightmaps = { + "africa-centric": {id: 0, name: "Africa Centric"}, + arabia: {id: 1, name: "Arabia"}, + atlantics: {id: 2, name: "Atlantics"}, + britain: {id: 3, name: "Britain"}, + caribbean: {id: 4, name: "Caribbean"}, + "east-asia": {id: 5, name: "East Asia"}, + eurasia: {id: 6, name: "Eurasia"}, + europe: {id: 7, name: "Europe"}, + "europe-accented": {id: 8, name: "Europe Accented"}, + "europe-and-central-asia": {id: 9, name: "Europe and Central Asia"}, + "europe-central": {id: 10, name: "Europe Central"}, + "europe-north": {id: 11, name: "Europe North"}, + greenland: {id: 12, name: "Greenland"}, + hellenica: {id: 13, name: "Hellenica"}, + iceland: {id: 14, name: "Iceland"}, + "indian-ocean": {id: 15, name: "Indian Ocean"}, + "mediterranean-sea": {id: 16, name: "Mediterranean Sea"}, + "middle-east": {id: 17, name: "Middle East"}, + "north-america": {id: 18, name: "North America"}, + "us-centric": {id: 19, name: "US-centric"}, + "us-mainland": {id: 20, name: "US Mainland"}, + world: {id: 21, name: "World"}, + "world-from-pacific": {id: 22, name: "World from Pacific"} +}; diff --git a/index.css b/index.css index 1b7a983b..4d1a1f91 100644 --- a/index.css +++ b/index.css @@ -347,6 +347,20 @@ text.drag { user-select: none; } +#optionsTrigger { + padding: 0.6em 0.45em; +} + +@media (max-width: 600px) { + #optionsTrigger { + font-size: 2em; + padding: 0; + width: 1.3em; + height: 1.6em; + border: solid 1px #5e4fa2; + } +} + #options { position: absolute; font-family: Consolas, monospace; @@ -929,7 +943,7 @@ fieldset { padding: 0.1em 0.5em; float: left; font-size: 1.2em; - font-family: Copperplate, monospace; + font-family: monospace; } #brushesButtons > button { @@ -1318,6 +1332,13 @@ div.slider .ui-slider-handle { scrollbar-width: thin; } +@media screen and (max-width: 600px) { + .table { + max-width: unset; + } +} + +.dialog::-webkit-scrollbar, #alertMessage::-webkit-scrollbar, .table::-webkit-scrollbar, .matrix-table::-webkit-scrollbar { @@ -1326,6 +1347,7 @@ div.slider .ui-slider-handle { background-color: transparent; } +.dialog::-webkit-scrollbar-thumb, #alertMessage::-webkit-scrollbar-thumb, .table::-webkit-scrollbar-thumb, .matrix-table::-webkit-scrollbar-thumb { @@ -1333,30 +1355,30 @@ div.slider .ui-slider-handle { border-radius: 6px; } +.dialog::-webkit-scrollbar-thumb:hover, #alertMessage::-webkit-scrollbar-thumb:hover, .table::-webkit-scrollbar-thumb:hover, .matrix-table::-webkit-scrollbar-thumb:hover { background: #666; } -.overflow { +.dialog { max-width: 93vw; - overflow: auto; - max-height: 75vh; } -.overflow > div { +.dialog > div { width: max-content; } -div.header > div { +div.header { + display: grid; + width: 0; font-weight: bold; font-size: 0.9em; - display: inline-block; - position: sticky; - white-space: nowrap; - overflow-x: hidden; - vertical-align: bottom; +} + +div.header > div:first-child { + margin-left: 1.8em; } .sortable { @@ -1655,11 +1677,6 @@ div.states > div.biomeArea { width: 5em; } -#militaryHeader > div, -#regimentsHeader > div { - width: 5.2em; -} - #militaryBody div.states > input { -moz-appearance: textfield; } @@ -1978,12 +1995,9 @@ input[type="checkbox"] { } div.textual select, -div.textual textarea { - font-family: Copperplate, monospace; -} - +div.textual textarea, div.textual input { - font-family: Copperplate, monospace; + font-family: monospace; } div.textual fieldset { @@ -1998,7 +2012,7 @@ div.textual span, } #namesbaseExamples { - font-family: Copperplate, monospace; + font-family: monospace; cursor: pointer; } @@ -2063,7 +2077,7 @@ div.textual span, outline: 0; overflow-y: auto; padding: 0.6em; - font-family: Copperplate, monospace; + font-family: monospace; background-color: #fff; border: 1px solid #dedede; color: #000; @@ -2092,6 +2106,7 @@ svg.button { #reliefIconsDiv { margin-top: 2px; padding: 2px; + width: 100%; } #reliefIconsDiv svg { @@ -2301,11 +2316,8 @@ svg.button { #mapOverlay { position: absolute; + inset: 0; display: flex; - top: 0; - left: 0; - right: 0; - bottom: 0; align-items: center; justify-content: center; z-index: 10; @@ -2340,17 +2352,6 @@ svg.button { } @media only screen and (max-width: 420px) { - #collapsible, - #options { - margin: 0; - border: 0; - } - - #options { - height: 100vh; - width: 100vw; - } - table { width: 100%; } diff --git a/index.html b/index.html index 033b5720..d46757e8 100644 --- a/index.html +++ b/index.html @@ -24,59 +24,48 @@ font-size: 10px; overflow: hidden; } - #map { - position: absolute; + #loading > * { + pointer-events: none; + position: fixed; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); } - #initial { + #loading > #loading-rose > use { fill: none; stroke: black; - pointer-events: none; - } - #init-rose { opacity: 0.7; transform-origin: center; - opacity: 0.7; - animation: 20s infinite spin; + animation: 20s linear 0s infinite spin; } - @keyframes spin { - 0% { - transform: rotate(0deg); - } - 100% { - transform: rotate(359deg); - } - } - #loading { + #loading > #loading-typography { opacity: 1; font-size: 11px; color: #fff5da; text-align: center; text-shadow: 0px 1px 4px #4c3a35; - width: 80%; - max-width: 600px; - position: fixed; - top: 50%; - left: 50%; - transform: translate(-50%, -50%); - pointer-events: none; + width: 80vw; + max-width: 540px; } - #loading-text { - font-size: 1.8em; - margin: 0.2em 0 0 1em; + @media screen and (max-width: 600px) { + #loading > #loading-typography { + font-size: 8px; + } } #titleName { text-align: left; font-size: 3em; - margin-left: 5%; } #title { font-size: 7em; - margin: -12px 0 -6px 0; } #versionText { text-align: right; font-size: 2em; - margin-right: 3%; + } + #loading-text { + font-size: 2em; + margin: 0.2em; } #loading-text > span { font-size: 1.3em; @@ -106,16 +95,25 @@ opacity: 0.1; } } + @keyframes spin { + 0% { + transform: rotate(0deg); + } + 100% { + transform: rotate(359deg); + } + } - + - +