site: start of basic site using astro, character select implemented

This commit is contained in:
2026-03-24 12:26:38 -04:00
parent 4429bbecd1
commit 012e33cded
11 changed files with 5608 additions and 0 deletions

27
site/data/character.ts Normal file
View File

@@ -0,0 +1,27 @@
import globalJSON from "../../global/character.json";
/**
* Character definitions.
*/
export interface Character {
/**
* Character ID.
*/
chara_id: number;
/**
* Regional name of the character.
* E.g., Special Week for Global, or スペシャルウィーク for JP.
*/
name: string;
}
const global = globalJSON as Character[];
export const character = {
global,
}
export function searchChara(charas: Character[], id: Character["chara_id"]): Character | undefined {
// TODO(zephyr): binary search
return charas.find((c) => c.chara_id === id);
}