diff options
author | David Gay <david@davidgay.org> | 2021-06-04 10:21:20 -0400 |
---|---|---|
committer | David Gay <david@davidgay.org> | 2021-06-04 10:21:20 -0400 |
commit | 8206cac29ec2ce86e0b0a68360ec714b573e13f6 (patch) | |
tree | 92812683a373d55d0e170c3474f4143390e67ed1 /app/views/application | |
parent | e3ec74cfbdf2428acb849a16b9ee6311020630a8 (diff) |
Timer progress bar
Diffstat (limited to 'app/views/application')
-rw-r--r-- | app/views/application/_timer.html.erb | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/app/views/application/_timer.html.erb b/app/views/application/_timer.html.erb index 46b1134..f301ffc 100644 --- a/app/views/application/_timer.html.erb +++ b/app/views/application/_timer.html.erb @@ -1,12 +1,20 @@ <% if current_char.activity %> <h2 class="text-lg text-display text-center"><%= current_char.activity.name %></h2> <div data-controller="timer" - data-timer-counter-value="<%= current_char.activity_time_remaining.ceil %>" - data-timer-post-url-value="<%= finish_activity_url %>" - class="text-center"> - <span data-timer-target="timer" class="text-3xl"></span> + data-timer-time-remaining-value="<%= current_char.activity_time_remaining %>" + data-timer-activity-duration-value="<%= current_char.activity_duration %>" + data-timer-post-url-value="<%= finish_activity_url %>"> + <div class="text-center"> + <span data-timer-target="timer" class="text-3xl"></span> + </div> + <div class="border border-gray-800 h-4"> + <div data-timer-target="progressBar" class="bg-gray-600 h-full" + style="width: <%= current_char.percentage_of_activity_completed %>%"> + </div> + </div> </div> + <% most_recent_cs = current_char.character_skills.order(:updated_at).last %> <div class="text-center text-sm"> <div class="text-xs"><%= most_recent_cs.skill.name %> level <%= most_recent_cs.level %></div> |