feat: sentence trainer prototype

feat: layout learner prototype
This commit is contained in:
2025-01-16 17:12:56 +01:00
parent a3bf9ac32b
commit e37b38085d
17 changed files with 1056 additions and 260 deletions

View File

@@ -0,0 +1,20 @@
<script lang="ts">
import { getContext } from "svelte";
import type { ReplayPlayer } from "./core/player";
import { TextPlugin } from "./core/plugins/text";
const player: { player: ReplayPlayer | undefined } = getContext("replay");
let { text = $bindable("") } = $props();
$effect(() => {
if (!player.player) return;
const tracker = new TextPlugin();
tracker.register(player.player);
const unsubscribe = tracker.subscribe((value) => {
text = value;
});
return unsubscribe;
});
</script>