Game/templates/map.html.twig
tim 5e522ea417 Better seed handling in perlin noise
Add seed, width and height to get param
Make map terrain more generic
2023-06-05 02:11:44 +02:00

27 lines
600 B
Twig

<style>
:root {
--pixel-size: 9px;
--pixel-gap: 0px;
--pixel-color: #000;
}
.map {
display: grid;
grid-template-columns: repeat({{ map.width }}, var(--pixel-size));
grid-auto-rows: var(--pixel-size);
grid-gap: var(--pixel-gap);
}
.map > div {
width: var(--pixel-size);
height: 100%;
grid-area: var(--y) / var(--x) / var(--y) / var(--x);
background-color: var(--pixel-color);
}
</style>
<div class="map">
{% for pixel in map.pixels %}
{{ pixel|raw }}
{% endfor %}
</div>