Skip to content

feat: lock screen orientation to landscape by default#2918

Open
sungdark wants to merge 3 commits intoFreezingMoon:masterfrom
sungdark:feature/landscape-orientation-lock
Open

feat: lock screen orientation to landscape by default#2918
sungdark wants to merge 3 commits intoFreezingMoon:masterfrom
sungdark:feature/landscape-orientation-lock

Conversation

@sungdark
Copy link
Copy Markdown

Summary

Adds automatic landscape orientation locking for mobile devices using the Screen Orientation API.

Changes

  • src/ui/fullscreen.ts: Added static lockLandscapeOrientation() method and call it when entering fullscreen
  • src/script.ts: Attempts to lock orientation to landscape on page load (works without fullscreen on some mobile browsers)

How it works

  • On page load: calls screen.orientation.lock('landscape') if the API is available
  • When entering fullscreen: also locks to landscape via the Fullscreen API
  • Gracefully handles unsupported browsers (no-op with console warning)

Related

Bounty: 16 XTR
Payment Address: eB51DWp1uECrLZRLsE2cnyZUzfRWvzUzaJzkatTpQV9

sungdark and others added 3 commits March 27, 2026 13:02
Issue: Touching hexagons on Android triggers hover behavior first,
requiring users to tap twice to perform an action.

Fix: Detect touch input via pointer.pointerType and:
- Skip hover effects for touch (onInputOver returns early for touch)
- Handle touch input directly in onInputDown (calls onConfirmFn)
- Skip onInputOut hover-off for touch (no hover was shown)
- Skip onInputUp for touch (already handled in onInputDown)

This makes touch interaction on Android feel immediate and responsive,
matching the expected single-tap behavior.
- Added lockLandscapeOrientation() method to Fullscreen class
- Attempts to lock screen to landscape on page load and when entering fullscreen
- Uses Screen Orientation API with fallback for unsupported browsers
- Fixes FreezingMoon#2711
@vercel
Copy link
Copy Markdown

vercel bot commented Mar 27, 2026

Someone is attempting to deploy a commit to the FreezingMoon Team on Vercel.

A member of the Team first needs to authorize it.

@vercel
Copy link
Copy Markdown

vercel bot commented Mar 27, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
ancientbeast Ready Ready Preview Mar 27, 2026 7:17pm

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.

landscape orintation lock [bounty: 16 XTR]

1 participant