✨ Add DialoguePNJ component with typewriter effect (Story 2.7)
- Create useReducedMotion composable for motion preferences - Create useTypewriter composable with accelerate/skip support - Add DialoguePNJ component with Zelda-style dialogue system - Add personality-based styling (sage, sarcastique, enthousiaste, professionnel) - Implement keyboard navigation (arrows, space) - Add toggle between dialogue and list view modes - Add i18n translations for dialogue UI Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
20
frontend/app/composables/useReducedMotion.ts
Normal file
20
frontend/app/composables/useReducedMotion.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
export function useReducedMotion() {
|
||||
const reducedMotion = ref(false)
|
||||
|
||||
if (import.meta.client) {
|
||||
const mediaQuery = window.matchMedia('(prefers-reduced-motion: reduce)')
|
||||
reducedMotion.value = mediaQuery.matches
|
||||
|
||||
const handler = (e: MediaQueryListEvent) => {
|
||||
reducedMotion.value = e.matches
|
||||
}
|
||||
|
||||
mediaQuery.addEventListener('change', handler)
|
||||
|
||||
onUnmounted(() => {
|
||||
mediaQuery.removeEventListener('change', handler)
|
||||
})
|
||||
}
|
||||
|
||||
return readonly(reducedMotion)
|
||||
}
|
||||
Reference in New Issue
Block a user