diff --git a/app/assets/images/bubbles-add.svg b/app/assets/images/bubbles-add.svg deleted file mode 100644 index 70be171b1..000000000 --- a/app/assets/images/bubbles-add.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/app/assets/stylesheets/animation.css b/app/assets/stylesheets/animation.css index 39b023f72..3f2af511c 100644 --- a/app/assets/stylesheets/animation.css +++ b/app/assets/stylesheets/animation.css @@ -51,3 +51,11 @@ 50% { border-radius: 46% 54% 61% 39% / 50% 51% 49% 50%; } 75% { border-radius: 54% 46% 61% 39% / 57% 49% 51% 43%; } } + +@keyframes wobble-img { + 15% { border-radius: 66% 34% 72% 28% / 39% 63% 37% 61%; } + 25% { border-radius: 55% 47% 62% 40% / 58% 50% 52% 44%; } + 33% { border-radius: 46% 54% 61% 39% / 50% 51% 49% 50%; } + 50% { border-radius: 54% 46% 61% 39% / 57% 49% 51% 43%; } + 75% { border-radius: 53% 45% 60% 38% / 56% 48% 50% 42%; } +} diff --git a/app/assets/stylesheets/bubbles.css b/app/assets/stylesheets/bubbles.css index bcff13a2a..c180524ec 100644 --- a/app/assets/stylesheets/bubbles.css +++ b/app/assets/stylesheets/bubbles.css @@ -20,8 +20,9 @@ } .bubble { - --hover-size: 0; + --bubble-border-width: 0.2rem; --bubble-color: var(--color-ink); + --hover-size: 0; aspect-ratio: 1; block-size: var(--bubble-size); @@ -56,6 +57,7 @@ } .bubble__perma & { + --bubble-border-width: 0.3rem; --bubble-size: 100% !important; z-index: 1; @@ -64,7 +66,7 @@ .bubble__bubble { background-color: var(--color-bg); - border: max(3px, 0.2em) solid var(--bubble-color); + border: var(--bubble-border-width) solid var(--bubble-color); border-radius: var(--bubble-shape); position: absolute; z-index: -1; @@ -73,13 +75,20 @@ color: var(--bubble-color); } - &:is(.bubble__boosts) { - aspect-ratio: 1; + &.bubble__boosts { + --rotation: 45deg; + + aspect-ratio: 6/9; display: flex; - inset: 75cqi 5cqi auto auto; - min-inline-size: 6ch; + inset: 70cqi 7cqi auto auto; + min-inline-size: 7ch; padding: 0; place-items: center; + transform: rotate(var(--rotation)); + + span { + transform: rotate(calc(var(--rotation) * -1)); + } form { block-size: 100%; @@ -95,13 +104,15 @@ font-weight: 800; } - .windshield .bubble:hover & { - transform: translate(0, 1rem) !important; - } - &.boosting { animation: bubble-up 500ms normal forwards ease-out; } + + @media (hover: hover) { + .windshield .bubble:hover & { + transform: rotate(calc(var(--rotation) + var(--bubble-shift) * 1)) translate(0rem, 1rem); + } + } } &.bubble__tag { @@ -115,10 +126,6 @@ } } - .windshield &:has(.bubble__tag--new) { - display: none; - } - @media (hover: hover) { .windshield .bubble:hover & { transform: translate(-1rem, -1rem); @@ -137,56 +144,53 @@ &.bubble__assignee { aspect-ratio: 1; font-size: 4.5cqi; - inset: -2cqi auto auto 26cqi; - padding: 0.4em; + inset: 4cqb auto auto -2cqi; + padding: 0.2em; + + + & { + inset: 1cqb auto auto 10cqi; + + + & { + inset: -1cqb auto auto 25cqi; + } + } select { inset: 0; position: absolute; } + .avatar { + border-radius: var(--bubble-shape); + } + @media (hover: hover) { .windshield .bubble:hover & { - transform: translate(1rem, 0); + transform: translate(1rem, -1rem); + } + + .windshield .bubble:hover & + & { + transform: translate(1rem, -1rem); + } + + .windshield .bubble:hover & + & + & { + transform: translate(1.5rem, -0.5rem);; } } } - &.bubble__assignee--new { - .windshield & { - display: none; - } - } - - &.bubble__attachment { - aspect-ratio: 1; - font-size: 4cqi; - inset: -5cqb 26cqi auto auto; - - .btn { - font-size: 4cqi; - } - - .windshield & { - display: none; - } - } - - &.bubble__color { - cursor: pointer; - inset: 8cqb auto auto 0.5cqi; - padding: 0.4em; - - .windshield & { - display: none; - } - } - &.bubble__date { - aspect-ratio: 1; + --rotation: -45deg; + + aspect-ratio: 5/7; cursor: pointer; font-size: 4.5cqi; inset: 1cqb 1cqi auto auto; + transform: rotate(var(--rotation)); + + .bubble__date-text { + transform: rotate(calc(var(--rotation) * -1)); + } label { display: grid; @@ -196,13 +200,11 @@ grid-area: 1/1; } } - } - &.bubble__date--new { - padding: 0.7em; - - .windshield & { - display: none; + @media (hover: hover) { + .windshield .bubble:hover & { + transform: rotate(calc(var(--rotation) + var(--bubble-shift) * 1)) translate(0rem, 0.5rem); + } } } @@ -264,9 +266,9 @@ border-radius: var(--bubble-shape); block-size: 100cqi; inline-size: 100cqi; - overflow: clip; + overflow: hidden; pointer-events: none; - transform: rotate(var(--bubble-rotate)) scale(0.9); + transform: rotate(var(--bubble-rotate)) scale(0.92); transition: 0.2s ease; @media (hover: hover) { @@ -278,13 +280,18 @@ img { block-size: 100cqi; inline-size: 100cqi; + max-inline-size: none; object-fit: cover; - transform: rotate(calc(var(--bubble-rotate) * -1)); + transform: rotate(calc(var(--bubble-rotate) * -1)) scale(1.1); &:is([src=""]) { display: none; } } + + :is(.windshield, .bubbles-list) .bubble--wobble & { + animation: wobble-img 1200ms normal forwards ease-out; + } } .bubble__link { @@ -294,13 +301,9 @@ z-index: -1; } -.bubble__notes { - position: relative; -} - .bubble__perma { block-size: 100%; - max-block-size: 65dvh; + max-block-size: 40dvh; max-inline-size: 100%; } @@ -400,18 +403,6 @@ } } -.bubble__popped { - position: absolute; - top: 50%; - left: 50%; - background-color: red; - color: white; - padding: 1rem 2rem; - font-size: 200%; - border-radius: 4px; - transform: rotate(-35deg) translate(-25%, -50%); -} - .bubble__shape { background-color: var(--bubble-color); block-size: 1.2em; @@ -425,7 +416,7 @@ .bubble & { background-color: color(from var(--bubble-color) srgb r g b / 0.15); - border: 0.2em solid var(--bubble-color); + border: var(--bubble-border-width) solid var(--bubble-color); block-size: 100%; inline-size: 100%; } @@ -434,10 +425,6 @@ z-index: -1; } - .bubble__perma & { - border-width: 0.4em; - } - :is(.windshield, .bubbles-list) .bubble--wobble & { animation: wobble 1200ms normal forwards ease-out; } diff --git a/app/assets/stylesheets/buttons.css b/app/assets/stylesheets/buttons.css index 7e64c1c04..87554cddf 100644 --- a/app/assets/stylesheets/buttons.css +++ b/app/assets/stylesheets/buttons.css @@ -195,14 +195,6 @@ --btn-padding: 0; --hover-size: 0; --outline-size: 0; - - @media (hover: hover) { - transition: scale 200ms ease-out; - - &:has(img):hover { - scale: 1.2; - } - } } .btn--positive { diff --git a/app/assets/stylesheets/layout.css b/app/assets/stylesheets/layout.css index eccf7dcab..3cb50a695 100644 --- a/app/assets/stylesheets/layout.css +++ b/app/assets/stylesheets/layout.css @@ -1,6 +1,6 @@ body { display: grid; - grid-template-rows: auto auto 1fr auto var(--block-space); + grid-template-rows: auto 1fr auto var(--block-space); } :where(#main) { diff --git a/app/helpers/filters_helper.rb b/app/helpers/filters_helper.rb index 2434df901..13413280b 100644 --- a/app/helpers/filters_helper.rb +++ b/app/helpers/filters_helper.rb @@ -1,7 +1,6 @@ module FiltersHelper - def filter_chip_tag(text, name:, value:) - tag.button class: "btn txt-small btn--remove", data: { action: "filter-form#removeFilter form#submit", filter_form_target: "chip" } do - concat hidden_field_tag(name, value, id: nil) + def filter_chip_tag(text, params) + link_to bubbles_path(params), class: "btn txt-small btn--remove" do concat tag.span(text) concat image_tag("close.svg", aria: { hidden: true }, size: 24) end diff --git a/app/javascript/controllers/filter_form_controller.js b/app/javascript/controllers/filter_form_controller.js index 3e54f5837..30610f450 100644 --- a/app/javascript/controllers/filter_form_controller.js +++ b/app/javascript/controllers/filter_form_controller.js @@ -1,17 +1,6 @@ import { Controller } from "@hotwired/stimulus" export default class extends Controller { - static targets = [ "chip" ] - - connect() { - this.chipTargets.forEach(button => this.#showChip(button)) - } - - removeFilter(event) { - event.preventDefault() - this.#hideChip(event.target.closest("button")) - } - clearCategory({ params: { name } }) { name.split(",").forEach(name => { this.element.querySelectorAll(`input[name="${name}"]`).forEach(input => { @@ -19,14 +8,4 @@ export default class extends Controller { }) }) } - - #showChip(button) { - button.querySelector("input").disabled = false - button.hidden = false - } - - #hideChip(button) { - button.querySelector("input").disabled = true - button.hidden = true - } } diff --git a/app/models/filter/params.rb b/app/models/filter/params.rb index 71be9eb85..8938840eb 100644 --- a/app/models/filter/params.rb +++ b/app/models/filter/params.rb @@ -24,4 +24,11 @@ module Filter::Params params[:filter_id] = id if persisted? end end + + def params_without(key, value) + to_params.tap do |params| + params[key].delete(value) if params[key].is_a?(Array) + params.delete(key) if params[key] == value + end + end end diff --git a/app/views/boosts/_boosts.html.erb b/app/views/boosts/_boosts.html.erb index 4f187c4d4..ec91dcb16 100644 --- a/app/views/boosts/_boosts.html.erb +++ b/app/views/boosts/_boosts.html.erb @@ -9,6 +9,6 @@ class: "btn btn--plain", data: { action: "toggle-class#toggle" }, form_class: "full-width" do %> - + <%= bubble.boost_count if bubble.boost_count.positive? %> + <%= tag.span("+ #{bubble.boost_count}") if bubble.boost_count.positive? %> <% end %> <% end %> diff --git a/app/views/bubbles/_assignments.html.erb b/app/views/bubbles/_assignments.html.erb index ca46c0a01..eae3e7f3b 100644 --- a/app/views/bubbles/_assignments.html.erb +++ b/app/views/bubbles/_assignments.html.erb @@ -1,18 +1,8 @@ -<% if bubble.assignments.any? %> +<% bubble.assignments.each do |assignment| %>