zenno: link up doc/spark

This commit is contained in:
2026-07-07 15:55:31 -04:00
parent 0c518a9ce2
commit 3d73460934
4 changed files with 18 additions and 10 deletions
+3 -3
View File
@@ -66,8 +66,8 @@ export const TYPE_NAMES: Readonly<Record<Type, string>> = {
[Type.CarnivalBonus]: 'Carnival Bonus (Scarlet)', [Type.CarnivalBonus]: 'Carnival Bonus (Scarlet)',
[Type.Distance]: 'Distance (White)', [Type.Distance]: 'Distance (White)',
[Type.Hidden]: 'Hidden (White)', [Type.Hidden]: 'Hidden (White)',
[Type.Surface] : 'Surface (White)', [Type.Surface]: 'Surface (White)',
[Type.Style] : 'Style (White)', [Type.Style]: 'Style (White)',
}; };
/** /**
@@ -129,7 +129,7 @@ export const TARGET_NAMES: Readonly<Record<Target, string>> = {
[Target.PowerCap]: 'Power cap', [Target.PowerCap]: 'Power cap',
[Target.GutsCap]: 'Guts cap', [Target.GutsCap]: 'Guts cap',
[Target.WitCap]: 'Wit cap', [Target.WitCap]: 'Wit cap',
} };
/** /**
* Effects that a spark can apply. * Effects that a spark can apply.
+3
View File
@@ -49,6 +49,9 @@
rel="noopener noreferrer">KuromiAK's race mechanics documentation</a rel="noopener noreferrer">KuromiAK's race mechanics documentation</a
> for easier visualization of how mechanics scale. > for easier visualization of how mechanics scale.
</li> </li>
<li>
<a href={resolve('/doc/spark')}>Spark Explorer</a> &mdash; View all possible inheritance effects of any spark.
</li>
</ul> </ul>
<h2 class="my-4 text-4xl">&amp;c.</h2> <h2 class="my-4 text-4xl">&amp;c.</h2>
+3
View File
@@ -22,4 +22,7 @@
rel="noopener noreferrer">KuromiAK's race mechanics documentation</a rel="noopener noreferrer">KuromiAK's race mechanics documentation</a
> for easier visualization of how mechanics scale. > for easier visualization of how mechanics scale.
</li> </li>
<li>
<a href={resolve('/doc/spark')}>Spark Explorer</a> &mdash; View all possible inheritance effects of any spark.
</li>
</ul> </ul>
+9 -7
View File
@@ -1,6 +1,6 @@
<script lang="ts"> <script lang="ts">
import * as skill from '$lib/data/skill'; import * as skill from '$lib/data/skill';
import * as spark from '$lib/data/spark'; import * as spark from '$lib/data/spark';
import { onMount } from 'svelte'; import { onMount } from 'svelte';
import { SvelteMap } from 'svelte/reactivity'; import { SvelteMap } from 'svelte/reactivity';
@@ -14,10 +14,10 @@
} }
}); });
let group = $state(1); let group = $state(1);
const groups = $derived.by(() => { const groups = $derived.by(() => {
const m = new Map<number, spark.Spark[]>(); const m = new SvelteMap<number, spark.Spark[]>();
for (const s of sparks) { for (const s of sparks) {
const l = m.get(s.spark_group) ?? []; const l = m.get(s.spark_group) ?? [];
l.push(s); l.push(s);
@@ -38,7 +38,7 @@
</script> </script>
<h1 class="text-4xl">Spark Explorer</h1> <h1 class="text-4xl">Spark Explorer</h1>
<form class="mx-auto mt-8 p-4 rounded-md text-center shadow-md ring md:max-w-2xl"> <form class="mx-auto mt-8 rounded-md p-4 text-center shadow-md ring md:max-w-2xl">
<select class="w-full" bind:value={group}> <select class="w-full" bind:value={group}>
{#each groups as [id, s] (id)} {#each groups as [id, s] (id)}
<option value={id}>{s[0].name}</option> <option value={id}>{s[0].name}</option>
@@ -46,11 +46,13 @@
</select> </select>
</form> </form>
<svelte:boundary> <svelte:boundary>
<div class="mx-auto mt-8 max-w-md flex-1 flex-col rounded-md border p-2 text-center shadow-sm transition-shadow hover:shadow-md"> <div
class="mx-auto mt-8 max-w-md flex-1 flex-col rounded-md border p-2 text-center shadow-sm transition-shadow hover:shadow-md"
>
<span class="block text-xl">{cur?.name}</span> <span class="block text-xl">{cur?.name}</span>
<span class="block">{cur?.description}</span> <span class="block">{cur?.description}</span>
</div> </div>
<table class="mx-auto w-full max-w-xl mt-8 table-fixed"> <table class="mx-auto mt-8 w-full max-w-xl table-fixed">
<caption class="text-xl">Possible Effects</caption> <caption class="text-xl">Possible Effects</caption>
<tbody> <tbody>
{#each curDescriptions as s (s)} {#each curDescriptions as s (s)}
@@ -68,4 +70,4 @@
{#snippet pending()} {#snippet pending()}
<div>Loading data...</div> <div>Loading data...</div>
{/snippet} {/snippet}
</svelte:boundary> </svelte:boundary>