Skip to content

Portrait layout support for AnimeScene/ComparisonCard/KPIGrid + HeroTitle word-wrap#340

Open
sethshoultes wants to merge 1 commit into
calesthio:mainfrom
sethshoultes:fix/portrait-layout-and-hero-title
Open

Portrait layout support for AnimeScene/ComparisonCard/KPIGrid + HeroTitle word-wrap#340
sethshoultes wants to merge 1 commit into
calesthio:mainfrom
sethshoultes:fix/portrait-layout-and-hero-title

Conversation

@sethshoultes

Copy link
Copy Markdown

Summary

Four component fixes, developed while producing portrait (1080x1920) short-form video content:

  • AnimeScene: new fit="cover" | "contain-blurred" prop. Portrait source images (e.g. a host avatar) rendered with the default cover fit on a landscape canvas get scaled ~2.5x and can push a face off-frame. contain-blurred renders a blurred/darkened cover-fit backdrop plus the full undistorted image letterboxed on top. Also fixes a real bug: two Img elements as direct siblings inside one AbsoluteFill (a flex container) compete for layout space and can both collapse to invisible — each image layer now gets its own nested AbsoluteFill, matching how the existing vignette/particle overlay layers already stack.
  • HeroTitle: wraps at word boundaries instead of mid-word (previously split per-character with no word grouping, so long titles could wrap in the middle of a word), scales font size down for long titles instead of overflowing to a third line, and exposes textColor/accentColor/subtitleColor/veil as props instead of hardcoded values.
  • ComparisonCard: portrait-mode layout (stacks the two sides top/bottom with a horizontal divider instead of left/right with a vertical one, scales down the divider dimension and caps the value font size), plus cardBackgroundColor/leftColor/rightColor props for dark-theme use.
  • KPIGrid: derives grid dimensions from the actual video's width/height instead of a hardcoded 1920x1080, and switches to a single-column layout for portrait.

Explainer.tsx/Root.tsx/SCENE_TYPES.md carry the prop plumbing and documentation for the above.

Test plan

  • Rendered multiple 1080x1920 portrait shorts using these components in production (host avatars via contain-blurred, KPI dashboards, comparison cards)
  • Verified landscape rendering is unaffected (all new behavior is behind the portrait/contain-blurred branches, existing default paths unchanged)

- AnimeScene: new fit="contain-blurred" mode for portrait source images
  on a landscape canvas (e.g. host avatars) — a blurred cover-fit backdrop
  plus the full undistorted image letterboxed on top, instead of "cover"
  scaling a portrait image ~2.5x and pushing faces off-frame. Each image
  layer now gets its own nested AbsoluteFill (previously two Img siblings
  competed for flex space and both could collapse).
- HeroTitle: wraps at word boundaries instead of mid-word, scales font
  size down for long titles, and exposes textColor/accentColor/
  subtitleColor/veil as props instead of hardcoded values.
- ComparisonCard: portrait-mode layout (stacks top/bottom with a
  horizontal divider instead of left/right with a vertical one), caps
  value font size for narrow canvases, exposes cardBackgroundColor/
  leftColor/rightColor for dark-theme use.
- KPIGrid: derives grid dimensions from actual video width/height instead
  of a hardcoded 1920x1080, single-column layout for portrait.
- Explainer/Root/SCENE_TYPES.md: prop plumbing and docs for the above.
@sethshoultes sethshoultes requested a review from calesthio as a code owner July 9, 2026 16:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant