mirror of
https://github.com/CharaChorder/DeviceManager.git
synced 2026-01-21 17:32:41 +00:00
@@ -30,8 +30,6 @@
|
|||||||
return a + (b - a) * t;
|
return a + (b - a) * t;
|
||||||
}
|
}
|
||||||
|
|
||||||
$inspect(chords);
|
|
||||||
|
|
||||||
$effect(() => {
|
$effect(() => {
|
||||||
const [chord] = chords;
|
const [chord] = chords;
|
||||||
if (!chord) return;
|
if (!chord) return;
|
||||||
|
|||||||
@@ -11,7 +11,8 @@
|
|||||||
import { onMount } from "svelte";
|
import { onMount } from "svelte";
|
||||||
import TrackText from "$lib/charrecorder/TrackText.svelte";
|
import TrackText from "$lib/charrecorder/TrackText.svelte";
|
||||||
import { browser } from "$app/environment";
|
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) {
|
function viaLocalStorage<T>(key: string, initial: T) {
|
||||||
try {
|
try {
|
||||||
@@ -66,18 +67,18 @@
|
|||||||
|
|
||||||
let idleTimeout: ReturnType<typeof setTimeout> | null = null;
|
let idleTimeout: ReturnType<typeof setTimeout> | null = null;
|
||||||
|
|
||||||
let cooldown = $state(false);
|
|
||||||
|
|
||||||
onMount(() => {
|
|
||||||
selectNextWord();
|
|
||||||
});
|
|
||||||
|
|
||||||
$effect(() => {
|
$effect(() => {
|
||||||
if (wpm > bestWPM) {
|
if (wpm > bestWPM) {
|
||||||
bestWPM = wpm;
|
bestWPM = wpm;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$effect(() => {
|
||||||
|
if (browser && $page.url.searchParams) {
|
||||||
|
selectNextWord();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
$effect(() => {
|
$effect(() => {
|
||||||
localStorage.setItem("idle-timeout", idleTime.toString());
|
localStorage.setItem("idle-timeout", idleTime.toString());
|
||||||
});
|
});
|
||||||
@@ -219,6 +220,15 @@
|
|||||||
|
|
||||||
<div>
|
<div>
|
||||||
<h1>Sentence Trainer</h1>
|
<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">
|
<div class="levels">
|
||||||
{#each masteryThresholds as [, , title], i}
|
{#each masteryThresholds as [, , title], i}
|
||||||
@@ -577,4 +587,11 @@
|
|||||||
opacity: 1;
|
opacity: 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
input[type="text"] {
|
||||||
|
background: none;
|
||||||
|
color: inherit;
|
||||||
|
font: inherit;
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Reference in New Issue
Block a user