Back

Version 106

10/18/2024
/** @jsxImportSource https://esm.sh/react */
import React, { useEffect, useRef, useState } from "https://esm.sh/react";
import { createRoot } from "https://esm.sh/react-dom/client";

interface WordEntry {
word: string;
timePerChar: number;
}

interface KeyStats {
[key: string]: { count: number; totalTime: number };
}

const KEY_CATEGORIES = {
letters: "qweruiopasdfghjklzxcvbnm",
symbols: "[`',;.]\/",
shiftSymbols: `{~"<:}>}|?`,
};

const EXERCISE_TYPES = [
{ name: "Letters", keys: KEY_CATEGORIES.letters },
{ name: "Letters and Symbols", keys: KEY_CATEGORIES.letters + KEY_CATEGORIES.symbols },
{
name: "Shift",
keys: KEY_CATEGORIES.letters + KEY_CATEGORIES.symbols + KEY_CATEGORIES.shiftSymbols
+ KEY_CATEGORIES.letters.toUpperCase(),
},
];

const TAB_UNICODE = "⇥"; // Unicode character for tab

function App() {
const [currentWords, setCurrentWords] = useState("");
const [userInput, setUserInput] = useState("");
const [loading, setLoading] = useState(true);
const [startTime, setStartTime] = useState<number | null>(null);
vprtwn-svaltown.web.val.run
Updated: October 21, 2024