summaryrefslogtreecommitdiff
path: root/views/map.twig
blob: 29f0294a7341fe999e999660363a179ef877deb2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
{% extends 'base.twig' %}

{% block main %}
<div class="map">
  <div class="map__up">
    <a href="/map/{{ x }}/{{ y - 1 }}">
      <i class="icon icon-arrow-up"></i>
    </a>
  </div>
  <div>
    <div class="map__left">
      <a href="/map/{{ x - 1 }}/{{ y }}">
        <i class="icon icon-arrow-left"></i>
      </a>
    </div>
    <div class="map__villages" style="grid-template-columns: repeat({{ range*2+1 }}, 1fr); grid-template-rows: repeat({{ range*2+1 }}, 1fr);">
      {% for row in range(-range, range) %}
        {% for column in range(-range, range) %}
          {% set village = map[x + column][y + row] %}
            <div class="map__village">
            {% if village %}
              <a href="/village/{{ village.x }}/{{ village.y }}">
                {{ map[x + column][y + row].name }}
              </a>
            {% endif %}
            </div>
        {% endfor %}
      {% endfor %}
    </div>
    <div class="map__right">
      <a href="/map/{{ x + 1 }}/{{ y }}">
        <i class="icon icon-arrow-right"></i>
      </a>
    </div>
  </div>
  <div class="map__down">
    <a href="/map/{{ x }}/{{ y + 1 }}">
      <i class="icon icon-arrow-down"></i>
    </a>
  </div>
</div>
{% endblock %}