summaryrefslogtreecommitdiff
path: root/app/views/activities
diff options
context:
space:
mode:
Diffstat (limited to 'app/views/activities')
-rw-r--r--app/views/activities/_results.html.erb7
-rw-r--r--app/views/activities/_timer.html.erb8
-rw-r--r--app/views/activities/show.html.erb11
3 files changed, 26 insertions, 0 deletions
diff --git a/app/views/activities/_results.html.erb b/app/views/activities/_results.html.erb
new file mode 100644
index 0000000..baa4ab0
--- /dev/null
+++ b/app/views/activities/_results.html.erb
@@ -0,0 +1,7 @@
+<div>
+ <% results.each do |result| %>
+ <% if result[:type] == "item" %>
+ <p>You got <%= result[:quantity] %> <%= result[:item].name %>.</p>
+ <% end %>
+ <% end %>
+</div>
diff --git a/app/views/activities/_timer.html.erb b/app/views/activities/_timer.html.erb
new file mode 100644
index 0000000..418c378
--- /dev/null
+++ b/app/views/activities/_timer.html.erb
@@ -0,0 +1,8 @@
+<% if current_char.activity %>
+ <div data-controller="activities--timer"
+ data-activities--timer-start-value="<%= current_char.activity_time_remaining.ceil %>"
+ class="text-center">
+ <span data-activities--timer-target="timer" class="text-3xl"></span>
+ </div>
+ <%= link_to "Stop", location_path(current_char.activity.location) %>
+<% end %>
diff --git a/app/views/activities/show.html.erb b/app/views/activities/show.html.erb
new file mode 100644
index 0000000..4e77061
--- /dev/null
+++ b/app/views/activities/show.html.erb
@@ -0,0 +1,11 @@
+<h1 class="text-2xl"><%= @activity.name %></h1>
+<p><%= @activity.description %></p>
+
+<div class="border-gray-800 rounded p-2" id="result_output">
+</div>
+
+<div id="result_controls">
+ <%= render "timer" %>
+</div>
+
+<%= link_to "Start", start_activity_path(@activity), method: :post %>