feat: add location display for NMs

Closes #1.
This commit is contained in:
insects 2025-03-31 23:05:28 +02:00
parent 349c50ea90
commit 4000dd1871
3 changed files with 47 additions and 0 deletions

View file

@ -12,6 +12,17 @@
<div class="meta">
<h3 class="nm-info">
<span class="badge">LV<%= nm[:level].to_s.rjust(2, "0") %></span>
<% if nm[:x] and nm[:y] %>
<span class="map-icon">
<%= render partial: "map_icon" %>
<div class="map-popup">
<div style="position: relative; width: 200px; height: 200px;">
<img src="/maps/<%= @instance.zone %>_fw.jpg" style="width: 200px; z-index: 100;" />
<span class="map-nm-loc" style="position: absolute; left: <%= (nm[:x] / 42.0) * 100.0 %>%; top: <%= (nm[:y] / 42.0) * 100.0 %>%;"></span>
</div>
</div>
</span>
<% end %>
<%= nm[:name] %>
<% if nm[:drops] %>
<span title="<%= nm[:drops] %>" style="font-size: 14px;">✨</span>

View file

@ -0,0 +1,3 @@
<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
<path d="M9 20L3 17V4L9 7M9 20L15 17M9 20V7M15 17L21 20V7L15 4M15 17V4M9 7L15 4" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
</svg>

After

Width:  |  Height:  |  Size: 218 B