Switch cards.js to load full cards.json database

This commit is contained in:
Jared Miller 2026-02-23 19:17:03 -05:00
parent 426443bc9e
commit a11439eb58
Signed by: shmup
GPG key ID: 22B5C6D66A38B06C

View file

@ -1,11 +1,10 @@
let cardDb = {}; let cardDb = {};
export async function initCards() { export async function initCards() {
const url = new URL("../data/starter-ironclad.json", import.meta.url); const url = new URL("../data/cards.json", import.meta.url);
const res = await fetch(url); const res = await fetch(url);
if (!res.ok) throw new Error(`failed to load card data: ${res.status}`); if (!res.ok) throw new Error(`failed to load card data: ${res.status}`);
const starterIronclad = await res.json(); cardDb = await res.json();
cardDb = { ...starterIronclad };
} }
export function getCard(id) { export function getCard(id) {