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()} -
+