Back

Version 17

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

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

const KEY_CATEGORIES = {
top: 'qweruiop',
center: 'asdfghjkl',
bottom: 'zxcvbnm',
left: 'qazwsxedc',
right: 'uiopjklbnm',
all: 'qweruiopasdfghjklzxcvbnm'
};

const EXERCISE_TYPES = [
{ name: 'Top Row', keys: KEY_CATEGORIES.top },
{ name: 'Center Row', keys: KEY_CATEGORIES.center },
{ name: 'Bottom Row', keys: KEY_CATEGORIES.bottom },
{ name: 'Left Hand', keys: KEY_CATEGORIES.left },
{ name: 'Right Hand', keys: KEY_CATEGORIES.right },
{ name: 'Top and Center', keys: KEY_CATEGORIES.top + KEY_CATEGORIES.center },
{ name: 'Center and Bottom', keys: KEY_CATEGORIES.center + KEY_CATEGORIES.bottom },
{ name: 'All Keys', keys: KEY_CATEGORIES.all }
];

function App() {
const [currentWord, setCurrentWord] = useState("");
const [userInput, setUserInput] = useState("");
const [loading, setLoading] = useState(true);
const [startTime, setStartTime] = useState<number | null>(null);
const [currentTime, setCurrentTime] = useState(0);
const [pastWords, setPastWords] = useState<WordEntry[]>([]);
vprtwn-svaltown.web.val.run
Updated: October 21, 2024