fix: replace ASCII umlauts with proper German umlauts throughout UI and prompts
- index.html: Wähle, Zurück, Übersicht, zurücksetzen, üben - screens.ts: Üben, Wörter phase labels - companion.ts: All Gemini prompts use proper umlauts - fallbacks.ts: All fallback texts use proper umlauts - parent.ts: löschen, überschreiben confirmations - reward.ts: für, grüner, Eichhörnchen - Tests updated to match Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -2,6 +2,8 @@ import { getDB } from "../app";
|
||||
import { getSettings } from "../storage/db";
|
||||
|
||||
let audioCtx: AudioContext | null = null;
|
||||
let ambientAudio: HTMLAudioElement | null = null;
|
||||
let ambientStarted = false;
|
||||
|
||||
/**
|
||||
* Creates or resumes AudioContext on first user interaction.
|
||||
@@ -21,6 +23,39 @@ export function initAudioOnInteraction(): void {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Start ambient forest sounds (loops quietly in background).
|
||||
* Called once on first user interaction alongside AudioContext init.
|
||||
*/
|
||||
export async function startAmbientSound(): Promise<void> {
|
||||
if (ambientStarted) return;
|
||||
ambientStarted = true;
|
||||
try {
|
||||
if (!(await isAudioEnabled())) return;
|
||||
ambientAudio = new Audio("/forest-birds.mp3");
|
||||
ambientAudio.loop = true;
|
||||
ambientAudio.volume = 0.08;
|
||||
ambientAudio.play().catch(() => {
|
||||
// Autoplay blocked — will retry on next interaction
|
||||
ambientStarted = false;
|
||||
});
|
||||
} catch {
|
||||
ambientStarted = false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Update ambient sound state based on mute toggle.
|
||||
*/
|
||||
export function setAmbientMuted(muted: boolean): void {
|
||||
if (!ambientAudio) return;
|
||||
if (muted) {
|
||||
ambientAudio.pause();
|
||||
} else {
|
||||
ambientAudio.play().catch(() => {});
|
||||
}
|
||||
}
|
||||
|
||||
async function isAudioEnabled(): Promise<boolean> {
|
||||
try {
|
||||
const db = getDB();
|
||||
|
||||
Reference in New Issue
Block a user