graphics-3d: expose prefers-reduced-motion
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 71/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- typescript
- Área
- game-dev
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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?
- Lenguaje dominante
- TypeScript
- Estrellas
- 7
- Forks
- 2
- Merge medio
- 1 d 17 h
- PR fusionados (30 d)
- 17
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de NanoForge-dev/Engine
-
dependencies enhancement good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
NanoForge-dev/Engine#513 ·
Los mantenedores suelen responder en 1 día
-
bug chore tests
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
NanoForge-dev/Engine#511 ·
Los mantenedores suelen responder en 1 día
-
docs(network): TSDoc says ICE_SERVERS defaults to an empty list, the code uses public STUN serversAbiertodocumentation good first issue modules:network
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
NanoForge-dev/Engine#509 ·
Los mantenedores suelen responder en 1 día
-
documentation modules:ecs packages:asset packages:core
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
NanoForge-dev/Engine#508 ·
Los mantenedores suelen responder en 1 día
-
bug good first issue modules:music modules:sound
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
NanoForge-dev/Engine#505 ·
Los mantenedores suelen responder en 1 día
Todos los issues de NanoForge-dev/Engine
Issues similares
-
Mend: dependency security vulnerability
Dificultad 1/5 1-3 horas Aptitud para principiantes 65/100
fdm-monster/fdm-monster#5563 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
be-BOP-io-SA/be-BOP#2849 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 79/100
Los mantenedores suelen responder en 1 día
-
1️⃣ phase/under-investigation flaky/confirmed flaky/needs-decision type/bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
growilabs/growi#12246 · 3 comentarios ·
Los mantenedores suelen responder en 1 día
-
🐛 The Rulekeeper - An index run that gives up on the lock ends SucceededPosiblemente ocupada @github-actions la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
SSWConsulting/SSW.Rules#2809 · 1 comentario ·
Los mantenedores suelen responder en 1 día