graphics-3d: expose prefers-reduced-motion
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Anfängerfreundlichkeit
- 71/100
- Issue-Typ
- Feature
- Klarheit
- Klar beschrieben
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- typescript
- Bereich
- game-dev
Rechercherichtung
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.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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?
- Vorherrschende Sprache
- TypeScript
- Sterne
- 7
- Forks
- 2
- Ø Merge
- 1 T. 17 Std.
- Gemergte PRs (30 T.)
- 17
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus NanoForge-dev/Engine
-
dependencies enhancement good first issue
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
NanoForge-dev/Engine#513 ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug chore tests
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 77/100
NanoForge-dev/Engine#511 ·
Maintainer antworten meist innerhalb von 1 Tag
-
docs(network): TSDoc says ICE_SERVERS defaults to an empty list, the code uses public STUN serversOffendocumentation good first issue modules:network
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 88/100
NanoForge-dev/Engine#509 ·
Maintainer antworten meist innerhalb von 1 Tag
-
documentation modules:ecs packages:asset packages:core
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
NanoForge-dev/Engine#508 ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug good first issue modules:music modules:sound
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
NanoForge-dev/Engine#505 ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in NanoForge-dev/Engine
Ähnliche Issues
-
Mend: dependency security vulnerability
Schwierigkeit 1/5 1-3 Stunden Anfängerfreundlichkeit 65/100
fdm-monster/fdm-monster#5563 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
be-BOP-io-SA/be-BOP#2849 ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 79/100
Maintainer antworten meist innerhalb von 1 Tag
-
1️⃣ phase/under-investigation flaky/confirmed flaky/needs-decision type/bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 65/100
growilabs/growi#12246 · 3 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
🐛 The Rulekeeper - An index run that gives up on the lock ends SucceededEvtl. vergeben @github-actions hat das heute übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
SSWConsulting/SSW.Rules#2809 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag