diff options
Diffstat (limited to 'app/views/application')
-rw-r--r-- | app/views/application/_navbar.html.erb | 20 | ||||
-rw-r--r-- | app/views/application/_results.html.erb | 4 | ||||
-rw-r--r-- | app/views/application/_timer.html.erb | 100 | ||||
-rw-r--r-- | app/views/application/components/text/_title.html.erb | 14 |
4 files changed, 81 insertions, 57 deletions
diff --git a/app/views/application/_navbar.html.erb b/app/views/application/_navbar.html.erb index be2d9f2..e315b42 100644 --- a/app/views/application/_navbar.html.erb +++ b/app/views/application/_navbar.html.erb @@ -1,21 +1,27 @@ -<ul class="py-2 px-2 col-span-12 text-display"> +<ul class="py-2 px-2 col-span-12 text-display space-x-2.5"> <% if current_char %> - <li class="mr-6 inline"> + <li class="inline"> <%= link_to "Locations", locations_path %> </li> - <li class="mr-6 inline"> + <li class="inline"> <%= link_to "Character", character_path(current_char) %> </li> - <li class="mr-6 inline"> + <li class="inline"> + <%= link_to "Skills", character_skills_path(current_char) %> + </li> + <li class="inline"> <%= link_to "Inventory", character_items_path(current_char) %> </li> - <li class="mr-6 inline"> + <li class="inline"> + <%= link_to "Spells", character_spells_path(current_char) %> + </li> + <li class="inline"> <%= link_to "Hearth", character_hearth_path(current_char) %> </li> - <li class="mr-6 inline"> + <li class="inline"> <%= link_to "Bazaar", bazaar_path %> </li> - <li class="mr-6 inline"> + <li class="inline"> <%= link_to "Messages", messages_path %> </li> <% end %> diff --git a/app/views/application/_results.html.erb b/app/views/application/_results.html.erb index ec62991..a7dc002 100644 --- a/app/views/application/_results.html.erb +++ b/app/views/application/_results.html.erb @@ -13,7 +13,7 @@ <p>You planted <%= link_to result[:hearth_planting].item.name, item_path(result[:hearth_planting].item) %> in the loam.</p> <% when "activity" %> - <p>You realized how to <%= result[:activity].name %>!</p> + <p>You learned how to <%= result[:activity].name %>!</p> <% when "monster" %> <p>You encountered a <%= result[:monster].name %>.</p> <p class="text-xs italic"><%= result[:monster].description %></p> @@ -24,6 +24,8 @@ <p class="text-xs">You gained <%= result[:xp] %> <%= result[:skill].name %> XP.</p> <% when "title" %> <p>You earned the title <%= render "application/components/text/title", title: result[:title] %>!</p> + <% when "condition" %> + <p>You gained the <%= result[:condition].name %> condition.</p> <% when "message" %> <p><%= result[:body] %></p> <% when "warning" %> diff --git a/app/views/application/_timer.html.erb b/app/views/application/_timer.html.erb index d683c6a..51d9b81 100644 --- a/app/views/application/_timer.html.erb +++ b/app/views/application/_timer.html.erb @@ -1,61 +1,63 @@ -<% if current_char.activity %> - <h2 class="text-lg text-display text-center"><%= current_char.activity.name %></h2> - <div data-controller="timer" - data-timer-time-remaining-value="<%= current_char.activity_time_remaining %>" - data-timer-activity-duration-value="<%= current_char.activity_duration - current_char.rested_duration_to_spend_on_activity %>" - data-timer-post-url-value="<%= finish_activity_url %>"> - <div class="text-center"> - <span data-timer-target="timer" class="text-xl text-display"></span> - </div> - <div class="border border-gray-800 h-4 my-1"> - <div data-timer-target="progressBar" class="bg-gray-600 h-full" - style="width: <%= current_char.percentage_of_activity_completed %>%"> +<% if current_char %> + <% if current_char.activity %> + <h2 class="text-lg text-display text-center"><%= current_char.activity.name %></h2> + <div data-controller="timer" + data-timer-time-remaining-value="<%= current_char.activity_time_remaining %>" + data-timer-activity-duration-value="<%= current_char.activity_duration - current_char.rested_duration_to_spend_on_activity %>" + data-timer-post-url-value="<%= finish_activity_url %>"> + <div class="text-center"> + <span data-timer-target="timer" class="text-xl text-display"></span> + </div> + <div class="border border-gray-800 h-4 my-1"> + <div data-timer-target="progressBar" class="bg-gray-600 h-full" + style="width: <%= current_char.percentage_of_activity_completed %>%"> + </div> </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> - <div><%= most_recent_cs.xp_to_next_level %> XP to next level</div> - </div> - <div class="text-center my-2"> - <%= button_to "Stop", stop_activity_path, class: "text-sm" %> - </div> - - <div class="text-center text-xs my-2"> - <% if current_char.activity.gid.include?("beastslay") %> - <%= current_char.wounds %> / <%= pluralize(current_char.max_wounds, "wound") %> - <% end %> - <% current_char.active_states.each do |state| %> - <div> - <%= state.condition.name %> - </div> - <div> - (expires in <%= distance_of_time_in_words_to_now(state.expires_at) %>) - </div> - <% end %> - </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> + <div><%= most_recent_cs.xp_to_next_level %> XP to next level</div> + </div> -<% else %> - <div class="text-center"> - <% if current_char.resting? %> - <p>You're resting.</p> - <% else %> - <p>You're not doing anything.</p> - <% end %> + <div class="text-center my-2"> + <%= button_to "Stop", stop_activity_path, class: "text-sm" %> + </div> - <div class="my-2"> - <%= button_to current_char.resting? ? "Stop Resting" : "Start Resting", toggle_resting_path %> + <div class="text-center text-xs my-2"> + <% if current_char.activity.gid.include?("beastslay") %> + <%= current_char.wounds %> / <%= pluralize(current_char.max_wounds, "wound") %> + <% end %> + <% current_char.active_states.each do |state| %> + <div> + <%= state.condition.name %> + </div> + <div> + (expires in <%= distance_of_time_in_words_to_now(state.expires_at) %>) + </div> + <% end %> </div> - <div class="text-xs"> - You have <%= distance_of_time_in_words_to_now(current_char.rested_until) %> of rested time. + <% else %> + <div class="text-center"> <% if current_char.resting? %> - This does not include time from your current rest. That time will be added when you stop resting. + <p>You're resting.</p> + <% else %> + <p>You're not doing anything.</p> <% end %> + + <div class="my-2"> + <%= button_to current_char.resting? ? "Stop Resting" : "Start Resting", toggle_resting_path %> + </div> + + <div class="text-xs"> + You have <%= distance_of_time_in_words_to_now(current_char.rested_until) %> of rested time. + <% if current_char.resting? %> + This does not include time from your current rest. That time will be added when you stop resting. + <% end %> + </div> </div> - </div> + <% end %> <% end %> diff --git a/app/views/application/components/text/_title.html.erb b/app/views/application/components/text/_title.html.erb index a7c2a7e..5e1d5a2 100644 --- a/app/views/application/components/text/_title.html.erb +++ b/app/views/application/components/text/_title.html.erb @@ -10,6 +10,20 @@ <span class="text-purple-200">Aspirant</span> <% when "sentinel" %> <span class="text-gray-500">S</span><span class="text-gray-400">e</span><span class="text-gray-300">n</span><span class="text-gray-200">ti</span><span class="text-gray-300">n</span><span class="text-gray-400">e</span><span class="text-gray-500">l</span> + <% when "spiteful" %> + <span class="text-transparent bg-clip-text bg-gradient-to-b from-gray-500 to-red-900">Spiteful</span> + <% when "hateful" %> + <span class="text-transparent bg-clip-text bg-gradient-to-b from-gray-600 to-red-800">Hateful</span> + <% when "vicious" %> + <span class="text-transparent bg-clip-text bg-gradient-to-b from-gray-700 to-red-700">Vicious</span> + <% when "slayer" %> + <span class="text-red-400">Slayer</span> + <% when "butcher" %> + <span class="text-red-500">Butcher</span> + <% when "slaughterer" %> + <span class="text-red-600">Slaughterer</span> + <% when "massacrer" %> + <span class="text-red-700">Massacrer</span> <% else %> <%= title.name %> <% end %> |