Skip to content

fix(website): adaptive FPV FOV + landscape fullscreen for the Parthenon example#32

Merged
apresmoi merged 1 commit into
mainfrom
fix/parthenon-mobile-fov-landscape
Jul 22, 2026
Merged

fix(website): adaptive FPV FOV + landscape fullscreen for the Parthenon example#32
apresmoi merged 1 commit into
mainfrom
fix/parthenon-mobile-fov-landscape

Conversation

@apresmoi

Copy link
Copy Markdown
Owner

Follow-up to #31 fixing two mobile issues on /examples/parthenon.

1. Portrait FPV FOV was too "close"

The FPV camera used a fixed CSS-perspective focal length (perspective = 1000). Horizontal FOV ≈ atan((width/2) / P), so on a ~414px-wide portrait phone that gave ~22° (telephoto/claustrophobic) vs ~56° on desktop.

fpvPerspective() now scales P with the stage width (anchored so a desktop-width stage keeps the original value), holding a constant ~56° horizontal FOV across phone/tablet/desktop, and re-adapts on rotation/resize.

host width perspective horizontal FOV
Desktop 1059px 999 55.8°
Portrait (before) 414px 1000 ~22°
Portrait (now) 414px 391 55.8°

2. Rotating to landscape cramped / covered the screen

The compact mobile layout (sidebar → tab bar, verbose header hidden) was gated only on max-width: 50rem, which a landscape phone (896px wide) fails — so it fell back to the desktop layout, squishing the temple into a ~154px sliver behind the left rail + header.

  • Added a (max-height: 34rem) trigger to the compact-layout breakpoints (ExamplesSidebar.astro + the page dock) so short/landscape viewports get the compact layout. Benefits every example page in landscape.
  • On landscape phones the page now goes fullscreen: the site nav (.header), the examples sidebar, and the page header are hidden so the matrix fills the whole screen (landscape stage height 154px → full viewport). Rotating back to portrait restores all chrome + navigation.

Notes

  • Website-only; no library/API changes.
  • Tested on-device across portrait/landscape.

@apresmoi
apresmoi merged commit a26be36 into main Jul 22, 2026
1 check passed
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