feat(v2): list-view covers respect natural aspect; scale placeholder title

- Gallery list view: drop the `fixed` opt-out on its GameCard so the
  row thumbnail renders at the cover's natural aspect (fixed height,
  natural width) like everywhere else. Removes the now-unused `fixed`
  prop / class / CSS branch from GameCard.
- CoverPlaceholder: the title now scales with the cover box (container
  query units, clamp(8px, 8cqmin, 18px), em padding) instead of a fixed
  12px — readable on a tiny list thumb, proportionate on the detail hero.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Georges-Antoine Assi
2026-06-21 21:09:30 -04:00
parent cdb1f17902
commit 44016129b5
3 changed files with 12 additions and 17 deletions

View File

@@ -317,7 +317,6 @@ onBeforeUnmount(() => {
<GameCard
:rom="rom"
size="xs"
fixed
:webp="webp"
decorative
:show-title="false"

View File

@@ -74,11 +74,6 @@ interface Props {
* not a separate scale), so `hero` + any `size` paints the 16:9
* shape at that tier's footprint. */
size?: "xs" | "sm" | "md" | "lg" | "xl";
/** Keep the tier's fixed width×height footprint (cover cropped via
* object-fit) instead of the default fixed-height/natural-width. For
* dense aligned layouts — list-row tables — where a uniform cover
* column matters more than showing the cover's true shape. */
fixed?: boolean;
focused?: boolean;
webp?: boolean;
showPlatformIcon?: boolean;
@@ -374,7 +369,6 @@ function onStaticKeydown(e: KeyboardEvent) {
size !== 'md' && `r-gc--size-${size}`,
{
'r-gc--hero': hero,
'r-gc--fixed': fixed,
'r-gc--focused': focused,
'r-gc--static': static || decorative,
'r-gc--no-hover': noHover || decorative,
@@ -535,25 +529,24 @@ function onStaticKeydown(e: KeyboardEvent) {
color: var(--r-color-fg);
}
/* Non-hero, non-fixed cards render at a FIXED HEIGHT with NATURAL WIDTH —
same height, varying widths, never cropped. `size` just picks the height
(the default derives it from the reference width; tiers set it directly).
`hero` (16:9) and the `fixed` opt-out (dense aligned lists / tables that
need a uniform cover column) keep their fixed w×h footprint. */
/* Non-hero cards render at a FIXED HEIGHT with NATURAL WIDTH — same height,
varying widths, never cropped. `size` just picks the height (the default
derives it from the reference width; tiers set it directly). Only `hero`
(16:9) keeps a fixed w×h footprint. */
.r-gc:not([class*="r-gc--size-"]):not(.r-gc--hero) {
--r-card-art-h: calc(var(--r-card-art-w) / 0.6667);
}
.r-gc:not(.r-gc--hero):not(.r-gc--fixed) {
.r-gc:not(.r-gc--hero) {
width: auto;
display: flex;
flex-direction: column;
}
/* Width follows the cover (overrides GameCover's base `width: 100%`). */
.r-gc:not(.r-gc--hero):not(.r-gc--fixed) .r-gc__art {
.r-gc:not(.r-gc--hero) .r-gc__art {
width: auto;
}
/* Label fills the cover's width and ellipsises, without widening the card. */
.r-gc:not(.r-gc--hero):not(.r-gc--fixed) .r-gc__label {
.r-gc:not(.r-gc--hero) .r-gc__label {
width: 0;
min-width: 100%;
max-width: 100%;

View File

@@ -37,6 +37,9 @@ const artUrl = computed(() =>
align-items: center;
justify-content: center;
overflow: hidden;
/* Query container so the title can scale with the cover box's size
(tiny list thumb → big detail hero) instead of a fixed px. */
container-type: size;
}
.cover-ph__art {
position: absolute;
@@ -62,9 +65,9 @@ const artUrl = computed(() =>
position: relative;
z-index: 1;
max-width: 100%;
padding: 8px 10px;
font-size: clamp(8px, 8cqmin, 18px);
padding: 0.5em 0.7em;
text-align: center;
font-size: 12px;
font-weight: var(--r-font-weight-semibold);
line-height: 1.35;
color: var(--r-color-overlay-fg);