feat(cardex): carry VM status onto cards + browser gallery

Add a status field to Card (from the registry entry) and render it as a
done/in-progress pill on the card art. Add `cardimg --gallery`: render every
VM as an inline-SVG card and lay them out in one self-contained index.html
grid (sorted by rarity, with a spread tally) for browser viewing / screenshot.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
leetcrypt
2026-06-30 15:12:14 -07:00
parent f993a41cd7
commit 9c1ec55e0b
2 changed files with 65 additions and 1 deletions
+4 -1
View File
@@ -221,6 +221,7 @@ class Card:
stats: dict = field(default_factory=dict) # HP/Attack/Defense/SpAtk/Speed/SpDef
subscores: dict = field(default_factory=dict)
shiny: bool = False # deterministic "holo pull"
status: str = "" # VM build status (done / in_progress / …)
flavor: str = ""
def to_dict(self) -> dict:
@@ -280,8 +281,10 @@ def card_from_entry(entry: dict, manifest: dict | None = None) -> Card:
flavor = (f"A {rarity.lower()} {ty}-type born from {purpose.rstrip('.')}. "
f"Base stat total {sum(stats.values())}.")
status = (entry.get("status") or "unknown").strip().lower()
return Card(label=label, name=name, dex=_dex(label), rarity=rarity, power=power,
types=types, stats=stats, subscores=subs, shiny=shiny, flavor=flavor)
types=types, stats=stats, subscores=subs, shiny=shiny,
status=status, flavor=flavor)
# ── registry I/O + CLI ────────────────────────────────────────────────────────