From 80fb1d118b9a78927e5f44da478a8c11bacb19e1 Mon Sep 17 00:00:00 2001 From: hided62 Date: Tue, 4 Aug 2026 07:22:15 +0000 Subject: [PATCH 1/4] fix(frontend): restore Ref document and control contracts Ref's `.bg0/.bg1/.bg2` set only a background image and `html, body` centre the texture with vertical tiling, so the extra background colours and the default tiling are removed. Two ranking views declared unscoped `body` rules that leaked a 500px min-width and a 21px line-height onto every screen; each page now owns its own contract. Controls that Ref renders with the Bootstrap/Lumen family get the shared modifier so the bottom edge moves on hover and while pressed. Co-Authored-By: Claude Opus 5 (1M context) --- app/game-frontend/src/assets/main.css | 27 ++++++-- .../src/assets/styles/game-shell.css | 20 ++++++ .../src/views/BattleSimulatorView.vue | 61 ++++++++++++++++--- .../src/views/BestGeneralView.vue | 4 +- app/game-frontend/src/views/BoardView.vue | 2 +- app/game-frontend/src/views/DiplomacyView.vue | 4 +- .../src/views/DynastyDetailView.vue | 5 +- .../src/views/DynastyListView.vue | 18 +++--- .../src/views/HallOfFameView.vue | 4 +- app/game-frontend/src/views/MainView.vue | 2 +- .../src/views/NationBettingView.vue | 4 +- .../src/views/NationGeneralsView.vue | 12 +++- .../src/views/NationSecretView.vue | 18 +++++- .../src/views/NpcControlView.vue | 15 +++-- app/game-frontend/src/views/TrafficView.vue | 33 +++++----- app/game-frontend/src/views/YearbookView.vue | 8 +-- 16 files changed, 174 insertions(+), 63 deletions(-) diff --git a/app/game-frontend/src/assets/main.css b/app/game-frontend/src/assets/main.css index da34ee9..9f05f19 100644 --- a/app/game-frontend/src/assets/main.css +++ b/app/game-frontend/src/assets/main.css @@ -14,19 +14,36 @@ html { color-scheme: dark; } +/* + * Ref's `html, body` contract: the page texture is centred and only tiles + * vertically, so a wide screen keeps one column of the texture. + */ body { min-width: 320px; margin: 0; background: #000; + background-position: center; + background-repeat: repeat-y; color: #fff; font-family: var(--sammo-font-sans); font-size: 14px; line-height: 1.3; } +/* + * Ref's in-game document never narrows below its 500px mobile column, so the + * app root keeps that floor. Previously this came from an unscoped `body` rule + * inside two ranking views, which also leaked their line-height everywhere. + */ +#app { + min-width: 500px; +} + body:has(.battle-page), body:has(.chief-page), -body:has(.global-page) { +body:has(.global-page), +body:has(.main-page), +body:has(.yearbook-page) { line-height: 1.5; } @@ -37,17 +54,19 @@ textarea { font: inherit; } +/* + * Ref's `.bg0/.bg1/.bg2` set a background image and nothing else, so the + * element stays transparent where the texture does not cover it. Adding a + * background colour here paints over whatever the parent shows through. + */ .legacy-bg0 { - background-color: #302016; background-image: var(--sammo-texture-walnut); } .legacy-bg1 { - background-color: #14241b; background-image: var(--sammo-texture-green); } .legacy-bg2 { - background-color: #172a52; background-image: var(--sammo-texture-blue); } diff --git a/app/game-frontend/src/assets/styles/game-shell.css b/app/game-frontend/src/assets/styles/game-shell.css index 9929c55..392ed99 100644 --- a/app/game-frontend/src/assets/styles/game-shell.css +++ b/app/game-frontend/src/assets/styles/game-shell.css @@ -48,6 +48,26 @@ cursor: pointer; } +/* + * Ref renders the dashboard reload control with the Lumen navigation family: + * the bottom edge shortens on hover and again while pressed. + */ +.game-shell__action--navigation { + border-color: var(--sammo-button-navigation-border); + border-width: 0 1px 4px; + background: var(--sammo-button-navigation-bg); +} + +.game-shell__action--navigation:not(:disabled):hover { + margin-top: 1px; + border-bottom-width: 3px; +} + +.game-shell__action--navigation:not(:disabled):active { + margin-top: 2px; + border-bottom-width: 2px; +} + .game-feedback--error { color: var(--sammo-color-error); font-size: 0.85rem; diff --git a/app/game-frontend/src/views/BattleSimulatorView.vue b/app/game-frontend/src/views/BattleSimulatorView.vue index 15d1e93..5559df1 100644 --- a/app/game-frontend/src/views/BattleSimulatorView.vue +++ b/app/game-frontend/src/views/BattleSimulatorView.vue @@ -1317,10 +1317,9 @@ const shouldShowUI = computed(() => !loading.value && !!options.value); .battle-simulator :deep(.panel-card) { border-color: rgba(0, 0, 0, 0.18); - border-radius: 5px; + border-radius: 5.25px; background: #303030; background-image: none; - overflow: hidden; } .battle-simulator :deep(.panel-header) { @@ -1373,15 +1372,24 @@ button { color: inherit; } +/* + * Ref uses the Bootstrap/Lumen family here: no top border, 1px sides and a 4px + * bottom that shortens on hover and active while the control moves down. + */ .primary, .ghost { - border: 1px solid transparent; - border-radius: 5px; + --simulator-button-border: #d04436; + + border-color: var(--simulator-button-border); + border-style: solid; + border-width: 0 1px 4px; + border-radius: 5.25px; padding: 5.25px 10.5px; color: #fff; font-size: 14px; font-weight: 700; line-height: 21px; + vertical-align: middle; cursor: pointer; transition: color 0.15s ease-in-out, @@ -1394,6 +1402,18 @@ button { background: #e74c3c; } +.primary:not(:disabled):hover, +.ghost:not(:disabled):hover { + margin-top: 1px; + border-bottom-width: 3px; +} + +.primary:not(:disabled):active, +.ghost:not(:disabled):active { + margin-top: 2px; + border-bottom-width: 2px; +} + .primary:active { background: #b93d30; } @@ -1404,14 +1424,20 @@ button { } .ghost { + --simulator-button-border: #2f89c5; + background: #3498db; } .load-action { + --simulator-button-border: #26527d; + background: #2c5d8f; } .add-action { + --simulator-button-border: #0da271; + background: #10b981; } @@ -1472,7 +1498,12 @@ button:disabled { box-shadow 0.15s ease-in-out; } +.unit-after input[type='number'] { + text-align: right; +} + .repeat-field select { + border-radius: 0 5.25px 5.25px 0; padding-right: 31.5px; background-image: url('data:image/svg+xml,%3csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 16 16%27%3e%3cpath fill=%27none%27 stroke=%27%23303030%27 stroke-linecap=%27round%27 stroke-linejoin=%27round%27 stroke-width=%272%27 d=%27m2 5 6 6 6-6%27/%3e%3c/svg%3e'); background-repeat: no-repeat; @@ -1485,6 +1516,7 @@ button:disabled { .field input:focus, .field select:focus { border-color: #9badbf; + box-shadow: 0 0 0 3.5px rgba(55, 90, 127, 0.25); outline: 0; } @@ -1557,19 +1589,32 @@ button:disabled { .summary-table { width: 100%; border-collapse: collapse; + vertical-align: top; } +.summary-table tbody, +.summary-table tr { + vertical-align: top; +} + +/* + * Ref renders this as a Bootstrap table: 7px padding on every side, a #444 + * bottom rule and the transparent accent inset shadow the framework always + * emits. + */ .summary-table th, .summary-table td { - padding: 7px 8px; - border-bottom: 1px solid rgba(201, 164, 90, 0.2); + padding: 7px; + border-bottom: 1px solid #444; + box-shadow: inset 0 0 0 9999px rgba(0, 0, 0, 0); text-align: left; + vertical-align: top; } .summary-table th { - width: 18ch; + width: 180px; color: #fff; - font-weight: 600; + font-weight: 700; } .battle-summary-card :deep(.panel-body) { diff --git a/app/game-frontend/src/views/BestGeneralView.vue b/app/game-frontend/src/views/BestGeneralView.vue index 0f40f40..22db07a 100644 --- a/app/game-frontend/src/views/BestGeneralView.vue +++ b/app/game-frontend/src/views/BestGeneralView.vue @@ -165,7 +165,7 @@ watch(viewMode, () => {