Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions web/docs/design-system.md
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,7 @@ Full-bleed backdrop image that commands the viewport. Gradient overlays dissolve

Implementation cues:
- Use `.hero-gradient` for the bottom-to-top fade, `.hero-gradient-radial` for vignette, `.hero-gradient-left` for sidebar-edge fade.
- Text over hero artwork must keep 4.5:1 over the brightest artwork, at every width. Percentage fades can't promise that where the text block spans the hero, so the item detail hero draws a shade behind its text block instead (`.detail-hero-copy::before` in `app.css`). Its 85% strength is derived from the dimmest hero text colour; dimmer hero text needs a stronger shade.
- Use display typography (`--font-display`) at `text-5xl` to `text-7xl` for the title.
- Keep metadata compact and secondary (badges, small text).
- Apply Ken Burns motion to the backdrop image for ambient life.
Expand Down
50 changes: 50 additions & 0 deletions web/src/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -1116,10 +1116,60 @@ html[data-navigation-direction]::view-transition-new(main-content) {
hero copy itself does not move at desktop widths, so repainting it for
every intermediate viewport size only stalls the browser UI animation. */
.detail-hero-copy {
position: relative;
isolation: isolate;
transform: translateZ(0);
backface-visibility: hidden;
}

/* A shade behind the hero's text, so it keeps 4.5:1 over any artwork. The
hero's own fades sit at fixed percentages of its size and can't follow
copy that ends mid-hero on a desktop and fills it on a phone. 85% of
--background is the least that keeps every hero text colour, down to
--muted-foreground and `text-foreground/60`, at 4.5:1 over pure white.
It eases out over 10rem above the copy and 8rem past its end edge, so the
rest of the artwork keeps its brightness, and runs on to the bottom and
100rem before the copy. That reaches the hero's start edge in windows up
to 3840px wide; on wider ones the start fade (.detail-hero-scrim-under)
is dark where it ends. Fixed lengths keep the copy's compositor layer
small and the same size while the viewport resizes. The copy's position
and isolation keep the shade between the hero's artwork and the copy's
text. A hero without artwork needs no shade. */
.item-detail-hero:has(> .hero-backdrop-artwork) .detail-hero-copy::before {
content: "";
position: absolute;
z-index: -1;
inset-block: -10rem -4rem;
inset-inline: -100rem -8rem;
background: linear-gradient(
to bottom,
transparent,
color-mix(in srgb, var(--background) 5%, transparent) 2rem,
color-mix(in srgb, var(--background) 20%, transparent) 4rem,
color-mix(in srgb, var(--background) 44%, transparent) 6rem,
color-mix(in srgb, var(--background) 68%, transparent) 8rem,
color-mix(in srgb, var(--background) 85%, transparent) 10rem
);
--detail-hero-copy-side-fades: linear-gradient(
calc(90deg * var(--dir-sign)),

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: the mask is symmetric. It has the same 8rem fade, with the same stops, at both ends, so flipping its angle in RTL produces the same mask. calc(90deg * var(--dir-sign)) changes nothing here, and the PR description's "mirrored by --dir-sign" makes it look like something depends on reading direction. RTL support comes from the inset-inline offsets. A plain 90deg (or to right) gives the same result in both directions. Use --dir-sign only if the two ends ever get different fades.

transparent,
rgb(0 0 0 / 6%) 1.6rem,
rgb(0 0 0 / 24%) 3.2rem,
rgb(0 0 0 / 52%) 4.8rem,
rgb(0 0 0 / 80%) 6.4rem,
#000 8rem,
#000 calc(100% - 8rem),
rgb(0 0 0 / 80%) calc(100% - 6.4rem),
rgb(0 0 0 / 52%) calc(100% - 4.8rem),
rgb(0 0 0 / 24%) calc(100% - 3.2rem),
rgb(0 0 0 / 6%) calc(100% - 1.6rem),
transparent
);
-webkit-mask-image: var(--detail-hero-copy-side-fades);
mask-image: var(--detail-hero-copy-side-fades);
pointer-events: none;
}

/* Item artwork stays on the browser's inexpensive image/composite path. */
.hero-backdrop-artwork {
contain: strict;
Expand Down
7 changes: 5 additions & 2 deletions web/src/pages/ItemDetail/DetailHero.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,11 @@ export default function DetailHero({
}
})();

// overflow-clip, not -hidden: the copy's scrim (app.css) reaches past the
// hero, and a hidden-overflow box would let focus or find scroll the hero.
return (
<section
className="item-detail-hero border-border/10 relative isolate overflow-hidden border-b"
className="item-detail-hero border-border/10 relative isolate overflow-clip border-b"
data-variant={variant}
data-viewport-bounded={isViewportBounded || undefined}
>
Expand Down Expand Up @@ -183,8 +185,9 @@ export default function DetailHero({
>
{/* Poster */}
{showPoster && (
// z-[1] keeps the poster above the copy's scrim (app.css).
<div
className={`media-card-image border-border/20 relative border shadow-[var(--shadow-md)] ${posterSizeClass}`}
className={`media-card-image border-border/20 relative z-[1] border shadow-[var(--shadow-md)] ${posterSizeClass}`}
>
{posterUrl ? (
<>
Expand Down
2 changes: 1 addition & 1 deletion web/src/pages/ItemDetail/components/DetailBreadcrumb.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export default function DetailBreadcrumb({ segments }: DetailBreadcrumbProps) {
</ViewTransitionLink>
) : (
<span
className="text-muted-foreground/60 text-[0.8125rem]"
className={`${isLast ? "text-foreground" : "text-muted-foreground"} text-[0.8125rem]`}
{...(isLast ? { "aria-current": "page" as const } : {})}
>
{segment.label}
Expand Down
13 changes: 5 additions & 8 deletions web/src/pages/ItemDetail/components/HeroCrewLine.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ function CrewNames({ people }: { people: CrewPerson[] }) {
{p.personId ? (
<ViewTransitionLink
to={buildPersonCatalogHref(p.personId)}
className="text-foreground/70 hover:text-foreground/90 font-medium transition-colors"
className="text-foreground font-medium underline-offset-2 hover:underline"
>
{p.name}
</ViewTransitionLink>
) : (
<span className="text-foreground/70 font-medium">{p.name}</span>
<span className="text-foreground font-medium">{p.name}</span>
)}
</span>
))}
Expand Down Expand Up @@ -82,26 +82,23 @@ export default function HeroCrewLine({
<div className="text-muted-foreground text-[0.8125rem]">
{hasAuthors && (
<>
<span className="text-muted-foreground/60">{t("web.detail.overview.byAuthors")} </span>
<CrewNames people={authors} />
{t("web.detail.overview.byAuthors")} <CrewNames people={authors} />
</>
)}
{hasAuthors && (hasDirectors || hasWriters || hasGenres) && (
<span className="text-muted-foreground/40 mx-2">{t("web.detail.separator.dot")}</span>
)}
{hasDirectors && (
<>
<span className="text-muted-foreground/60">{leadLabel} </span>
<CrewNames people={directors} />
{leadLabel} <CrewNames people={directors} />
Comment thread
Quick104 marked this conversation as resolved.
Resolved
</>
)}
{hasDirectors && hasWriters && (
<span className="text-muted-foreground/40 mx-2">{t("web.detail.separator.dot")}</span>
)}
{hasWriters && (
<>
<span className="text-muted-foreground/60">{t("web.detail.overview.writtenBy")} </span>
<CrewNames people={writers} />
{t("web.detail.overview.writtenBy")} <CrewNames people={writers} />
</>
)}
{(hasDirectors || hasWriters) && hasGenres && (
Expand Down
5 changes: 4 additions & 1 deletion web/src/pages/ItemDetail/detailLayout.css
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,13 @@
min-height: 0;
}

/* The copy hugs its text from the bottom of the hero instead of filling its
height, so the scrim it draws behind itself (app.css) starts at the text. */
.item-detail-hero[data-viewport-bounded="true"] .detail-hero-copy {
display: flex;
flex-direction: column;
height: 100%;
max-height: 100%;

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

G1 (medium): Changing .detail-hero-copy from height: 100% to max-height: 100% makes .detail-action-bar's percentage max-height (65% at line 85, 45% at line 186) resolve against the copy's own content height instead of the hero height whenever the copy does not fill the hero.

On episode pages (EpisodeContent passes hidePoster), .detail-hero-primary-content stays a column flex container with a definite height, so .detail-hero-copy's shrunken flexed main size is still definite (CSS Flexbox §9.8 item 1). That matches main when the copy overflows and hits max-height: 100% (such as a ~430px action bar), which is why the earlier check saw identical boxes. When the copy sits below hero height, the percentage shrinks with it and clips .detail-action-bar into a scrollbar-hidden box (scrollbar-width: none) while unused vertical space sits above the copy:

  • Single-episode page at 1280x550 (@container detail-viewport (max-height: 600px), max-height: 45%), 145px info (e.g., breadcrumb + title + badges with no overview or a spoiler-hidden overview) + 140px wrapped action bar: hero inner height is 490px and .detail-hero-copy shrinks to 309px, so .detail-action-bar clips to 135px of 140px (main: 140px, unclipped). Verified in headless Chromium and Firefox.
  • Multi-episode or single-episode page at 1440x900 (max-height: 65%), 90px info + 250px action bar: hero height is 680px / 900px and .detail-hero-copy shrinks to 376px, clipping .detail-action-bar to 239px of 250px (main: 250px, unclipped). Verified in headless Chromium and Firefox.

(On desktop series/season, .detail-hero-primary-content is a row flex container with align-items: end, so max-height: 100% leaves copy height indefinite and turns max-height: 65% into none, which is harmless because .series-detail-viewport grows with height: auto.)

Suggested fix: Resolve the action-bar cap against the detail-viewport container rather than .detail-hero-copy, and lift it on the desktop layouts that already switch to height: auto / container-type: normal (lines 478–484):

  • Line 85: max-height: calc((100cqh - 88px) * 0.65);
  • Line 186: max-height: calc((100cqh - 68px) * 0.45);
  • Inside @media (min-width: 1024px) (lines 477–507): set max-height: none; on .series-detail-viewport .detail-hero-copy > .detail-action-bar and .episode-detail-viewport:has(> .episode-detail-navigation) .detail-hero-copy > .detail-action-bar.

margin-top: auto;
Comment thread
Quick104 marked this conversation as resolved.
Resolved
min-height: 0;
width: 100%;
}
Expand Down
Loading