zenno/doc/frbm: update with charts &c.

This commit is contained in:
2026-05-23 16:18:24 -04:00
parent 3ab17cf9b0
commit bd99cfaa6d
7 changed files with 678 additions and 171 deletions
+27
View File
@@ -0,0 +1,27 @@
<script lang="ts">
import { skills, ZERO_SKILL, type Skill } from "./data/skill";
interface CommonProps {
hint?: string;
mention?: boolean;
}
type Props = CommonProps & ({skill: number, name?: never} | {name: string, skill?: never});
let {hint, mention, skill, name}: Props = $props();
const s: Readonly<Skill> = $derived.by(() => {
const l = skill != null ? skills.global.filter((s) => s.skill_id === skill) : skills.global.filter((s) => s.name.includes(name!));
if (name != null) {
console.warn(`skills specified as ${name} (${hint}):`, l);
}
if (l.length === 0) {
return ZERO_SKILL;
}
return l[0];
});
const spanClass = $derived(mention ? 'italic' : 'font-bold')
</script>
<span class={spanClass}>{s.name}</span>