From c2112735f8ab7d2cc99d55feac1661554a3d0841 Mon Sep 17 00:00:00 2001 From: Jason Zimdars Date: Wed, 12 Feb 2025 15:54:38 -0600 Subject: [PATCH] Try a simpler popped treatment, consistency for small bubbles --- app/assets/stylesheets/bubbles.css | 38 ++++++------------------- app/views/bubbles/_bubble.html.erb | 3 +- app/views/bubbles/_burst.html.erb | 27 ------------------ app/views/bubbles/list/_bubble.html.erb | 2 +- 4 files changed, 10 insertions(+), 60 deletions(-) delete mode 100644 app/views/bubbles/_burst.html.erb diff --git a/app/assets/stylesheets/bubbles.css b/app/assets/stylesheets/bubbles.css index bfc33fd2a..ab390d71e 100644 --- a/app/assets/stylesheets/bubbles.css +++ b/app/assets/stylesheets/bubbles.css @@ -393,8 +393,9 @@ } .bubbles-list { - --bubble-size: 1.8em; + --bubble-border-width: 0.15rem; --bubble-shift: 15deg; + --bubble-size: 1.8em; --divider-offset: 1.2em; --hover-size: 0; @@ -502,12 +503,12 @@ } .bubble__shape { - background-color: var(--bubble-background-color, var(--bubble-color)); + background: var(--bubble-background, color(from var(--bubble-color) srgb r g b / 0.15)); block-size: var(--bubble-size, 1.2em); border-color: var(--bubble-border-color, var(--bubble-color)); border-radius: var(--bubble-shape); border-style: var(--bubble-border-style, solid); - border-width: var(--bubble-border-width, 0); + border-width: var(--bubble-border-width); inline-size: var(--bubble-size, 1.2em); pointer-events: none; position: relative; @@ -517,17 +518,15 @@ .bubble & { --bubble-size: 100%; - --bubble-background-color: color(from var(--bubble-color) srgb r g b / 0.15); } .drafted & { --bubble-border-style: dashed; + } - .bubbles-list & { - --bubble-background-color: color(from var(--bubble-color) srgb r g b / 0.15); - --bubble-border-color: var(--bubble-color); - --bubble-border-width: 0.15rem; - } + .popped & { + --bubble-background: radial-gradient(circle at center, color(from var(--bubble-color) srgb r g b / 0.3), transparent); + --bubble-border-width: 0; } .bubble:has(.bubble__link) & { @@ -544,27 +543,6 @@ } } -.bubble__burst { - --bubble-border-width: 0.6rem; - - block-size: 55cqi; - inline-size: 55cqi; - position: absolute; - inset: auto -2cqi -6cqi auto; - transition: transform 200ms ease-out; - z-index: 0; - - .bubble__perma & { - --bubble-border-width: 0.3rem; - } - - @media (hover: hover) { - .windshield .bubble:hover & { - transform: translate(-1rem, 1rem) rotate(20deg); - } - } -} - .bubble__actions-container { background-color: color(from var(--bubble-color) srgb r g b / 0.15); margin-block-start: -0.7em; diff --git a/app/views/bubbles/_bubble.html.erb b/app/views/bubbles/_bubble.html.erb index b647bbd51..f45b98c41 100644 --- a/app/views/bubbles/_bubble.html.erb +++ b/app/views/bubbles/_bubble.html.erb @@ -1,5 +1,5 @@ <% cache bubble do %> -
" +
" style="view-transition-name: bubble-<%= bubble.id -%>; --bubble-color: <%= bubble.color %>; <%= bubble_rotation(bubble) %> <%= bubble_size(bubble) %>" data-controller="animation upload-preview" data-animation-play-class="bubble--wobble" @@ -32,7 +32,6 @@ <%= render "bubbles/assignments", bubble: bubble %> <%= render "bubbles/boosts", bubble: bubble %> - <%= render "bubbles/burst", bubble: bubble %> <%= render "bubbles/comments", bubble: bubble %> <%= render "bubbles/date", bubble: bubble %> <%= render "bubbles/image", bubble: bubble %> diff --git a/app/views/bubbles/_burst.html.erb b/app/views/bubbles/_burst.html.erb deleted file mode 100644 index b41fe028d..000000000 --- a/app/views/bubbles/_burst.html.erb +++ /dev/null @@ -1,27 +0,0 @@ -<% if bubble.popped? %> -
- - - - - - - - - - - - - - - - - - - - - - - -
-<% end %> \ No newline at end of file diff --git a/app/views/bubbles/list/_bubble.html.erb b/app/views/bubbles/list/_bubble.html.erb index bd49a7d11..6e066608b 100644 --- a/app/views/bubbles/list/_bubble.html.erb +++ b/app/views/bubbles/list/_bubble.html.erb @@ -1,4 +1,4 @@ -
  • " style="--bubble-color: <%= bubble.color %>; <%= bubble_rotation(bubble) %>" +
  • " style="--bubble-color: <%= bubble.color %>; <%= bubble_rotation(bubble) %>" data-controller="animation" data-animation-play-class="bubble--wobble" data-animation-play-on-load-value="true" data-action="mouseover->animation#play"> <%= link_to bucket_bubble_path(bubble.bucket, bubble), class: "flex-item-no-shrink" do %>