perf(library-card): drop full-cover hover scrim, keep floating buttons
Per the 2026-05-12 user call ("para localLibrary podría aceptar
quitarle el overlay y solo dejar los botones, que al final son
funcionalidad"), the dark `rgba(0,0,0,0.85)` overlay that filled the
entire 210x210 cover on hover is gone. Each card's hover state now
fades only the 3 action buttons (play + kebab) in over 120ms; the
artwork stays fully visible underneath.
Why this matters under CPU compositing: every pointer-traversal of a
card during a mouse-wheel scroll triggered a paint of the full
overlay area (44K pixels per card alpha-blended over the cover).
Multiplied by ~80 cards in the pool and a continuous pointermove
stream, the paint cost dominated frame time. With the scrim gone,
the per-card hover paint is bounded to ~44x44 px per button
backdrop — a 30x reduction.
Buttons now carry their own `rgba(0,0,0,0.55)` backdrop so they stay
readable on light cover art. Hover boosts that to 0.8. Same visual
hierarchy as before (play primary in white, kebab outlined), just
without the curtain over the artwork.
cc
This commit is contained in:
1 file changed
+22
-13
@@ -343,14 +343,20 @@
|
|||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Dark scrim + centered action buttons. Single opacity transition,
|
/* No full-cover scrim. Earlier versions had a 210x210
|
||||||
no transform, no blur, no per-child animation. */
|
`rgba(0,0,0,0.85)` overlay with `opacity 0 → 1` on hover; that
|
||||||
|
was the single biggest scroll-time paint cost on WebKitGTK under
|
||||||
|
software compositing — every pointer-traversal of a card during
|
||||||
|
mouse-wheel scroll triggered a paint of the full overlay area.
|
||||||
|
Per the 2026-05-12 user call ("para localLibrary podría aceptar
|
||||||
|
quitarle el overlay y solo dejar los botones, que al final son
|
||||||
|
funcionalidad"), the buttons float directly on the artwork on
|
||||||
|
hover. Each button carries its own dark backdrop so they stay
|
||||||
|
readable on light covers; that's a 44x44 rect per button instead
|
||||||
|
of a 210x210 rect per card. */
|
||||||
.overlay {
|
.overlay {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
inset: 0;
|
inset: 0;
|
||||||
background: rgba(10, 10, 10, 0.85);
|
|
||||||
opacity: 0;
|
|
||||||
transition: opacity 150ms ease;
|
|
||||||
z-index: 2;
|
z-index: 2;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
@@ -358,23 +364,26 @@
|
|||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.card:hover .overlay {
|
|
||||||
opacity: 1;
|
|
||||||
pointer-events: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
.action-buttons {
|
.action-buttons {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 12px;
|
gap: 12px;
|
||||||
|
opacity: 0;
|
||||||
|
transition: opacity 120ms ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card:hover .action-buttons {
|
||||||
|
opacity: 1;
|
||||||
|
pointer-events: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.overlay-btn {
|
.overlay-btn {
|
||||||
width: 36px;
|
width: 36px;
|
||||||
height: 36px;
|
height: 36px;
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
border: 1.5px solid rgba(255, 255, 255, 0.9);
|
border: 1.5px solid rgba(255, 255, 255, 0.95);
|
||||||
background: transparent;
|
/* Per-button backdrop replaces the full-cover scrim. */
|
||||||
|
background: rgba(0, 0, 0, 0.55);
|
||||||
color: #fff;
|
color: #fff;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
@@ -384,7 +393,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.overlay-btn:hover {
|
.overlay-btn:hover {
|
||||||
background-color: rgba(255, 255, 255, 0.15);
|
background-color: rgba(0, 0, 0, 0.8);
|
||||||
}
|
}
|
||||||
|
|
||||||
.overlay-btn.primary {
|
.overlay-btn.primary {
|
||||||
|
|||||||
Reference in new issue
Block a user