Repository navigation
Tablets and other screen sizes: one layout rule, upright-tablet layout, rotate notice - #31
Merged
Merged
Conversation
…pright tablets, rotate notice computeLayout(width, height) decides the layout for every screen: phones upright get the compact layout on a 480 px stage, tablets held upright get it on a 640 px stage (they were a 1920 px stage shrunk to 43 percent, with the bottom half empty), a phone on its side gets a rotate-your-phone notice with a continue-anyway link, and everything else (laptops, tablets on their side, big and ultrawide monitors) keeps the desktop stage, which already looked right. The stage is now overflow: clip instead of hidden, because a hidden box can still be scrolled by code (focus, scrollIntoView), which shifted the whole stage out of place. The compact Tailwind variant follows the stage instead of the raw window width.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to the phone layout (#30): the other screen sizes. Same look, no new UI.
I looked at the live site at each size first. Findings:
How it works
computeLayout(width, height)insrc/lib/layout.ts(unit tested for 30+ sizes), used by the stage, the game component and the CSS. A newcompact:Tailwind variant follows the stage, so the styles and the code cannot disagree.overflow: hidden, which code can still scroll (focus,scrollIntoView). In testing, a click on START scrolled the whole stage up and to the left and cropped the page; on a tablet an input getting focus could do the same. It is nowoverflow: clip, which cannot be scrolled. There is a test that tries to scroll it.Tested
Unit 47/47 (
computeLayoutacross phones, tablets, laptops, monitors, sideways phones, wide-and-short windows);tsc; 6 new browser tests (F-08 to F-13) plus the 7 phone tests pass locally with real hand tracking; matrix is 106 rows. Looked at the screenshots at each size.