From 8da574292d9186e2cb878d0e2be1701101148897 Mon Sep 17 00:00:00 2001 From: "Fabian @ Blax Software" Date: Thu, 29 Oct 2026 14:09:03 +0100 Subject: [PATCH] feat: larger text and buttons instead of text links, the village bar split left and right, buildings clickable on their whole outline Co-Authored-By: Claude Opus 5.5 (1M context) --- CLAUDE.md | 6 +- app/assets/css/main.css | 30 +++-- app/components/game/MenuBar.vue | 4 +- app/components/game/ProtectionBar.vue | 2 +- app/components/game/TabBar.vue | 2 +- app/components/game/VillageBar.vue | 144 +++++++++++---------- app/components/game/VillageFrame.vue | 18 ++- app/components/quest/Book.vue | 8 +- app/components/ui/SideMenu.vue | 2 +- app/components/ui/SubTabs.vue | 2 +- app/components/village/BuildForm.vue | 4 +- app/components/village/CoinPanel.vue | 2 +- app/components/village/Diorama.vue | 54 ++++++-- app/components/village/FoodWarning.vue | 4 +- app/components/village/OverviewSidebar.vue | 19 ++- app/components/village/PlotCard.vue | 2 +- app/components/village/Recruit.vue | 5 +- app/components/village/ScreenHeader.vue | 2 +- app/components/village/SendTroops.vue | 4 +- app/components/village/TroopsPanel.vue | 2 +- app/diorama/scene.ts | 35 ++++- app/pages/reports/[worldId]/[id].vue | 2 +- app/pages/reports/[worldId]/index.vue | 8 +- app/pages/worlds.vue | 2 +- 24 files changed, 223 insertions(+), 140 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index ce41e49..58e80b3 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -7,11 +7,11 @@ This is the Nuxt client for a browser strategy game in the style of Tribal Wars. - **The client is a view.** It sends intents over WS and renders what the server returns. It never computes costs, durations, combat, or loot. The only computation it does is projecting resources (`stored + rate × elapsed`) and countdowns from server timestamps. It refetches when a countdown reaches zero or a `village:updated` push arrives. - **`ssr: false` for every target**, so one static build serves both the web and Steam. Code must not rely on Nuxt server routes or SSR-only APIs. - **Transport** is WS-first through the `ws` singleton from `@blax-software/networking`, the same as learn-atc. HTTP is only for login and register, which return the bearer token. Load the `blax-websockets` skill before you write `ws.send` or `ws.listen` code. -- **Dense and plain, like the old browser strategy games** (the reference is Die Stämme; notes and screenshots in the sibling repo `game-village-politics-research` (`../game-village-politics-research/die-staemme/`), kept out of this repo). A 14 px base, square frames with thin lines, tan header bands, tight table rows (`.grid-table`), small squared buttons (`.btn-primary` dark wood, `.btn-attack` red for attacks only), thin notice bars. No rounded cards, pills, big padding or decorative icons: an icon only where it carries meaning. Theme and component classes live in `app/assets/css/main.css`; hand-written inline SVG graphics in `app/components/icon/`, colours in `app/utils/palette.ts`. No paid, hosted or licensed assets: no icon packs, web fonts or images from outside the repo, and nothing copied from Die Stämme. -- **The village is a ground-level land view** (`app/components/village/Diorama.vue`, geometry in `app/diorama/`): isometric low-poly, drawn as inline SVG, no WebGL. The land fills the frame edge to edge (no island, no sky), cut to the container's shape; narrow screens scroll sideways. There are no tiles or positions: the server only sends each building's `space` and the village's `space.used/max`, and the client lays everything out deterministically in id order. The village core sits in the middle (headquarters on the plaza, storage, hiding places and rally point around it, inside the wall ring when there is one, a dirt edge without). Resource sites stand outside in their zones: iron mines at the rocky hill (upper left), clay pits on clay ground (lower left), timber camps at the forest edge (lower right), farms with fields (right); dirt roads lead from the gates to each zone and forest fills the rest. Levels start at 1. Each type has a model per level tier (1–4, 5–14, 15+); the wall goes stakes → timber → stone with towers. Buildings are focusable buttons that open their details card; a type that doesn't stand yet keeps an invisible empty plot that opens its build card. Buildings never move or light up on hover: only a click outlines the ground under them. Ambient life is welcome and stays out of the way: flat ground shadows, smoke from chimneys, forges and kilns, villagers walking the roads to the zones they work in; all motion stops under `prefers-reduced-motion`. The same models draw the building portraits on screen headers, the HQ list and the building cards (`VillageBuildingPortrait`). The world map groups forests, lakes and rocky hills by smooth noise of the coordinates, and village markers grow in five sizes with points. Map coordinates run around 0|0, negative included (−500 to 499 on a 1000-field map, lowest value from `map.view`'s `min`); continents are named from the top-left like Die Stämme, so 0|0 is the corner of K44, K45, K54 and K55. Use `app/utils/map.ts` for bounds and continents, never `0` or `500` literals. +- **Dense and plain, like the old browser strategy games** (the reference is Die Stämme; notes and screenshots in the sibling repo `game-village-politics-research` (`../game-village-politics-research/die-staemme/`), kept out of this repo). A 16 px root (17 px from 1800 px wide; rem sizes only, `text-sm` for body text, no fixed `text-[13px]`), square frames with thin lines, tan header bands, tight table rows (`.grid-table`), small squared buttons (`.btn-primary` dark wood, `.btn-attack` red for attacks only), thin notice bars. Actions are buttons, not text links: `.btn` for screen links and commands, `.btn-fill` for the "(20)" that fills an amount field; names inside lists and tables stay links. Bigger text must not add line wraps: keep rows `whitespace-nowrap` where they were one line. No rounded cards, pills, big padding or decorative icons: an icon only where it carries meaning. Theme and component classes live in `app/assets/css/main.css`; hand-written inline SVG graphics in `app/components/icon/`, colours in `app/utils/palette.ts`. No paid, hosted or licensed assets: no icon packs, web fonts or images from outside the repo, and nothing copied from Die Stämme. +- **The village is a ground-level land view** (`app/components/village/Diorama.vue`, geometry in `app/diorama/`): isometric low-poly, drawn as inline SVG, no WebGL. The land fills the frame edge to edge (no island, no sky), cut to the container's shape; narrow screens scroll sideways. There are no tiles or positions: the server only sends each building's `space` and the village's `space.used/max`, and the client lays everything out deterministically in id order. The village core sits in the middle (headquarters on the plaza, storage, hiding places and rally point around it, inside the wall ring when there is one, a dirt edge without). Resource sites stand outside in their zones: iron mines at the rocky hill (upper left), clay pits on clay ground (lower left), timber camps at the forest edge (lower right), farms with fields (right); dirt roads lead from the gates to each zone and forest fills the rest. Levels start at 1. Each type has a model per level tier (1–4, 5–14, 15+); the wall goes stakes → timber → stone with towers. Buildings are focusable buttons that open their details card, clickable anywhere on their outline (`hit`, a convex hull round their polygons and ground ring), the thin wall also along a wide band on its ring, and their level badges and countdowns as well; a type that doesn't stand yet keeps an invisible empty plot that opens its build card. Buildings never move or light up on hover: only a click outlines the ground under them. Ambient life is welcome and stays out of the way: flat ground shadows, smoke from chimneys, forges and kilns, villagers walking the roads to the zones they work in; all motion stops under `prefers-reduced-motion`. The same models draw the building portraits on screen headers, the HQ list and the building cards (`VillageBuildingPortrait`). The world map groups forests, lakes and rocky hills by smooth noise of the coordinates, and village markers grow in five sizes with points. Map coordinates run around 0|0, negative included (−500 to 499 on a 1000-field map, lowest value from `map.view`'s `min`); continents are named from the top-left like Die Stämme, so 0|0 is the corner of K44, K45, K54 and K55. Use `app/utils/map.ts` for bounds and continents, never `0` or `500` literals. - **Flat medieval colours only**, in the diorama and everywhere else: no gradients (CSS or SVG), no blur or backdrop-blur, no SVG filters or glows, no translucent overlays. Depth comes from the three flat shades per face in `app/diorama/iso.ts`, solid borders and hard shadows. Keep components small and typed, with state in composables (`useVillage`, `useWorld`). - **The village fills the screen.** On the village's own screens (`/village//…`) `GameVillageFrame` draws the diorama fixed across the whole browser window and docks everything over it, solid and opaque: the menu and the village bar along the top, the overview boxes in a right column (on phones a bottom sheet on the overview), and the open screen (headquarters, recruit, rally point, workforce) in a `UiWindow` on the left that folds and closes back to the overview; on the overview the left slot holds the card of the building picked in the village (`useVillageSelection`). Screen grids inside a window use container queries (`@4xl:`), not viewport breakpoints. The village scales to fit, no pan: the frame measures what the bars, the right column, the phone tab bar and the bottom sheet cover (`inset`), `buildScene` fits the whole village into the rest, and ground and forest are generated for the whole stage, so nothing of the village is ever cut off. Windows are docked now and meant to become draggable later, so `UiWindow` holds no position logic. This is where the game deliberately leaves Die Stämme's look behind. -- **One game shell for the rest.** The map and reports sit in one centred column (1100 px). All world pages use `layouts/game.vue` (on village screens `GameVillageFrame` draws the same parts over the village): the dark main menu (`GameMenuBar`: village, map, reports with its count inline, each with a hover dropdown of its sub-pages; server clock; account dropdown), then the village header (`GameVillageBar`: a quick bar with the village's screens, and one row with the village, its stock in thin cells and incoming troops), thin notices, and the content in a `.frame`. On phones the screens move to a bottom tab bar (`GameTabBar`). The header's village is the URL's on village screens and the last opened one elsewhere; `GameVillageFrame` holds its one `useVillage()` and shares it through `useVillageContext()`. Pages outside a world use `layouts/default.vue` (menu only). A page has one of two shapes: a title with box tabs (`UiSubTabs`: buildings like the rally point) or a title with a sub-menu on the left (`UiSideMenu`: lists like reports). One key per screen (`useShortcuts`): V overview, H headquarters, T recruit, P rally point, W workforce, M map, R reports. The overview stays clean: the village and a narrow column of boxes (incoming attacks, production, units, population, construction); tables live on the building screens. The map shows a popup over a hovered village and actions under a clicked one. The village row starts with the quest book (`QuestBook`, a native `` without a veil): it opens by itself when `quests.claimable` goes up, and a goal's "show me" opens its screen, a building goal the headquarters with `?hint=` marking that row. +- **One game shell for the rest.** The map and reports sit in one centred column (1100 px). All world pages use `layouts/game.vue` (on village screens `GameVillageFrame` draws the same parts over the village): the dark main menu (`GameMenuBar`: village, map, reports with its count inline, each with a hover dropdown of its sub-pages; server clock; account dropdown), then the village header (`GameVillageBar`, in two pieces with the village showing between them: on the left the quick bar with the village's screens over the village row, on the right the stock in thin cells and incoming troops; the space between lets clicks through), thin notices, and the content in a `.frame`. On phones the screens move to a bottom tab bar (`GameTabBar`). The header's village is the URL's on village screens and the last opened one elsewhere; `GameVillageFrame` holds its one `useVillage()` and shares it through `useVillageContext()`. Pages outside a world use `layouts/default.vue` (menu only). A page has one of two shapes: a title with box tabs (`UiSubTabs`: buildings like the rally point) or a title with a sub-menu on the left (`UiSideMenu`: lists like reports). One key per screen (`useShortcuts`): V overview, H headquarters, T recruit, P rally point, W workforce, M map, R reports. The overview stays clean: the village and a narrow column of boxes (incoming attacks, production, units, population, construction); tables live on the building screens. The map shows a popup over a hovered village and actions under a clicked one. The village row starts with the quest book (`QuestBook`, a native `` without a veil): it opens by itself when `quests.claimable` goes up, and a goal's "show me" opens its screen, a building goal the headquarters with `?hint=` marking that row. - All user-facing text goes through i18n keys, with `en` as the first locale. Sources are `i18n/locales/` and `i18n/pages/` (`@blax-software/i18n` layout); register a new page file in `i18n/messageloader.ts`. vue-i18n reads a bare `|` as a plural separator and drops what follows, so coordinates in messages are written `"{x}{'|'}{y}"` inside a double-quoted string. ## Mock server diff --git a/app/assets/css/main.css b/app/assets/css/main.css index e30a18c..3f10fab 100644 --- a/app/assets/css/main.css +++ b/app/assets/css/main.css @@ -46,13 +46,19 @@ } /* - * Dense on purpose, like the old browser strategy games: a 14 px base (every rem - * shrinks with it), square frames, thin lines, tan header bands, tight table rows. + * Dense on purpose, like the old browser strategy games, but readable: a 16 px root + * (17 px on wide screens; every rem grows with it, text-sm for body text), square frames, + * thin lines, tan header bands, tight table rows. * No rounded cards, no pills, no big padding; icons only where they carry meaning. */ @layer base { html { - font-size: 14px; + font-size: 16px; + } + @media (min-width: 1800px) { + html { + font-size: 17px; + } } body { @apply bg-[#cdb488] font-sans text-ink-900 antialiased; @@ -77,7 +83,7 @@ @apply flex flex-wrap items-center justify-between gap-2 border-b border-wood-700 bg-parchment-300 px-2 py-1; } .panel-title { - @apply font-display text-[15px] leading-snug font-semibold text-wood-950; + @apply font-display text-base leading-snug font-semibold text-wood-950; font-variant: small-caps; letter-spacing: 0.02em; } @@ -86,7 +92,7 @@ } .btn { - @apply inline-flex items-center justify-center gap-1 rounded-[2px] border px-2.5 py-1 text-[13px] leading-tight font-semibold focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-gold-500 disabled:cursor-not-allowed disabled:opacity-45; + @apply inline-flex items-center justify-center gap-1 rounded-[2px] border px-2.5 py-1 text-sm leading-tight font-semibold focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-gold-500 disabled:cursor-not-allowed disabled:opacity-45; } /* The everyday button: dark wood with light text. */ .btn-primary { @@ -105,16 +111,20 @@ .btn-danger { @apply border-transparent text-blood-700 hover:bg-parchment-200; } + /* Fills an amount field with the most there is: "(20)" as a small button, not a text link. */ + .btn-fill { + @apply inline-flex min-w-10 items-center justify-center border border-wood-600 bg-parchment-100 px-1 py-0.5 text-xs font-semibold text-blood-700 tabular-nums hover:bg-parchment-200 disabled:cursor-not-allowed disabled:border-parchment-300 disabled:bg-transparent disabled:text-ink-400; + } .input { - @apply w-full rounded-none border border-wood-600 bg-[#fbf3df] px-1.5 py-1 text-[13px] text-ink-900 outline-none placeholder:text-ink-400 focus:border-wood-900; + @apply w-full rounded-none border border-wood-600 bg-[#fbf3df] px-1.5 py-1 text-sm text-ink-900 outline-none placeholder:text-ink-400 focus:border-wood-900; } .label { - @apply mb-0.5 block text-[13px] font-semibold text-ink-700; + @apply mb-0.5 block text-sm font-semibold text-ink-700; } .badge { - @apply inline-flex items-center gap-1 border px-1 text-[11px] leading-4 font-semibold whitespace-nowrap; + @apply inline-flex items-center gap-1 border px-1 text-xs leading-4 font-semibold whitespace-nowrap; } .badge-plain { @apply border-wood-600/50 bg-parchment-200 text-ink-700; @@ -131,7 +141,7 @@ /* A thin full-width notice with an (i) and a close cross. */ .alert { - @apply border border-blood-700 bg-[#f0d6c8] px-2 py-1 text-[13px] text-blood-800; + @apply border border-blood-700 bg-[#f0d6c8] px-2 py-1 text-sm text-blood-800; } /* The framed content column on the backdrop. */ @@ -140,7 +150,7 @@ } /* A data table: tan header band, tight rows, thin lines. */ .grid-table { - @apply w-full border-collapse text-[13px]; + @apply w-full border-collapse text-sm; } .grid-table th { @apply border-b border-wood-700 bg-parchment-200 px-1.5 py-0.5 text-left text-xs font-semibold text-ink-700; diff --git a/app/components/game/MenuBar.vue b/app/components/game/MenuBar.vue index 9c54e19..d883891 100644 --- a/app/components/game/MenuBar.vue +++ b/app/components/game/MenuBar.vue @@ -79,13 +79,13 @@ watch(() => route.fullPath, () => menuKey.value++)