From 009dd1d695888fb7d8519634ab683b46f7d7f6f3 Mon Sep 17 00:00:00 2001 From: Branden J Brown Date: Sun, 12 Jul 2026 14:37:43 -0400 Subject: [PATCH] zenno: add page titles and descriptions --- zenno/src/lib/IndexSection.svelte | 21 +++++++ zenno/src/lib/all.ts | 98 +++++++++++++++++++++++++++++ zenno/src/routes/+layout.svelte | 26 ++++++-- zenno/src/routes/+page.svelte | 55 ++-------------- zenno/src/routes/chara/+page.svelte | 22 +++---- zenno/src/routes/doc/+page.svelte | 33 +++------- zenno/src/routes/race/+page.svelte | 25 +++----- 7 files changed, 171 insertions(+), 109 deletions(-) create mode 100644 zenno/src/lib/IndexSection.svelte create mode 100644 zenno/src/lib/all.ts diff --git a/zenno/src/lib/IndexSection.svelte b/zenno/src/lib/IndexSection.svelte new file mode 100644 index 0000000..9108928 --- /dev/null +++ b/zenno/src/lib/IndexSection.svelte @@ -0,0 +1,21 @@ + + +{#if title != null} +

{title}

+{/if} + diff --git a/zenno/src/lib/all.ts b/zenno/src/lib/all.ts new file mode 100644 index 0000000..15ee0e1 --- /dev/null +++ b/zenno/src/lib/all.ts @@ -0,0 +1,98 @@ +import { resolve } from '$app/paths'; +import type { ResolvedPathname } from '$app/types'; + +export interface Page { + route: ResolvedPathname; + name: string; + description: string; +} + +/** + * All tool and doc pages in the site. + */ +export const PAGES = { + index: [ + { + route: resolve('/race'), + name: 'Race Mechanics Tools', + description: 'Tools for calculating Umamusume race characteristics.', + }, + { + route: resolve('/chara'), + name: 'Character Tools', + description: 'Tools for understanding Umamusume characters.', + }, + { + route: resolve('/doc'), + name: 'Documents', + description: 'Articles about Umamusume, including research and editorials.', + }, + ] satisfies Page[], + race: [ + { + route: resolve('/race/spurt'), + name: 'Spurt Speed', + description: 'Calculate target speed in the last spurt and compare to other distance aptitudes and running styles.', + }, + { + route: resolve('/race/mspeed'), + name: 'Front Runner Mechanical Speed Comparator', + description: 'Compare spot struggle and lane combo to the effects of individual skills.', + }, + { + route: resolve('/race/gate'), + name: 'Gate Calculator', + description: 'Calculate the importance of acceleration effects at the starting gate.', + }, + ] satisfies Page[], + chara: [ + { + route: resolve('/chara/affinity'), + name: 'Affinity Details', + description: 'Details of why characters have the base compatibility numbers they have.', + }, + { + route: resolve('/chara/convo'), + name: 'Lobby Conversations', + description: 'Check participants in lobby conversations and get recommendations on unlocking them quickly.', + }, + ] satisfies Page[], + doc: [ + { + route: resolve('/doc/frbm'), + name: 'Front Runner Black Magic', + description: 'Detailed analysis of how front runners interact with race mechanics.', + }, + { + route: resolve('/doc/lanecalc'), + name: "Gaikokujin's Guide to Lanecalc", + description: 'English language manual for 危険回避シミュ, or Lanecalc, for precise lane combo simulation.', + }, + { + route: resolve('/doc/race'), + name: 'Race Mechanics Charts', + description: + "Interactive adaptation of KuromiAK's race mechanics documentation for easier visualization of how mechanics scale.", + }, + { + route: resolve('/doc/spark'), + name: 'Spark Explorer', + description: 'View all possible inheritance effects of any spark.', + }, + ] satisfies Page[], +} as const; + +/** + * Get the page object for a route. + * @param route Route ID for the page + * @returns Matching page, or an empty object if none match + */ +export function page(route: string | null): Partial { + for (const p of Object.values(PAGES)) { + const r = p.find((v) => v.route === route); + if (r != null) { + return r; + } + } + return {}; +} diff --git a/zenno/src/routes/+layout.svelte b/zenno/src/routes/+layout.svelte index e331f24..ccbd19f 100644 --- a/zenno/src/routes/+layout.svelte +++ b/zenno/src/routes/+layout.svelte @@ -1,13 +1,31 @@ - Zenno Rob Roy + {#if title != null} + Zenno Rob Roy – {title} + {:else} + Zenno Rob Roy + {/if} + + + + @@ -23,9 +41,9 @@ Documents -
+
{@render children()} -
+