From a86fb5f70ca1ee1cb4e32250575aa57fc8bee221 Mon Sep 17 00:00:00 2001 From: Quick104 <31828688+Quick104@users.noreply.github.com> Date: Sat, 21 Nov 2026 00:22:45 -0500 Subject: [PATCH 1/2] fix(web): keep item page hero text readable over bright artwork The item page hero's fades sit at fixed percentages of its size, so the overview, tagline and the rest of the text column fell to about 1:1 over pale artwork, worst at phone and tablet widths where the text spans the hero. Draw a shade behind the hero's text block instead: 85% of the page background, easing out above the text and past its end edge, so every hero text colour keeps 4.5:1 over pure white and the rest of the artwork keeps its brightness. On series, season and episode pages at desktop width the text block now fits its content, so the shade starts at the text. The poster sits above the shade, the hero clips instead of hiding its overflow, and a hero with no artwork draws no shade. The "Directed by" and "Written by" labels and the current breadcrumb step are no longer faded below 4.5:1. Closes #4569 Co-Authored-By: Claude Opus 5.5 --- web/docs/design-system.md | 1 + web/src/app.css | 44 +++++++++++++++++++ web/src/pages/ItemDetail/DetailHero.tsx | 7 ++- .../components/DetailBreadcrumb.tsx | 2 +- .../ItemDetail/components/HeroCrewLine.tsx | 9 ++-- web/src/pages/ItemDetail/detailLayout.css | 5 ++- 6 files changed, 58 insertions(+), 10 deletions(-) diff --git a/web/docs/design-system.md b/web/docs/design-system.md index 26b71b7524..8976c49e5e 100644 --- a/web/docs/design-system.md +++ b/web/docs/design-system.md @@ -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. diff --git a/web/src/app.css b/web/src/app.css index 679f6a709f..0b7ff5646e 100644 --- a/web/src/app.css +++ b/web/src/app.css @@ -1091,10 +1091,54 @@ 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 runs out to the hero's start edge and bottom (the hero clips it) and + eases out over 10rem above the copy and 8rem past its end edge, so the + rest of the artwork keeps its brightness. The copy's position and + isolation keep it 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; + /* A fixed length, not 100vw, reaches past the start edge of any screen + (the page shell is at most 1520px wide) and keeps the layer the same + size while the viewport resizes. */ + inset-inline: -200rem -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-end-fade: linear-gradient( + calc(-90deg * var(--dir-sign)), + 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 + ); + -webkit-mask-image: var(--detail-hero-copy-end-fade); + mask-image: var(--detail-hero-copy-end-fade); + pointer-events: none; + } + /* Item artwork stays on the browser's inexpensive image/composite path. */ .hero-backdrop-artwork { contain: strict; diff --git a/web/src/pages/ItemDetail/DetailHero.tsx b/web/src/pages/ItemDetail/DetailHero.tsx index 5a118f05c2..98160160f6 100644 --- a/web/src/pages/ItemDetail/DetailHero.tsx +++ b/web/src/pages/ItemDetail/DetailHero.tsx @@ -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 (
@@ -183,8 +185,9 @@ export default function DetailHero({ > {/* Poster */} {showPoster && ( + // z-[1] keeps the poster above the copy's scrim (app.css).
{posterUrl ? ( <> diff --git a/web/src/pages/ItemDetail/components/DetailBreadcrumb.tsx b/web/src/pages/ItemDetail/components/DetailBreadcrumb.tsx index 5b5895326d..f7e0dfcc16 100644 --- a/web/src/pages/ItemDetail/components/DetailBreadcrumb.tsx +++ b/web/src/pages/ItemDetail/components/DetailBreadcrumb.tsx @@ -36,7 +36,7 @@ export default function DetailBreadcrumb({ segments }: DetailBreadcrumbProps) { ) : ( {segment.label} diff --git a/web/src/pages/ItemDetail/components/HeroCrewLine.tsx b/web/src/pages/ItemDetail/components/HeroCrewLine.tsx index 29901d3d7b..e3f5c005c2 100644 --- a/web/src/pages/ItemDetail/components/HeroCrewLine.tsx +++ b/web/src/pages/ItemDetail/components/HeroCrewLine.tsx @@ -82,8 +82,7 @@ export default function HeroCrewLine({
{hasAuthors && ( <> - {t("web.detail.overview.byAuthors")} - + {t("web.detail.overview.byAuthors")} )} {hasAuthors && (hasDirectors || hasWriters || hasGenres) && ( @@ -91,8 +90,7 @@ export default function HeroCrewLine({ )} {hasDirectors && ( <> - {leadLabel} - + {leadLabel} )} {hasDirectors && hasWriters && ( @@ -100,8 +98,7 @@ export default function HeroCrewLine({ )} {hasWriters && ( <> - {t("web.detail.overview.writtenBy")} - + {t("web.detail.overview.writtenBy")} )} {(hasDirectors || hasWriters) && hasGenres && ( diff --git a/web/src/pages/ItemDetail/detailLayout.css b/web/src/pages/ItemDetail/detailLayout.css index 5c66775d03..7a9bbf5518 100644 --- a/web/src/pages/ItemDetail/detailLayout.css +++ b/web/src/pages/ItemDetail/detailLayout.css @@ -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%; + margin-top: auto; min-height: 0; width: 100%; } From a436a82c8bbee175cb57d765fa3a7cc73e8f2c3a Mon Sep 17 00:00:00 2001 From: Quick104 <31828688+Quick104@users.noreply.github.com> Date: Sat, 21 Nov 2026 01:54:21 -0500 Subject: [PATCH 2/2] fix(web): bound the hero text shade and keep crew names above their labels The shade behind the hero's text reached 200rem toward the start edge, so the text block's compositor layer grew to about 4,000px and resizes rasterized far more than the hero shows. Start it 100rem before the text, which still reaches the hero's start edge in windows up to 3840px wide, and fade its start side so wider windows don't show an edge. Unfading the "Directed by" and "Written by" labels left them the same colour as the crew names, and brighter than the names in high contrast. Names now use the foreground colour, and linked names underline on hover. Co-Authored-By: Claude Opus 5.5 --- web/src/app.css | 34 +++++++++++-------- .../ItemDetail/components/HeroCrewLine.tsx | 4 +-- 2 files changed, 22 insertions(+), 16 deletions(-) diff --git a/web/src/app.css b/web/src/app.css index 0b7ff5646e..35b9a695b6 100644 --- a/web/src/app.css +++ b/web/src/app.css @@ -1102,20 +1102,20 @@ html[data-navigation-direction]::view-transition-new(main-content) { 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 runs out to the hero's start edge and bottom (the hero clips it) and - eases out over 10rem above the copy and 8rem past its end edge, so the - rest of the artwork keeps its brightness. The copy's position and - isolation keep it between the hero's artwork and the copy's text. A hero - without artwork needs no shade. */ + 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; - /* A fixed length, not 100vw, reaches past the start edge of any screen - (the page shell is at most 1520px wide) and keeps the layer the same - size while the viewport resizes. */ - inset-inline: -200rem -8rem; + inset-inline: -100rem -8rem; background: linear-gradient( to bottom, transparent, @@ -1125,17 +1125,23 @@ html[data-navigation-direction]::view-transition-new(main-content) { color-mix(in srgb, var(--background) 68%, transparent) 8rem, color-mix(in srgb, var(--background) 85%, transparent) 10rem ); - --detail-hero-copy-end-fade: linear-gradient( - calc(-90deg * var(--dir-sign)), + --detail-hero-copy-side-fades: linear-gradient( + calc(90deg * var(--dir-sign)), 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 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-end-fade); - mask-image: var(--detail-hero-copy-end-fade); + -webkit-mask-image: var(--detail-hero-copy-side-fades); + mask-image: var(--detail-hero-copy-side-fades); pointer-events: none; } diff --git a/web/src/pages/ItemDetail/components/HeroCrewLine.tsx b/web/src/pages/ItemDetail/components/HeroCrewLine.tsx index e3f5c005c2..4f1cda6fa3 100644 --- a/web/src/pages/ItemDetail/components/HeroCrewLine.tsx +++ b/web/src/pages/ItemDetail/components/HeroCrewLine.tsx @@ -32,12 +32,12 @@ function CrewNames({ people }: { people: CrewPerson[] }) { {p.personId ? ( {p.name} ) : ( - {p.name} + {p.name} )} ))}