mirror of
https://github.com/deunix-educ/PyQuest.git
synced 2026-11-25 08:19:44 +01:00
f732a5a765
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
24 lines
721 B
JavaScript
24 lines
721 B
JavaScript
// Bulle du personnage-guide : avatar (chouette) + message. Décoratif pour les lecteurs d'écran
|
|
// (l'avatar est masqué) ; le texte reste lisible dans l'ordre de lecture.
|
|
|
|
import { el } from './dom.js';
|
|
import { createOwl } from './guideArt.js';
|
|
|
|
export class GuideBubble {
|
|
#root;
|
|
|
|
/** @param {{text: string, mood: string}} message Issu de GuideEngine.say(). */
|
|
constructor({ text, mood }) {
|
|
this.#root = el(
|
|
'div',
|
|
{ class: 'guide-bubble', 'data-mood': mood },
|
|
el('div', { class: 'guide-avatar', 'aria-hidden': 'true' }, createOwl()),
|
|
el('p', { class: 'guide-text', text }),
|
|
);
|
|
}
|
|
|
|
get element() {
|
|
return this.#root;
|
|
}
|
|
}
|