heightmap select - style fixes

This commit is contained in:
Azgaar 2022-05-27 02:22:25 +03:00 committed by Peter
parent e1cbca2546
commit 48e36fa26c
3 changed files with 28 additions and 2 deletions

View file

@ -96,6 +96,19 @@ function appendStyleSheet() {
justify-self: end;
}
@media (max-width: 600px) {
.heightmap-selection_container {
grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
grid-gap: 4px;
}
}
@media (min-width: 2000px) {
.heightmap-selection_container {
grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}
}
.heightmap-selection article {
padding: 4px;
border-radius: 8px;
@ -308,6 +321,13 @@ async function drawPrecreatedHeightmap(id) {
article.querySelector("img").src = dataUrl;
}
async function drawPrecreatedHeightmap(id) {
const heights = await HeightmapGenerator.fromPrecreated(id);
const dataUrl = drawHeights(heights);
const article = byId("heightmapSelection").querySelector(`[data-id="${id}"]`);
article.querySelector("img").src = dataUrl;
}
function regeneratePreview(article, id) {
graph = getGraph(graph);
const seed = generateSeed();