feat(frontend): système narrateur contextuel avec arc de révélation

Story 3.3 : Textes narrateur contextuels et arc de révélation
- Composable useNarrator.ts avec queue de messages prioritaires
- Composable useIdleDetection.ts (détection inactivité 30s)
- Plugin narrator-transitions.client.ts (déclencheurs de navigation)
- Layout adventure.vue avec NarratorBubble intégré
- Store progression: narratorStage devient un getter calculé (0-20-40-60-80%)
- Pages projets, competences, temoignages, parcours utilisent layout adventure
- Messages: intro, transitions, encouragements 25/50/75%, hints, contact_unlocked

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-02-07 03:04:07 +01:00
parent e882cd3e7a
commit 99fa61fcaa
12 changed files with 324 additions and 54 deletions

View File

@@ -0,0 +1,42 @@
export default defineNuxtPlugin(() => {
const narrator = useNarrator()
const router = useRouter()
const progressionStore = useProgressionStore()
const routeContextMap: Record<string, 'projects' | 'skills' | 'testimonials' | 'journey'> = {
'/projets': 'projects',
'/en/projects': 'projects',
'/competences': 'skills',
'/en/skills': 'skills',
'/temoignages': 'testimonials',
'/en/testimonials': 'testimonials',
'/parcours': 'journey',
'/en/journey': 'journey',
}
const announcedSections = new Set<string>()
router.afterEach((to) => {
const zone = routeContextMap[to.path]
if (zone && !announcedSections.has(zone)) {
announcedSections.add(zone)
narrator.showTransition(zone)
}
})
watch(
() => progressionStore.completionPercent,
(percent) => {
narrator.showEncouragement(percent)
},
)
watch(
() => progressionStore.contactUnlocked,
(unlocked, wasUnlocked) => {
if (unlocked && !wasUnlocked) {
narrator.showContactUnlocked()
}
},
)
})