adventure: show whether a backpack item is an upgrade over what's worn
On the owner's own page, each wearable backpack item now carries a compare card: a verdict chip (upgrade / downgrade / sidegrade / new / inert / same), the per-stat deltas, and the name of the worn item it's measured against. gogobee computes all of it — the power math needs tempering and bond state, which live in the engine — so Pete only colours the result and does no arithmetic. It rides the owner-private inventory, so it never reaches the public page; the item names are game-authored, so unlike the LLM dispatch prose there's no injection surface. The verdict chip is always visible (a phone has no hover to lean on) with the deltas beside it. Chip colours mix a fixed hue into --ink for text and --card for fill, so they land on the readable side of the card in all four phases — the same by-construction contrast trick the dungeon map uses, not a Tailwind dark: variant. Screenshot-verified day and night, all six verdict states, including the purple 'new' chip that the theme-contrast history warned about. output.css rebuilt and committed.
This commit is contained in:
@@ -20,6 +20,23 @@
|
||||
{{end}}
|
||||
{{if .Desc}}<p class="text-xs text-[color:var(--ink)]/55 mt-1 leading-snug">{{.Desc}}</p>{{end}}
|
||||
{{if .Effect}}<p class="text-xs text-theme-adventure/80 mt-0.5">{{.Effect}}</p>{{end}}
|
||||
{{/* The compare card: how this backpack item stacks up against what's worn in
|
||||
the slot it would equip into. gogobee decided the verdict and the per-stat
|
||||
deltas (it holds the tempering and bond math); Pete only colours them. The
|
||||
verdict chip always shows — a phone has no hover to lean on — with the
|
||||
deltas beside it, each already flagged better/worse. */}}
|
||||
{{with .Compare}}
|
||||
<div class="mt-1 flex flex-wrap items-center gap-1.5">
|
||||
{{if eq .Verdict "upgrade"}}<span class="cmp-chip cmp-up">↑ upgrade</span>
|
||||
{{else if eq .Verdict "downgrade"}}<span class="cmp-chip cmp-down">↓ downgrade</span>
|
||||
{{else if eq .Verdict "sidegrade"}}<span class="cmp-chip cmp-side">⇄ sidegrade</span>
|
||||
{{else if eq .Verdict "new"}}<span class="cmp-chip cmp-new">✦ fills {{.VsSlot}}</span>
|
||||
{{else if eq .Verdict "inert"}}<span class="cmp-chip cmp-inert">⚠ would sit inert</span>
|
||||
{{else if eq .Verdict "same"}}<span class="cmp-chip cmp-same">= no change</span>{{end}}
|
||||
{{range .Deltas}}<span class="cmp-delta {{if .Better}}cmp-delta-up{{else}}cmp-delta-down{{end}}">{{.Text}}</span>{{end}}
|
||||
</div>
|
||||
{{if .VsName}}<p class="text-[11px] text-[color:var(--ink)]/45 mt-0.5">vs worn {{.VsName}}</p>{{end}}
|
||||
{{end}}
|
||||
{{if .EquipAction}}
|
||||
<div class="mt-1.5">
|
||||
<button type="button" class="equip-btn text-[11px] rounded-full border border-theme-adventure/40 text-theme-adventure hover:bg-theme-adventure/10 px-2.5 py-0.5 font-semibold transition-colors"
|
||||
|
||||
Reference in New Issue
Block a user