planet-wars/backend/templates/map_partial.html.tera
2020-03-25 22:14:26 +01:00

9 lines
458 B
Plaintext

<p> Map rendering </p>
<svg preserveAspectRatio="none" viewBox="{{ planets | calc_viewbox}}" xmlns="http://www.w3.org/2000/svg" fill="grey">
{% for planet in planets %}
<circle cx="{{ planet.x }}" cy="{{ planet.y }}" r="0.5" fill="{% if planet.owner %}{{planet.owner | get_colour}}{% else %}grey{%endif%}"/>
<text x="{{planet.x}}" y="{{planet.y + 2}}" class="small" dominant-baseline="middle" text-anchor="middle">{{planet.name}}</text>
{% endfor %}
</svg>