From 8c93c5e29eceb9e85cb3eaa7ecc25653ffc50189 Mon Sep 17 00:00:00 2001 From: David Gay Date: Wed, 7 Jul 2021 20:33:38 -0400 Subject: Times of day, and a primitive clock in the header --- app/views/application/_header.html.erb | 13 ++++++++----- app/views/clock/_clock.html.erb | 17 +++++++++++++++++ 2 files changed, 25 insertions(+), 5 deletions(-) create mode 100644 app/views/clock/_clock.html.erb (limited to 'app/views') diff --git a/app/views/application/_header.html.erb b/app/views/application/_header.html.erb index 38bfcf4..af15262 100644 --- a/app/views/application/_header.html.erb +++ b/app/views/application/_header.html.erb @@ -1,10 +1,6 @@
-
+
<%= link_to "Esoterra", home_index_path, class: "no-underline" %> -
-
-
-
    <% if user_signed_in? %>
  • @@ -26,4 +22,11 @@ <% end %>
+
+
+
+
+
diff --git a/app/views/clock/_clock.html.erb b/app/views/clock/_clock.html.erb new file mode 100644 index 0000000..a47ebb1 --- /dev/null +++ b/app/views/clock/_clock.html.erb @@ -0,0 +1,17 @@ +<% time_of_day_classes = case World.time_of_day + when :firstlight + "text-transparent bg-clip-text bg-gradient-to-b from-blue-500 to-yellow-500" + when :day + "text-yellow-500" + when :twilight + "text-transparent bg-clip-text bg-gradient-to-b from-purple-500 to-yellow-500" + when :night + "text-purple-500" + else # Should never happen + "text-gray-500" + end + +%> + +<%= Time.current.strftime("%H:%M") %> +<%= World.time_of_day.to_s.capitalize %> -- cgit v1.2.3