feat: add sprite spawns

This commit is contained in:
insects 2025-03-13 14:36:23 +01:00
parent 0581c53454
commit ca352fc531
13 changed files with 379 additions and 13 deletions

View file

@ -1,5 +1,5 @@
<div id="public_id" data-content="<%= @instance.public_id %>"></div>
<div hx-get="" hx-trigger="every 5m" hx-swap="outerHTML" hx-select="#container" hx-target="#container">
<div hx-get="" hx-trigger="<%= Rails.env == "development" ? "every 5m" : "every 5s" %>" hx-swap="outerHTML" hx-select="#container" hx-target="#container">
<header>
<div class="title">
<%= link_to root_path do %><img src="/icon.png" width="50" alt="eureka.coffee logo" /><% end %>
@ -36,13 +36,14 @@
»
<div class="weather">
<img src="/weather/<%= @forecast[i + 1][:curr_weather] %>.png" width="25" title="<%= @forecast[i + 1][:weather_name] %>" />
<div><%= ((@forecast[i + 1][:time] - Time.now.utc) / 1.minutes).floor %>m</div>
<div><%= ((@forecast[i + 1][:time] - Time.now.utc) / 1.minutes).ceil %>m</div>
</div>
<% end %>
</div>
<div>
<%= render partial: "fairies", locals: { instance: @instance } %>
<%= render partial: "chlog", locals: { instance: @instance, forecast: @forecast } %>
</div>
</div>
</main>
@ -50,9 +51,3 @@
<%= javascript_include_tag "list" %>
</div>
<a href="/maps/<%= @instance.zone %>_full.jpg" target="_blank">
<button>full map (new tab)</button>
</a>
<%= form_with url: clone_instance_path(instance: @instance.public_id), html: { style: "display: inline-block;" } do |f| %>
<%= f.submit "clone instance" %>
<% end %>