V1.0.1: Aldenfell campaign seed, content library, party overview
- Seed now resets the database and seeds the Aldenfell campaign from the campaign book: admin DM user, default weapons, locations, bestiary, pre-built encounters, and DM/shared notes - Default weapon/spell/monster library, character profile fields, locations and dice mode (new migration) - Party overview page, pagination, info tips, build preview calc - Remove stale demo-login hint; notes preserve line breaks Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -60,6 +60,16 @@ export function fmtMod(mod: number): string {
|
||||
return mod >= 0 ? `+${mod}` : `${mod}`;
|
||||
}
|
||||
|
||||
// Healthy / bloodied (<=50%) / critical (<=25%) — matches .hp-bar-fill's
|
||||
// modifier classes in index.css.
|
||||
export function hpBarClass(current: number, max: number): string {
|
||||
if (max <= 0) return 'hp-bar-fill';
|
||||
const pct = current / max;
|
||||
if (pct <= 0.25) return 'hp-bar-fill hp-critical';
|
||||
if (pct <= 0.5) return 'hp-bar-fill hp-bloodied';
|
||||
return 'hp-bar-fill';
|
||||
}
|
||||
|
||||
export function extractErrorMessage(err: unknown): string {
|
||||
const anyErr = err as { response?: { data?: { error?: unknown } } };
|
||||
const apiError = anyErr?.response?.data?.error;
|
||||
|
||||
Reference in New Issue
Block a user