diff options
author | David Gay <david@davidgay.org> | 2021-07-07 20:33:38 -0400 |
---|---|---|
committer | David Gay <david@davidgay.org> | 2021-07-07 20:46:27 -0400 |
commit | 8c93c5e29eceb9e85cb3eaa7ecc25653ffc50189 (patch) | |
tree | ef98cbaed0cf6388a715e79a45b4ee31d637d05a /app/views/clock | |
parent | fae9e55c6df3ec9357647a83a3a78319482a284e (diff) |
Times of day, and a primitive clock in the header
Diffstat (limited to 'app/views/clock')
-rw-r--r-- | app/views/clock/_clock.html.erb | 17 |
1 files changed, 17 insertions, 0 deletions
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") %> +<span class="font-bold <%= time_of_day_classes %>"><%= World.time_of_day.to_s.capitalize %></span> |