From a1f0dc445b47a9a2fdc9ec75c9f1b211220a75a7 Mon Sep 17 00:00:00 2001 From: "Fabian @ Blax Software" Date: Wed, 28 Oct 2026 22:14:56 +0100 Subject: [PATCH] =?UTF-8?q?feat:=20Die=20St=C3=A4mme-style=20village:=20cl?= =?UTF-8?q?ean=20overview=20with=20a=20side=20column,=20building=20screens?= =?UTF-8?q?,=20clickable=20empty=20plots?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The overview is the village and a column of boxes (production, units, population, construction); the stock sits in one line on every screen. Construction, recruiting and the workforce table move to their own screens. Types that don't stand yet keep an invisible plot that opens a build card. Buildings no longer lift or light up on hover; a click outlines the ground under them. Co-Authored-By: Claude Opus 5.5 --- CLAUDE.md | 3 +- app/components/village/BuildingCard.vue | 10 +- app/components/village/Diorama.vue | 102 +++++------ app/components/village/OverviewSidebar.vue | 117 +++++++++++++ app/components/village/PlotCard.vue | 67 ++++++++ app/components/village/ResourceBar.vue | 57 +++---- app/components/village/TroopsPanel.vue | 9 +- app/composables/useVillage.ts | 15 ++ app/diorama/scene.ts | 44 ++++- app/pages/village/[id].vue | 190 ++++++--------------- app/pages/village/[id]/build.vue | 34 ++++ app/pages/village/[id]/index.vue | 79 +++++++++ app/pages/village/[id]/recruit.vue | 44 +++++ app/pages/village/[id]/workforce.vue | 15 ++ i18n/pages/village.ts | 20 ++- 15 files changed, 564 insertions(+), 242 deletions(-) create mode 100644 app/components/village/OverviewSidebar.vue create mode 100644 app/components/village/PlotCard.vue create mode 100644 app/pages/village/[id]/build.vue create mode 100644 app/pages/village/[id]/index.vue create mode 100644 app/pages/village/[id]/recruit.vue create mode 100644 app/pages/village/[id]/workforce.vue diff --git a/CLAUDE.md b/CLAUDE.md index 49d41c1..3e52612 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -8,8 +8,9 @@ This is the Nuxt client for a browser strategy game in the style of Tribal Wars. - **`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. - **Light Tailwind UI** (Tailwind 4, theme and component classes like `.panel`, `.btn` in `app/assets/css/main.css`) with simple hand-written inline SVG graphics (`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. -- **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. Each type has a model per level tier (0, 1–4, 5–14, 15+); the wall goes stakes → timber → stone with towers. Buildings are focusable buttons that open their details card. +- **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. Each type has a model per level tier (0, 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. - **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 page is laid out like Die Stämme**: a compact strip with the stock and the screens (Overview, Headquarters, Recruit, Workforce), each a child route of `pages/village/[id].vue` sharing one `useVillage()` through `useVillageContext()`. The overview stays clean: the village and a narrow column of boxes (production, units, population, construction); tables live on the building screens. - 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`. ## Mock server diff --git a/app/components/village/BuildingCard.vue b/app/components/village/BuildingCard.vue index 2fc315b..8c68f73 100644 --- a/app/components/village/BuildingCard.vue +++ b/app/components/village/BuildingCard.vue @@ -1,4 +1,5 @@ @@ -77,9 +77,7 @@ const emit = defineEmits<{ - + {{ link.label }}
diff --git a/app/components/village/Diorama.vue b/app/components/village/Diorama.vue index c184fec..588eb75 100644 --- a/app/components/village/Diorama.vue +++ b/app/components/village/Diorama.vue @@ -1,6 +1,6 @@ + + + + + diff --git a/app/components/village/PlotCard.vue b/app/components/village/PlotCard.vue new file mode 100644 index 0000000..356adc0 --- /dev/null +++ b/app/components/village/PlotCard.vue @@ -0,0 +1,67 @@ + + + + diff --git a/app/components/village/ResourceBar.vue b/app/components/village/ResourceBar.vue index cb6c3fd..4b63fe3 100644 --- a/app/components/village/ResourceBar.vue +++ b/app/components/village/ResourceBar.vue @@ -6,43 +6,26 @@ defineProps<{ village: VillageState; resources: Resources }>() const list: Resource[] = ['wood', 'clay', 'iron', 'food'] - + diff --git a/app/components/village/TroopsPanel.vue b/app/components/village/TroopsPanel.vue index 0ef7c18..3b6c7a1 100644 --- a/app/components/village/TroopsPanel.vue +++ b/app/components/village/TroopsPanel.vue @@ -1,9 +1,8 @@ + + diff --git a/app/pages/village/[id]/build.vue b/app/pages/village/[id]/build.vue new file mode 100644 index 0000000..a6ffee7 --- /dev/null +++ b/app/pages/village/[id]/build.vue @@ -0,0 +1,34 @@ + + + + diff --git a/app/pages/village/[id]/index.vue b/app/pages/village/[id]/index.vue new file mode 100644 index 0000000..7217cc1 --- /dev/null +++ b/app/pages/village/[id]/index.vue @@ -0,0 +1,79 @@ + + + + diff --git a/app/pages/village/[id]/recruit.vue b/app/pages/village/[id]/recruit.vue new file mode 100644 index 0000000..794ad5d --- /dev/null +++ b/app/pages/village/[id]/recruit.vue @@ -0,0 +1,44 @@ + + + + diff --git a/app/pages/village/[id]/workforce.vue b/app/pages/village/[id]/workforce.vue new file mode 100644 index 0000000..30fcb81 --- /dev/null +++ b/app/pages/village/[id]/workforce.vue @@ -0,0 +1,15 @@ + + + + diff --git a/i18n/pages/village.ts b/i18n/pages/village.ts index e3eec1b..4600aa4 100644 --- a/i18n/pages/village.ts +++ b/i18n/pages/village.ts @@ -5,6 +5,23 @@ export default { village: { title: 'Village', on_map: 'Show on the world map', + screens: { + label: 'Village screens', + overview: 'Overview', + build: 'Headquarters', + recruit: 'Recruit', + workforce: 'Workforce', + }, + side: { + production: 'Production', + units: 'Units', + construction: 'Construction', + recruit: 'Recruit', + }, + plot: { + all: 'All buildings in the headquarters', + another: 'Room for another', + }, points: '{points} points', resources: { title: 'Resources', @@ -83,9 +100,10 @@ export default { }, diorama: { title: 'Village overview', - hint: 'Select a building to see what it does and upgrade it.', label: '{name}, level {level}', planned: 'Under construction', + plot: '{name}: not built yet', + plot_another: '{name}: room for another', space: 'Building space', space_value: '{used} / {max}', },