feat: show next condition even when popped
This commit is contained in:
parent
81447490c9
commit
0581c53454
3 changed files with 40 additions and 19 deletions
app
|
@ -57,7 +57,7 @@ main {
|
||||||
#nm-list section {
|
#nm-list section {
|
||||||
margin-bottom: 5px;
|
margin-bottom: 5px;
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: .05fr 1fr 1fr .3fr;
|
grid-template-columns: .05fr 1fr 1.5fr .3fr;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
padding-left: 10px;
|
padding-left: 10px;
|
||||||
background-color: #3D9970;
|
background-color: #3D9970;
|
||||||
|
@ -176,7 +176,7 @@ section .meta {
|
||||||
}
|
}
|
||||||
|
|
||||||
.progress-container {
|
.progress-container {
|
||||||
width: 50%;
|
width: 87%;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
background-color: tomato;
|
background-color: tomato;
|
||||||
height: 10px;
|
height: 10px;
|
||||||
|
@ -323,3 +323,16 @@ summary:hover {
|
||||||
a:has(button) {
|
a:has(button) {
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.condition {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: 2fr 1fr;
|
||||||
|
gap: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pop-timer .timer {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
gap: 5px;
|
||||||
|
}
|
||||||
|
|
|
@ -28,14 +28,17 @@
|
||||||
<small class="badge">LV<%= nm[:spawned_by][:level].to_s.rjust(2, "0") %></small>
|
<small class="badge">LV<%= nm[:spawned_by][:level].to_s.rjust(2, "0") %></small>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div class="condition">
|
||||||
<% if is_popped %>
|
<% if is_popped %>
|
||||||
|
<div class="pop-timer">
|
||||||
<% pop = instance.pops.find { |pop| pop.name == nm[:name].parameterize } %>
|
<% pop = instance.pops.find { |pop| pop.name == nm[:name].parameterize } %>
|
||||||
<% mins = ActiveSupport::Duration.build(Time.current - pop.created_at) %>
|
<% mins = ActiveSupport::Duration.build(Time.current - pop.created_at) %>
|
||||||
» <%= (120.minutes - mins).in_minutes.floor %>m
|
<div class="timer">
|
||||||
<span class="progress-container">
|
<div>» <%= (120.minutes - mins).in_minutes.floor %>m</div>
|
||||||
|
<div class="progress-container">
|
||||||
<span class="progress-bar" style="width: <%= (mins.in_minutes / 120) * 100 %>%"></span>
|
<span class="progress-bar" style="width: <%= (mins.in_minutes / 120) * 100 %>%"></span>
|
||||||
</span>
|
</div>
|
||||||
|
</div>
|
||||||
<details class="needs_pwd" hx-preserve id="change-form-<%= nm[:name].parameterize %>">
|
<details class="needs_pwd" hx-preserve id="change-form-<%= nm[:name].parameterize %>">
|
||||||
<summary>adjust pop time</summary>
|
<summary>adjust pop time</summary>
|
||||||
<%= form_with url: adjust_pop_path(instance: instance.public_id, nm: nm[:name].parameterize), class: "action-form", html: {"hx-boost": true, "hx-replace-url": false, "hx-target": "#nm-list", "hx-select": "#nm-list", "hx-swap": "outerHTML:w
|
<%= form_with url: adjust_pop_path(instance: instance.public_id, nm: nm[:name].parameterize), class: "action-form", html: {"hx-boost": true, "hx-replace-url": false, "hx-target": "#nm-list", "hx-select": "#nm-list", "hx-swap": "outerHTML:w
|
||||||
|
@ -44,7 +47,12 @@
|
||||||
<%= f.submit "change" %>
|
<%= f.submit "change" %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</details>
|
</details>
|
||||||
<% else %>
|
</div>
|
||||||
|
<% end %>
|
||||||
|
<div>
|
||||||
|
<% if is_popped && has_missing_reqs?(nm, forecast) %>
|
||||||
|
»
|
||||||
|
<% end %>
|
||||||
<% if nm[:weather] && forecast[0][:curr_weather] != nm[:weather] %>
|
<% if nm[:weather] && forecast[0][:curr_weather] != nm[:weather] %>
|
||||||
<% next_pattern = forecast.find { |f| f[:curr_weather] == nm[:weather] } %>
|
<% next_pattern = forecast.find { |f| f[:curr_weather] == nm[:weather] } %>
|
||||||
<%= Weather.get_weather_name(nm[:weather]) %> in <%= ((next_pattern[:time] - Time.now.utc) / 1.minutes).floor %>m
|
<%= Weather.get_weather_name(nm[:weather]) %> in <%= ((next_pattern[:time] - Time.now.utc) / 1.minutes).floor %>m
|
||||||
|
@ -56,7 +64,7 @@
|
||||||
<% if (nm[:night_only] || nm[:spawned_by][:night_only]) && is_day? %>
|
<% if (nm[:night_only] || nm[:spawned_by][:night_only]) && is_day? %>
|
||||||
<div>Night in <%= ((Clock.to_earth_time(Clock.get_current_eorzea_time.change(hour: 18)) - Time.now.utc) / 1.minutes).floor %>m</div>
|
<div>Night in <%= ((Clock.to_earth_time(Clock.get_current_eorzea_time.change(hour: 18)) - Time.now.utc) / 1.minutes).floor %>m</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="action needs_pwd">
|
<div class="action needs_pwd">
|
||||||
<% if is_popped %>
|
<% if is_popped %>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<div id="public_id" data-content="<%= @instance.public_id %>"></div>
|
<div id="public_id" data-content="<%= @instance.public_id %>"></div>
|
||||||
<div hx-get="" hx-trigger="every 5s" hx-swap="outerHTML" hx-select="#container" hx-target="#container">
|
<div hx-get="" hx-trigger="every 5m" hx-swap="outerHTML" hx-select="#container" hx-target="#container">
|
||||||
<header>
|
<header>
|
||||||
<div class="title">
|
<div class="title">
|
||||||
<%= link_to root_path do %><img src="/icon.png" width="50" alt="eureka.coffee logo" /><% end %>
|
<%= link_to root_path do %><img src="/icon.png" width="50" alt="eureka.coffee logo" /><% end %>
|
||||||
|
|
Loading…
Add table
Reference in a new issue