mirror of
https://github.com/CharaChorder/DeviceManager.git
synced 2025-12-11 13:26:16 +00:00
@@ -30,8 +30,6 @@
|
||||
return a + (b - a) * t;
|
||||
}
|
||||
|
||||
$inspect(chords);
|
||||
|
||||
$effect(() => {
|
||||
const [chord] = chords;
|
||||
if (!chord) return;
|
||||
|
||||
@@ -11,7 +11,8 @@
|
||||
import { onMount } from "svelte";
|
||||
import TrackText from "$lib/charrecorder/TrackText.svelte";
|
||||
import { browser } from "$app/environment";
|
||||
import { expoIn, expoOut } from "svelte/easing";
|
||||
import { expoOut } from "svelte/easing";
|
||||
import { goto } from "$app/navigation";
|
||||
|
||||
function viaLocalStorage<T>(key: string, initial: T) {
|
||||
try {
|
||||
@@ -66,18 +67,18 @@
|
||||
|
||||
let idleTimeout: ReturnType<typeof setTimeout> | null = null;
|
||||
|
||||
let cooldown = $state(false);
|
||||
|
||||
onMount(() => {
|
||||
selectNextWord();
|
||||
});
|
||||
|
||||
$effect(() => {
|
||||
if (wpm > bestWPM) {
|
||||
bestWPM = wpm;
|
||||
}
|
||||
});
|
||||
|
||||
$effect(() => {
|
||||
if (browser && $page.url.searchParams) {
|
||||
selectNextWord();
|
||||
}
|
||||
});
|
||||
|
||||
$effect(() => {
|
||||
localStorage.setItem("idle-timeout", idleTime.toString());
|
||||
});
|
||||
@@ -219,6 +220,15 @@
|
||||
|
||||
<div>
|
||||
<h1>Sentence Trainer</h1>
|
||||
<input
|
||||
type="text"
|
||||
value={inputSentence}
|
||||
onchange={(it) => {
|
||||
const params = new URLSearchParams(window.location.search);
|
||||
params.set("sentence", (it.target as HTMLInputElement).value);
|
||||
goto(`?${params.toString()}`);
|
||||
}}
|
||||
/>
|
||||
|
||||
<div class="levels">
|
||||
{#each masteryThresholds as [, , title], i}
|
||||
@@ -577,4 +587,11 @@
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
|
||||
input[type="text"] {
|
||||
background: none;
|
||||
color: inherit;
|
||||
font: inherit;
|
||||
border: none;
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user