The globe opens full screen; a phone held sideways keeps its feed
On a phone the globe is a banner above the feed; a tap on it now opens it full screen over everything, with a close button (Escape closes it too), the focus moving to that button and back, and the feed underneath kept as it was but out of reach (inert). The camera refits the new shape. Held sideways, a phone (a window at most 30rem tall, the new short: variant) has no room for the banner: the banner and its toggle give way to a button that opens the globe full screen. isMobileMedia, which picks the first visit's default, agrees with Tailwind's md now (it was off by one) and counts a phone held sideways. GlobePanel tells its state (data-globe-state). Phone flows: the globe opens full screen and closes, and a sideways phone keeps a feed at least 180px tall with no sideways scroll. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LsXgEaXee4GCU1hwYgPJXw
This commit is contained in:
1 parent
8f15d0d5c1
commit
931b7fcff1
9 files changed
+139
-8
No files matched your search
@@ -198,6 +198,15 @@ function resize() {
|
||||
state.globe.width(width).height(height)
|
||||
pause(document.visibilityState !== "visible")
|
||||
wake()
|
||||
// a new shape (the phone's banner opened full screen, or closed again) wants the camera at another height
|
||||
const shape = narrowness()
|
||||
if (Math.abs(shape - (state.shape ?? shape)) > 0.05) {
|
||||
if (state.view)
|
||||
scheduleView()
|
||||
else
|
||||
state.globe.pointOfView({ ...state.globe.pointOfView(), altitude: 2.6 * shape }, reducedMotion.matches ? 0 : 600)
|
||||
}
|
||||
state.shape = shape
|
||||
}
|
||||
|
||||
async function build(width, height) {
|
||||
|
||||
+2
-1
@@ -123,9 +123,10 @@ window.clearAppBadge = () => {
|
||||
window.logFromJs(e.message, "clearAppBadge")
|
||||
}
|
||||
}
|
||||
// a phone: narrower than Tailwind's md, or held sideways (as short as the short: variant)
|
||||
window.isMobileMedia = () => {
|
||||
try {
|
||||
return ((window.innerWidth > 0) ? window.innerWidth : screen.width) <= 768
|
||||
return window.matchMedia("(max-width: 767.98px), (max-height: 30rem)").matches
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
window.logFromJs(e.message, "isMobileMedia")
|
||||
|
||||
Reference in new issue
Block a user