From 3afcaef927391db23fe23c6c8c26b8960e8dae32 Mon Sep 17 00:00:00 2001 From: Daniel Weipert Date: Wed, 29 Nov 2023 09:35:27 +0100 Subject: intermediate commit --- views/components/timer.twig | 3 ++- views/map.twig | 28 ++++++++++++++++-------- views/village.twig | 52 +++++++++++++++++++++++++++++++++------------ views/villages.twig | 4 ++-- 4 files changed, 62 insertions(+), 25 deletions(-) (limited to 'views') diff --git a/views/components/timer.twig b/views/components/timer.twig index 97977da..ccb31a7 100644 --- a/views/components/timer.twig +++ b/views/components/timer.twig @@ -9,8 +9,9 @@ document.addEventListener('DOMContentLoaded', function (ev) { const interval = setInterval(setTime, 1000); function setTime() { let diff = time - new Date(); - if (diff <= -1) { + if (diff <= 0) { clearInterval(interval); + window.location.reload(); } const hh = Math.floor(diff/1000/60/60); 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 %}
- Up + + +
{% for row in range(-range, range) %} {% for column in range(-range, range) %} {% set village = map[x + column][y + row] %} - +
+ {% if village %} + + {{ map[x + column][y + row].name }} + + {% endif %} +
{% endfor %} {% endfor %}
{% endblock %} diff --git a/views/village.twig b/views/village.twig index ea6635c..b843ef4 100644 --- a/views/village.twig +++ b/views/village.twig @@ -49,7 +49,7 @@

Storage Config