summaryrefslogtreecommitdiff
path: root/views/map.twig
diff options
context:
space:
mode:
authorDaniel Weipert <code@drogueronin.de>2023-11-29 09:35:27 +0100
committerDaniel Weipert <code@drogueronin.de>2023-11-29 09:35:27 +0100
commit3afcaef927391db23fe23c6c8c26b8960e8dae32 (patch)
tree143b9f6df9e8c795c8c6ed901bffdc7119f40df1 /views/map.twig
parentc4ce3e884a6aa527bcc138771617215cf03265a4 (diff)
intermediate commit
Diffstat (limited to 'views/map.twig')
-rw-r--r--views/map.twig28
1 files changed, 19 insertions, 9 deletions
diff --git a/views/map.twig b/views/map.twig
index 43f1a5b..29f0294 100644
--- a/views/map.twig
+++ b/views/map.twig
@@ -3,30 +3,40 @@
{% block main %}
<div class="map">
<div class="map__up">
- <a href="/map/{{ x }}/{{ y - 1 }}">Up</a>
+ <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 }}">Left</a>
+ <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">
- <a href="/village/{{ village.x }}/{{ village.y }}">
- {{ map[x + column][y + row].name }}
- </a>
- </div>
+ <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 }}">Right</a>
+ <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 }}">Down</a>
+ <a href="/map/{{ x }}/{{ y + 1 }}">
+ <i class="icon icon-arrow-down"></i>
+ </a>
</div>
</div>
{% endblock %}