graphics-3d: expose prefers-reduced-motion
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 71/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- typescript
- Ambito
- game-dev
Direzione di ricerca
Start in the graphics-3d package and trace how ctx.graphics is exposed and how __clear handles cleanup. Use the container's ownerDocument.defaultView for matchMedia, keep the value updated when the preference changes, and remove the listener during cleanup. Add documentation with a camera-shake example and test the behavior using a stubbed matchMedia.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Which package or utils is this feature request for?
graphics-3d
Feature
Some players get motion sickness from camera shake, fast camera moves or flashing effects. The OS setting prefers-reduced-motion tells us, but game code has no easy way to read it.
This is not specific to 3D: a 2D game (graphics-2d) needs the same flag.
Ideal solution or implementation
Expose ctx.graphics.prefersReducedMotion: boolean. It is backed by matchMedia("(prefers-reduced-motion: reduce)") on the container's window (container.ownerDocument.defaultView), and it updates live when the setting changes. The listener is removed on __clear (graphics-3d __clear).
Document it with an example (skip camera shake when it is true).
Acceptance criteria:
- The flag is readable from game code and is
truewhen(prefers-reduced-motion: reduce)matches. - It updates live when the media query fires
change. - The
changelistener is removed on__clear. - A test covers the three points above with a stubbed
matchMedia. - A docs page shows the example (skip camera shake when it is true).
Alternative solutions or implementations
A shared helper in @nanoforge-dev/common, or a core-provided value, so 2D games get it too. Core already reads a media query the same way for the pixel ratio (InternalViewportState._watchPixelRatio) and exposes the result to every library as ctx.viewport (context type).
Other context
Deferred from the first version of graphics-3d (benchmark criteria E2/E3).
Open questions (not recorded, ask the team):
- Where does the flag live: in
@nanoforge-dev/common/ core (so graphics-2d games get it too), or in graphics-3d only?
- Lingua principale
- TypeScript
- Stelle
- 7
- Fork
- 2
- Merge medio
- 1g 17h
- PR unite (30g)
- 17
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di NanoForge-dev/Engine
-
dependencies enhancement good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
NanoForge-dev/Engine#513 ·
I maintainer di solito rispondono entro 1 giorno
-
bug chore tests
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
NanoForge-dev/Engine#511 ·
I maintainer di solito rispondono entro 1 giorno
-
docs(network): TSDoc says ICE_SERVERS defaults to an empty list, the code uses public STUN serversApertadocumentation good first issue modules:network
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
NanoForge-dev/Engine#509 ·
I maintainer di solito rispondono entro 1 giorno
-
documentation modules:ecs packages:asset packages:core
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
NanoForge-dev/Engine#508 ·
I maintainer di solito rispondono entro 1 giorno
-
bug good first issue modules:music modules:sound
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
NanoForge-dev/Engine#505 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di NanoForge-dev/Engine
Issue simili
-
Mend: dependency security vulnerability
Difficoltà 1/5 1-3 ore Idoneità per principianti 65/100
fdm-monster/fdm-monster#5563 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
be-BOP-io-SA/be-BOP#2849 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 79/100
I maintainer di solito rispondono entro 1 giorno
-
1️⃣ phase/under-investigation flaky/confirmed flaky/needs-decision type/bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
growilabs/growi#12246 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
🐛 The Rulekeeper - An index run that gives up on the lock ends SucceededForse già presa @github-actions l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
SSWConsulting/SSW.Rules#2809 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno