fix(viewer): improve resource amount contrast

This commit is contained in:
coyotte508 2026-10-30 09:23:46 +01:00
commit c8f319c689
4 changed files with 16 additions and 12 deletions

View file

@ -1,6 +1,6 @@
{
"name": "@gaia-project/old-ui",
"version": "1.2.13",
"version": "1.2.14",
"scripts": {
"serve": "vite --port 5193",
"build": "vite build",

View file

@ -1,6 +1,6 @@
{
"name": "@gaia-project/viewer",
"version": "5.22.13",
"version": "5.22.14",
"description": "Functions to visualize the map and boards for gaia project inside html canvas",
"contributors": [
"coyotte508",

View file

@ -3,11 +3,8 @@ import { expect } from "chai";
import { makeStore } from "../store";
import Resource from "./Resource.vue";
// Analysis mode (ANALYSIS_MODE_PLAN.md §12) is the only way a resource count goes below zero: the
// sandbox seat keeps its real numbers and may overspend them. Every surface that shows a count goes
// through this component - the player board and the mobile sticky resource bar both - so this one
// class is what makes an unaffordable line obvious from the board itself, which is why the panel no
// longer needs to print the same figures.
// Costs in logs and deficits in simulation use the same signed resource counts as player boards
// and the mobile resource bar. The minus sign must remain visible independently of color.
describe("Resource", () => {
// Knowledge and QIC read the store for their icon variant, so every case gets one.
const count = (kind: string, value: number) => {

View file

@ -173,6 +173,7 @@
<text
x="0"
y="0"
class="resource-count"
v-if="
(count != null &&
[
@ -257,15 +258,20 @@ export default class Resource extends Vue {
<style lang="scss">
g.resource {
// Analysis mode (ANALYSIS_MODE_PLAN.md §12) is the only way a resource count goes below zero: the
// sandbox seat keeps its real numbers and is allowed to overspend them, and this is the signal that
// it has. One rule covers every surface that renders a count - the player board and the mobile
// sticky resource bar both go through this component.
// Negative amounts include log costs as well as simulation deficits. Keep their normal
// high-contrast ink: the minus sign conveys the loss without relying on red over colored icons.
text.overdrawn {
fill: var(--oxide, #d92626);
font-weight: bold;
}
text.resource-count {
// Paint behind the white glyphs so the outline does not thin their strokes at small sizes.
paint-order: stroke fill;
stroke: #111;
stroke-width: 1px;
stroke-linejoin: round;
}
&.no-tooltip {
pointer-events: none;
}
@ -325,6 +331,7 @@ g.resource {
.building.r {
& + text {
fill: black;
stroke: none;
}
}