Another pass at basic moments

Adding diary, name of powers, name of moment type, and some supporting
thoughts.

Added a debug menu item to disable or enable the eleven labs speech.
Useful for removing it when debugging
This commit is contained in:
Tyler Marques 2025-05-29 16:20:17 -07:00
parent e1309c4012
commit ecf8e1db06
No known key found for this signature in database
GPG key ID: CB99EDCF41D3016F
7 changed files with 227 additions and 23 deletions

View file

@ -6,6 +6,7 @@
import { updateNextMomentDisplay, initNextMomentTool } from "./nextMoment";
import { initDebugProvinceHighlighting } from "./provinceHighlight";
import { initInstantChatTool } from "./instantChat";
import { initSpeechToggleTool } from "./speechToggle";
export class DebugMenu {
private toggleBtn: HTMLButtonElement;
@ -172,6 +173,7 @@ export class DebugMenu {
}
private initTools(): void {
initSpeechToggleTool(this);
initInstantChatTool(this);
initNextMomentTool(this);
initDebugProvinceHighlighting()

View file

@ -0,0 +1,37 @@
/**
* Speech Toggle Debug Tool
* Allows toggling text-to-speech functionality on/off
*/
import { config } from "../config";
import type { DebugMenu } from "./debugMenu";
/**
* Initializes the speech toggle debug tool
* @param debugMenu - The debug menu instance to add this tool to
*/
export function initSpeechToggleTool(debugMenu: DebugMenu): void {
const content = `
<div style="margin: 8px 0;">
<label style="display: flex; align-items: center; gap: 8px; cursor: pointer;">
<input type="checkbox" id="speech-toggle-checkbox" ${config.speechEnabled ? 'checked' : ''}>
<span>Enable Text-to-Speech</span>
</label>
<small style="color: #666; margin-top: 4px; display: block;">
Controls whether phase summaries are spoken aloud
</small>
</div>
`;
debugMenu.addDebugTool('Speech Control', content);
// Add event listener for the checkbox
const checkbox = document.getElementById('speech-toggle-checkbox') as HTMLInputElement;
if (checkbox) {
checkbox.addEventListener('change', (event) => {
const target = event.target as HTMLInputElement;
config.speechEnabled = target.checked;
console.log(`Speech ${config.speechEnabled ? 'enabled' : 'disabled'}`);
});
}
}