forked from Jonathan/Peradventure
added real-time map render!
This commit is contained in:
@ -1,11 +1,15 @@
|
||||
<!-- views/index.etlua -->
|
||||
<script src="/static/htmx.min.js"></script>
|
||||
<div id="clickable">
|
||||
<button hx-post="/clickme" hx-target="#clickable">Start</button>
|
||||
</div>
|
||||
|
||||
<button hx-post="/clickme" hx-target="#clickable">Start</button>
|
||||
<p id="clickable"></p>
|
||||
<div id="map" hx-get="/map/render" hx-trigger="every 5s">
|
||||
|
||||
</div>
|
||||
|
||||
<ol>
|
||||
<!--
|
||||
<ol>
|
||||
<p><% for i, thing in pairs(text) do %>
|
||||
<li><%= thing %></li>
|
||||
<% end %>
|
||||
|
8
views/map.etlua
Normal file
8
views/map.etlua
Normal file
@ -0,0 +1,8 @@
|
||||
<p style="text-align: center;">
|
||||
<% for h=1,10 do %>
|
||||
<% for i=1,10 do %>
|
||||
<%= tiles[h][i].occupied_by_type %>
|
||||
<% end %>
|
||||
<br>
|
||||
<% end %>
|
||||
</p>
|
Reference in New Issue
Block a user