Stub out considering bubble

This commit is contained in:
Andy Smith
2025-05-14 14:53:09 -05:00
parent d568a7ff13
commit 95298d4fce
4 changed files with 19 additions and 4 deletions
+5
View File
@@ -51,3 +51,8 @@
inset-inline-start: calc(-1 * var(--bubble-gap));
translate: -100% -50%;
}
.bubble--considering {
inset-inline-end: calc(-1 * var(--bubble-gap));
translate: 100% -50%;
}
+6 -1
View File
@@ -2,7 +2,7 @@ module Card::Closeable
extend ActiveSupport::Concern
AUTO_CLOSE_AFTER = 30.days
AUTO_CLOSE_REMINDER_BEFORE = 7.days
AUTO_CLOSE_REMINDER_BEFORE = 29.days
included do
has_one :closure, dependent: :destroy
@@ -37,6 +37,11 @@ module Card::Closeable
considering? && auto_closing? && Time.current >= auto_close_at - AUTO_CLOSE_REMINDER_BEFORE
end
# TMP
def considering_soon?
true
end
def closed?
closure.present?
end
+5 -1
View File
@@ -30,7 +30,11 @@
<%= render "cards/display/common/background", card: card %>
<% if card.closing_soon? %>
<%= render "cards/display/preview/bubble", days: card.days_until_close, class: "bubble--closing" %>
<%= render "cards/display/preview/bubble", label: "Closes", days: card.days_until_close, class: "bubble--closing" %>
<% end %>
<% if card.considering_soon? %>
<%= render "cards/display/preview/bubble", label: "Considering", days: card.days_until_close, class: "bubble--considering" %>
<% end %>
<% end %>
<% end %>
@@ -1,9 +1,10 @@
<div class="bubble <%= local_assigns[:class] || "" %>">
<div class="bubble <%= local_assigns[:class] %>">
<svg viewBox="0 0 200 100">
<path id="top-half" fill="transparent" d="M 20,100 A 80,80 0 0,1 180,100" />
<text text-anchor="middle" fill="currentColor">
<textPath href="#top-half" startOffset="50%" dominant-baseline="middle">
<%= days < 1 ? "Closes" : "Closes in" %>
<%= local_assigns[:label] %>
<%= " in" if days < 1 %>
</textPath>
</text>
</svg>