mirror of
https://github.com/CharaChorder/DeviceManager.git
synced 2026-01-10 03:52:57 +00:00
train routes
This commit is contained in:
@@ -2,18 +2,29 @@
|
|||||||
import {serialPort, syncing} from "$lib/serial/connection"
|
import {serialPort, syncing} from "$lib/serial/connection"
|
||||||
import {browser} from "$app/environment"
|
import {browser} from "$app/environment"
|
||||||
import {page} from "$app/stores"
|
import {page} from "$app/stores"
|
||||||
|
|
||||||
|
const training = [
|
||||||
|
{slug: "cpm", title: "CPM - Characters Per Minute", icon: "music_note"},
|
||||||
|
{slug: "chords", title: "ChM - Chords Mastered", icon: "piano"},
|
||||||
|
{slug: "avg-wpm", title: "aWPM - Average Words Per Minute", icon: "avg_pace"},
|
||||||
|
{slug: "sentences", title: "StM - Sentences Mastered", icon: "lyrics"},
|
||||||
|
{slug: "top-wpm", title: "tWPM - Top Words Per Minute", icon: "speed"},
|
||||||
|
{slug: "cm", title: "CM - Concepts Mastered", icon: "cognition"},
|
||||||
|
]
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<nav>
|
<nav>
|
||||||
<a href="/" class="title">dot i/o</a>
|
<a href="/" class="title">dot i/o</a>
|
||||||
|
|
||||||
<div class="steps">
|
<div class="steps">
|
||||||
<a href="/" title="CPM - characters per minute" class="icon train cpm">music_note</a>
|
{#each training as { slug, title, icon }}
|
||||||
<a href="/" title="ChM - chords mastered" class="icon train chords">piano</a>
|
<a
|
||||||
<a href="/" title="aWPM - average words per minute" class="icon test avg">avg_pace</a>
|
href="/train/{slug}/"
|
||||||
<a href="/" title="StM - sentences mastered" class="icon train sentences">lyrics</a>
|
{title}
|
||||||
<a href="/" title="tWPM - top words per minute" class="icon test top">speed</a>
|
class="icon train {slug}"
|
||||||
<a href="/" title="CM - concepts mastered" class="icon train concepts">cognition</a>
|
class:active={$page.url.pathname === `/train/${slug}/`}>{icon}</a
|
||||||
|
>
|
||||||
|
{/each}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="actions">
|
<div class="actions">
|
||||||
@@ -106,6 +117,7 @@
|
|||||||
clip-path: polygon(25% 50%, 0% 0%, 75% 0%, 100% 50%, 75% 100%, 0% 100%);
|
clip-path: polygon(25% 50%, 0% 0%, 75% 0%, 100% 50%, 75% 100%, 0% 100%);
|
||||||
border-radius: 0;
|
border-radius: 0;
|
||||||
|
|
||||||
|
&.active,
|
||||||
&:active {
|
&:active {
|
||||||
color: var(--md-sys-color-on-tertiary);
|
color: var(--md-sys-color-on-tertiary);
|
||||||
background: var(--md-sys-color-tertiary);
|
background: var(--md-sys-color-tertiary);
|
||||||
|
|||||||
@@ -34,11 +34,10 @@
|
|||||||
</svelte:head>
|
</svelte:head>
|
||||||
|
|
||||||
{#if searchIndex}
|
{#if searchIndex}
|
||||||
<input on:input={search} type="search" placeholder="Search chords" />
|
<input on:input={search} type="search" placeholder="Search {$chords.length} chords" />
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
<section>
|
<section>
|
||||||
<p>You have {$chords.length} chords</p>
|
|
||||||
<table>
|
<table>
|
||||||
{#each items.slice(0, 50) as [{ phrase, actions }, i]}
|
{#each items.slice(0, 50) as [{ phrase, actions }, i]}
|
||||||
<tr style="view-transition-name: chord-{i}">
|
<tr style="view-transition-name: chord-{i}">
|
||||||
|
|||||||
6
src/routes/train/+page.ts
Normal file
6
src/routes/train/+page.ts
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
import {redirect} from "@sveltejs/kit"
|
||||||
|
import type {PageLoad} from "./$types"
|
||||||
|
|
||||||
|
export const load = (() => {
|
||||||
|
throw redirect(302, "/train/cpm/")
|
||||||
|
}) satisfies PageLoad
|
||||||
0
src/routes/train/[mode]/+page.svelte
Normal file
0
src/routes/train/[mode]/+page.svelte
Normal file
Reference in New Issue
Block a user