feat: dense, plain UI like the old browser strategy games
One centred column with a dark main menu whose entries open dropdowns of their sub-pages, a quick bar of village screens, one village row with the stock in thin cells, thin notices and framed content. A 14 px base, square frames, tan header bands, tight tables, small squared buttons; box tabs on building screens and a left sub-menu on list pages (reports by kind, linked from the menu dropdown). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
9fba975c95
commit
085ba502da
|
|
@ -7,10 +7,10 @@ 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.
|
- **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.
|
- **`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.
|
- **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.
|
- **Dense and plain, like the old browser strategy games** (the reference is Die Stämme; notes and screenshots in `../research/die-staemme/`, not in git). 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.
|
- **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.
|
||||||
- **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`).
|
- **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`).
|
||||||
- **One game shell, like Die Stämme.** Pages inside a world (village screens, map, reports) use `layouts/game.vue`: the dark menu bar (`GameMenuBar`: village, map, reports with the unread count, server clock, account menu), then the sticky village bar (`GameVillageBar`: which village, stock with storage meters, incoming troops, and the village's screens as tabs: Overview, Headquarters, Recruit, Rally point, Workforce). On phones the screens move to a bottom tab bar (`GameTabBar`). The bar'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()`, so the map and reports keep the village on top. One key per screen (`useShortcuts`): V overview, H headquarters, T recruit, P rally point, W workforce, M map, R reports. A building screen splits its parts into `UiSubTabs` (the rally point: commands, troops, simulator); the map shows a popup over a hovered village and actions under a clicked one. Pages outside a world use `layouts/default.vue` (menu bar only). The overview stays clean: the village and a narrow column of boxes (incoming attacks, production, units, population, construction); tables live on the building screens.
|
- **One game shell, like Die Stämme.** Everything sits in one centred column (1100 px). Pages inside a world (village screens, map, reports) use `layouts/game.vue`: 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.
|
||||||
- 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`.
|
- 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
|
## Mock server
|
||||||
|
|
|
||||||
|
|
@ -45,41 +45,59 @@
|
||||||
--shadow-hard: 3px 3px 0 0 rgb(47 32 19 / 0.35);
|
--shadow-hard: 3px 3px 0 0 rgb(47 32 19 / 0.35);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 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.
|
||||||
|
* No rounded cards, no pills, no big padding; icons only where they carry meaning.
|
||||||
|
*/
|
||||||
@layer base {
|
@layer base {
|
||||||
|
html {
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
body {
|
body {
|
||||||
@apply bg-parchment-100 font-sans text-ink-900 antialiased;
|
@apply bg-[#cdb488] font-sans text-ink-900 antialiased;
|
||||||
}
|
}
|
||||||
|
|
||||||
button:not(:disabled),
|
button:not(:disabled),
|
||||||
[role="button"]:not(:disabled) {
|
[role="button"]:not(:disabled) {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Tables in frames: a header band, tight rows, thin lines between them. */
|
||||||
|
.panel table th {
|
||||||
|
@apply font-semibold;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@layer components {
|
@layer components {
|
||||||
.panel {
|
.panel {
|
||||||
@apply rounded-md border-2 border-wood-700 bg-parchment-50 shadow-hard;
|
@apply border border-wood-700 bg-parchment-50;
|
||||||
}
|
}
|
||||||
.panel-head {
|
.panel-head {
|
||||||
@apply flex flex-wrap items-center justify-between gap-2 border-b-2 border-wood-700 bg-parchment-200 px-4 py-2.5;
|
@apply flex flex-wrap items-center justify-between gap-2 border-b border-wood-700 bg-parchment-300 px-2 py-1;
|
||||||
}
|
}
|
||||||
.panel-title {
|
.panel-title {
|
||||||
@apply font-display text-lg font-semibold text-wood-900;
|
@apply font-display text-[15px] leading-snug font-semibold text-wood-950;
|
||||||
font-variant: small-caps;
|
font-variant: small-caps;
|
||||||
letter-spacing: 0.02em;
|
letter-spacing: 0.02em;
|
||||||
}
|
}
|
||||||
.panel-body {
|
.panel-body {
|
||||||
@apply p-4;
|
@apply p-2.5;
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn {
|
.btn {
|
||||||
@apply inline-flex items-center justify-center gap-1.5 rounded-sm border px-3 py-1.5 text-sm font-semibold transition-colors focus-visible:outline-2 focus-visible:outline-offset-2 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-[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;
|
||||||
}
|
}
|
||||||
|
/* The everyday button: dark wood with light text. */
|
||||||
.btn-primary {
|
.btn-primary {
|
||||||
|
@apply border-wood-950 bg-wood-800 text-parchment-50 hover:bg-wood-700 disabled:hover:bg-wood-800;
|
||||||
|
}
|
||||||
|
/* Attacks only. */
|
||||||
|
.btn-attack {
|
||||||
@apply border-blood-800 bg-blood-700 text-parchment-50 hover:bg-blood-600 disabled:hover:bg-blood-700;
|
@apply border-blood-800 bg-blood-700 text-parchment-50 hover:bg-blood-600 disabled:hover:bg-blood-700;
|
||||||
}
|
}
|
||||||
.btn-outline {
|
.btn-outline {
|
||||||
@apply border-wood-600 bg-parchment-50 text-wood-800 hover:bg-parchment-200;
|
@apply border-wood-600 bg-parchment-100 text-wood-900 hover:bg-parchment-200;
|
||||||
}
|
}
|
||||||
.btn-ghost {
|
.btn-ghost {
|
||||||
@apply border-transparent text-wood-800 hover:bg-parchment-200;
|
@apply border-transparent text-wood-800 hover:bg-parchment-200;
|
||||||
|
|
@ -89,17 +107,17 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.input {
|
.input {
|
||||||
@apply w-full rounded-sm border border-wood-600 bg-parchment-50 px-3 py-2 text-ink-900 outline-none placeholder:text-ink-400 focus:border-gold-600 focus:ring-2 focus:ring-gold-500/40;
|
@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;
|
||||||
}
|
}
|
||||||
.label {
|
.label {
|
||||||
@apply mb-1 block text-sm font-semibold text-ink-700;
|
@apply mb-0.5 block text-[13px] font-semibold text-ink-700;
|
||||||
}
|
}
|
||||||
|
|
||||||
.badge {
|
.badge {
|
||||||
@apply inline-flex items-center gap-1 rounded-sm border px-2 py-0.5 text-xs font-semibold whitespace-nowrap;
|
@apply inline-flex items-center gap-1 border px-1 text-[11px] leading-4 font-semibold whitespace-nowrap;
|
||||||
}
|
}
|
||||||
.badge-plain {
|
.badge-plain {
|
||||||
@apply border-wood-600/40 bg-parchment-200 text-ink-700;
|
@apply border-wood-600/50 bg-parchment-200 text-ink-700;
|
||||||
}
|
}
|
||||||
.badge-gold {
|
.badge-gold {
|
||||||
@apply border-gold-600 bg-gold-400 text-wood-950;
|
@apply border-gold-600 bg-gold-400 text-wood-950;
|
||||||
|
|
@ -111,7 +129,23 @@
|
||||||
@apply border-blood-800 bg-blood-700 text-parchment-50;
|
@apply border-blood-800 bg-blood-700 text-parchment-50;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* A thin full-width notice with an (i) and a close cross. */
|
||||||
.alert {
|
.alert {
|
||||||
@apply rounded-sm border-2 border-blood-700 bg-[#f0d6c8] px-3 py-2 text-sm text-blood-800;
|
@apply border border-blood-700 bg-[#f0d6c8] px-2 py-1 text-[13px] text-blood-800;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* The framed content column on the backdrop. */
|
||||||
|
.frame {
|
||||||
|
@apply border border-wood-900 bg-parchment-100;
|
||||||
|
}
|
||||||
|
/* A data table: tan header band, tight rows, thin lines. */
|
||||||
|
.grid-table {
|
||||||
|
@apply w-full border-collapse text-[13px];
|
||||||
|
}
|
||||||
|
.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;
|
||||||
|
}
|
||||||
|
.grid-table td {
|
||||||
|
@apply border-b border-parchment-300 px-1.5 py-0.5;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,8 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
import type { UiIconName } from '~/components/icon/Ui.vue'
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
/** Inside a world: show the world's menu (village, map, reports) and its clock. */
|
/** Inside a world: the world's menu (village, map, reports) and its clock. */
|
||||||
inWorld?: boolean
|
inWorld?: boolean
|
||||||
}>()
|
}>()
|
||||||
const { t } = useI18n()
|
const { t } = useI18n()
|
||||||
|
|
@ -14,19 +16,50 @@ const route = useRoute()
|
||||||
const world = computed(() => (props.inWorld && current.value ? (worlds.value?.find((w) => w.id === current.value!.worldId) ?? null) : null))
|
const world = computed(() => (props.inWorld && current.value ? (worlds.value?.find((w) => w.id === current.value!.worldId) ?? null) : null))
|
||||||
if (props.inWorld && !worlds.value) refresh()
|
if (props.inWorld && !worlds.value) refresh()
|
||||||
|
|
||||||
const home = computed(() => (props.inWorld && current.value?.villageId ? `/village/${current.value.villageId}` : '/worlds'))
|
interface Entry {
|
||||||
const links = computed(() => {
|
key: 'village' | 'map' | 'reports'
|
||||||
|
to: string
|
||||||
|
icon: UiIconName
|
||||||
|
active: boolean
|
||||||
|
count?: number
|
||||||
|
/** The dropdown under the entry, like the menu of Die Stämme. */
|
||||||
|
sub: { label: string; to: string | { path: string; query: Record<string, string> } }[]
|
||||||
|
}
|
||||||
|
|
||||||
|
// One bar with every section of the world; each entry opens its own page, and on
|
||||||
|
// hover or focus a dropdown with its sub-pages.
|
||||||
|
const entries = computed<Entry[]>(() => {
|
||||||
const c = current.value
|
const c = current.value
|
||||||
if (!props.inWorld || !c) return []
|
if (!props.inWorld || !c) return []
|
||||||
return [
|
const out: Entry[] = []
|
||||||
...(c.villageId ? [{ key: 'village', to: `/village/${c.villageId}`, icon: 'home' as const, active: route.path.startsWith('/village/') }] : []),
|
if (c.villageId) {
|
||||||
{ key: 'map', to: `/map/${c.worldId}`, icon: 'pin' as const, active: route.path.startsWith('/map/') },
|
const base = `/village/${c.villageId}`
|
||||||
{ key: 'reports', to: `/reports/${c.worldId}`, icon: 'report' as const, active: route.path.startsWith('/reports/') },
|
out.push({
|
||||||
]
|
key: 'village',
|
||||||
|
to: base,
|
||||||
|
icon: 'home',
|
||||||
|
active: route.path.startsWith('/village/'),
|
||||||
|
sub: VILLAGE_SCREENS.map((s) => ({ label: t(`village.screens.${s.name}`), to: `${base}${s.path}` })),
|
||||||
|
})
|
||||||
|
}
|
||||||
|
out.push({ key: 'map', to: `/map/${c.worldId}`, icon: 'pin', active: route.path.startsWith('/map/'), sub: [] })
|
||||||
|
out.push({
|
||||||
|
key: 'reports',
|
||||||
|
to: `/reports/${c.worldId}`,
|
||||||
|
icon: 'report',
|
||||||
|
active: route.path.startsWith('/reports/'),
|
||||||
|
count: unread.value,
|
||||||
|
sub: (['all', 'attack', 'defense', 'support'] as const).map((kind) => ({
|
||||||
|
label: t(`reports.kinds.${kind}`),
|
||||||
|
to: kind === 'all' ? `/reports/${c.worldId}` : { path: `/reports/${c.worldId}`, query: { type: kind } },
|
||||||
|
})),
|
||||||
|
})
|
||||||
|
return out
|
||||||
})
|
})
|
||||||
|
|
||||||
/** The key that opens a menu entry (the village link opens its overview). */
|
/** The key that opens a menu entry (the village entry opens its overview). */
|
||||||
const shortcutOf = (key: string) => SHORTCUTS[(key === 'village' ? 'overview' : key) as keyof typeof SHORTCUTS].toUpperCase()
|
const shortcutOf = (key: string) => SHORTCUTS[(key === 'village' ? 'overview' : key) as keyof typeof SHORTCUTS].toUpperCase()
|
||||||
|
const home = computed(() => (props.inWorld && current.value?.villageId ? `/village/${current.value.villageId}` : '/worlds'))
|
||||||
|
|
||||||
const connection = computed(() =>
|
const connection = computed(() =>
|
||||||
isMockServer
|
isMockServer
|
||||||
|
|
@ -37,71 +70,57 @@ const connection = computed(() =>
|
||||||
)
|
)
|
||||||
const clock = computed(() => new Date(now.value).toLocaleTimeString(undefined, { hour: '2-digit', minute: '2-digit', second: '2-digit', hour12: false }))
|
const clock = computed(() => new Date(now.value).toLocaleTimeString(undefined, { hour: '2-digit', minute: '2-digit', second: '2-digit', hour12: false }))
|
||||||
|
|
||||||
// The account menu closes when a link in it is followed.
|
// A dropdown closes once one of its links is followed.
|
||||||
const menu = ref<HTMLDetailsElement | null>(null)
|
const menuKey = ref(0)
|
||||||
watch(() => route.fullPath, () => menu.value?.removeAttribute('open'))
|
watch(() => route.fullPath, () => menuKey.value++)
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<!-- The dark wooden bar on top of every page: the game's main menu, the server clock and the account. -->
|
<!-- The main menu on every page: one dark bar, every section with its dropdown, the server clock and the account. -->
|
||||||
<template>
|
<template>
|
||||||
<header class="border-b-4 border-wood-950 bg-wood-900 text-parchment-100">
|
<header class="border-b-2 border-wood-950 bg-wood-900 text-[13px] text-parchment-100">
|
||||||
<div class="mx-auto flex h-12 max-w-[96rem] items-center gap-1 px-2 sm:gap-2 sm:px-4">
|
<div :key="menuKey" class="mx-auto flex h-9 max-w-[1100px] items-stretch px-1 sm:px-2">
|
||||||
<NuxtLink :to="home" class="mr-1 shrink-0 items-center gap-2" :class="links.length ? 'hidden sm:flex' : 'flex'" :title="t('app.title')">
|
<NuxtLink :to="home" class="mr-1 shrink-0 items-center gap-1.5 px-1.5" :class="entries.length ? 'hidden sm:flex' : 'flex'" :title="t('app.title')">
|
||||||
<span class="grid size-8 place-items-center rounded-sm border border-gold-600 bg-blood-700 text-gold-400">
|
<span class="grid size-6 place-items-center border border-gold-600 bg-blood-700 text-gold-400">
|
||||||
<IconBuilding type="headquarters" class="size-5" />
|
<IconBuilding type="headquarters" class="size-4" />
|
||||||
</span>
|
</span>
|
||||||
<span class="hidden font-display text-lg font-semibold text-gold-400 lg:inline" style="font-variant: small-caps">{{ t('app.title') }}</span>
|
<span class="hidden font-display text-[15px] font-semibold text-gold-400 lg:inline" style="font-variant: small-caps">{{ t('app.title') }}</span>
|
||||||
</NuxtLink>
|
</NuxtLink>
|
||||||
|
|
||||||
<nav v-if="links.length" class="flex items-center gap-0.5" :aria-label="t('app.menu')">
|
<nav v-if="entries.length" class="flex items-stretch" :aria-label="t('app.menu')">
|
||||||
|
<div v-for="e in entries" :key="e.key" class="group relative flex">
|
||||||
<NuxtLink
|
<NuxtLink
|
||||||
v-for="l in links"
|
:to="e.to"
|
||||||
:key="l.key"
|
class="menu-item"
|
||||||
:to="l.to"
|
:class="{ 'menu-item-active': e.active }"
|
||||||
class="menu-link"
|
:aria-current="e.active ? 'page' : undefined"
|
||||||
:class="{ 'menu-link-active': l.active }"
|
:title="t('app.shortcut', { key: shortcutOf(e.key) })"
|
||||||
:aria-current="l.active ? 'page' : undefined"
|
|
||||||
:title="t('app.shortcut', { key: shortcutOf(l.key) })"
|
|
||||||
>
|
>
|
||||||
<span class="relative">
|
<IconUi :name="e.icon" class="size-4" />
|
||||||
<IconUi :name="l.icon" class="size-5 sm:size-4" />
|
<span class="hidden sm:inline">{{ t(`app.${e.key}`) }}</span>
|
||||||
<span
|
<span v-if="e.count" class="font-bold text-gold-400 tabular-nums">({{ e.count }})</span>
|
||||||
v-if="l.key === 'reports' && unread"
|
|
||||||
class="absolute -top-2 -right-2.5 min-w-4 rounded-full border border-wood-950 bg-gold-400 px-1 text-center text-[10px] leading-3.5 font-bold text-wood-950 sm:hidden"
|
|
||||||
>
|
|
||||||
{{ unread }}
|
|
||||||
</span>
|
|
||||||
</span>
|
|
||||||
<span class="hidden sm:inline">{{ t(`app.${l.key}`) }}</span>
|
|
||||||
<span v-if="l.key === 'reports' && unread" class="hidden rounded-sm bg-gold-400 px-1.5 text-xs font-bold text-wood-950 sm:inline" :title="t('app.unread_reports', { count: unread })">
|
|
||||||
{{ unread }}
|
|
||||||
</span>
|
|
||||||
</NuxtLink>
|
</NuxtLink>
|
||||||
|
<div v-if="e.sub.length" class="menu-drop">
|
||||||
|
<NuxtLink v-for="s in e.sub" :key="s.label" :to="s.to" class="menu-drop-item">{{ s.label }}</NuxtLink>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
<div class="ml-auto flex min-w-0 items-center gap-2 sm:gap-3">
|
<div class="ml-auto flex items-stretch">
|
||||||
<span v-if="world" class="hidden truncate text-sm text-parchment-300 md:inline">{{ world.name }}</span>
|
<span v-if="world" class="hidden items-center border-l border-wood-700 px-2.5 text-parchment-300 md:flex">{{ world.name }}</span>
|
||||||
<span v-if="user" class="flex items-center gap-1.5 text-sm tabular-nums text-parchment-200" :title="`${t('app.server_time')} · ${connection.text}`">
|
<span v-if="user" class="flex items-center gap-1.5 border-l border-wood-700 px-2.5 tabular-nums text-parchment-200" :title="`${t('app.server_time')} · ${connection.text}`">
|
||||||
<span class="size-2 rounded-full" :class="connection.tone" />
|
<span class="size-1.5 rounded-full" :class="connection.tone" />
|
||||||
{{ clock }}
|
{{ clock }}
|
||||||
</span>
|
</span>
|
||||||
<details v-if="user" ref="menu" class="relative">
|
<div v-if="user" class="group relative flex">
|
||||||
<summary class="menu-link list-none" :title="t('app.account')">
|
<button type="button" class="menu-item border-r-0 border-l" :title="t('app.account')">
|
||||||
<IconUi name="users" class="size-4" />
|
<IconUi name="users" class="size-4" />
|
||||||
<span class="hidden max-w-32 truncate md:inline">{{ user.name }}</span>
|
<span class="hidden max-w-28 truncate md:inline">{{ user.name }}</span>
|
||||||
</summary>
|
|
||||||
<div class="absolute right-0 z-50 mt-2 w-52 rounded-sm border-2 border-wood-950 bg-parchment-50 py-1 text-sm text-ink-900 shadow-hard">
|
|
||||||
<p class="truncate border-b border-parchment-300 px-3 py-1.5 font-semibold">{{ user.name }}</p>
|
|
||||||
<NuxtLink to="/worlds" class="account-item">
|
|
||||||
<IconUi name="globe" class="size-4" />
|
|
||||||
{{ t('app.change_world') }}
|
|
||||||
</NuxtLink>
|
|
||||||
<button type="button" class="account-item w-full" @click="logout()">
|
|
||||||
<IconUi name="logout" class="size-4" />
|
|
||||||
{{ t('app.logout') }}
|
|
||||||
</button>
|
</button>
|
||||||
|
<div class="menu-drop right-0 left-auto">
|
||||||
|
<NuxtLink to="/worlds" class="menu-drop-item">{{ t('app.change_world') }}</NuxtLink>
|
||||||
|
<button type="button" class="menu-drop-item w-full text-left" @click="logout()">{{ t('app.logout') }}</button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</details>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</header>
|
</header>
|
||||||
|
|
@ -110,13 +129,17 @@ watch(() => route.fullPath, () => menu.value?.removeAttribute('open'))
|
||||||
<style scoped>
|
<style scoped>
|
||||||
@reference "~/assets/css/main.css";
|
@reference "~/assets/css/main.css";
|
||||||
|
|
||||||
.menu-link {
|
.menu-item {
|
||||||
@apply inline-flex h-9 items-center gap-1.5 rounded-sm border border-transparent px-2.5 text-sm font-semibold text-parchment-100 transition-colors hover:border-wood-600 hover:bg-wood-800 focus-visible:outline-2 focus-visible:outline-gold-500;
|
@apply flex items-center gap-1.5 border-r border-wood-700 px-2.5 font-semibold text-parchment-100 hover:bg-wood-800 focus-visible:outline-2 focus-visible:outline-gold-500;
|
||||||
}
|
}
|
||||||
.menu-link-active {
|
.menu-item-active {
|
||||||
@apply border-gold-600 bg-wood-800 text-gold-400;
|
@apply bg-wood-800 text-gold-400;
|
||||||
}
|
}
|
||||||
.account-item {
|
/* Shown on hover or keyboard focus; touch devices just follow the entry's own link. */
|
||||||
@apply flex items-center gap-2 px-3 py-1.5 text-left hover:bg-parchment-200;
|
.menu-drop {
|
||||||
|
@apply absolute top-full left-0 z-50 hidden min-w-44 border border-wood-950 bg-parchment-50 py-0.5 text-ink-900 shadow-[2px_2px_0_0_rgb(31_21_12/0.4)] group-focus-within:block group-hover:block;
|
||||||
|
}
|
||||||
|
.menu-drop-item {
|
||||||
|
@apply block px-2.5 py-1 font-semibold whitespace-nowrap text-wood-900 hover:bg-parchment-200 hover:text-blood-700;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
||||||
|
|
@ -26,10 +26,10 @@ function close() {
|
||||||
const left = computed(() => props.secondsUntil(props.until))
|
const left = computed(() => props.secondsUntil(props.until))
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<!-- A slim notice under the village bar while beginner protection lasts, with its countdown. -->
|
<!-- A thin notice under the village header while beginner protection lasts, with its countdown and a close cross. -->
|
||||||
<template>
|
<template>
|
||||||
<div v-if="!hidden && left > 0" class="border-b-2 border-wood-700 bg-parchment-50" role="status">
|
<div v-if="!hidden && left > 0" class="border border-wood-700 bg-parchment-50" role="status">
|
||||||
<div class="mx-auto flex max-w-[96rem] items-center gap-2 px-3 py-1.5 text-sm sm:px-6">
|
<div class="flex items-center gap-2 px-2 py-0.5 text-[13px]">
|
||||||
<IconUi name="support" class="size-4 shrink-0 text-moss-700" />
|
<IconUi name="support" class="size-4 shrink-0 text-moss-700" />
|
||||||
<p class="min-w-0 flex-1">
|
<p class="min-w-0 flex-1">
|
||||||
{{ $t('village.protection.ends_in') }}
|
{{ $t('village.protection.ends_in') }}
|
||||||
|
|
|
||||||
|
|
@ -25,15 +25,15 @@ const title = computed(() =>
|
||||||
)
|
)
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<!-- One resource in the village bar: icon, amount, and a thin meter of how full the storage is. -->
|
<!-- One resource in the village row: icon and amount, with a hairline of how full the storage is. -->
|
||||||
<template>
|
<template>
|
||||||
<span class="inline-flex min-w-0 items-center gap-1.5" :title="title">
|
<span class="inline-flex min-w-0 items-center gap-1" :title="title">
|
||||||
<IconResource :resource="resource" class="size-5 shrink-0" />
|
<IconResource :resource="resource" class="size-4 shrink-0" />
|
||||||
<span class="flex min-w-0 flex-col">
|
<span class="flex min-w-0 flex-col">
|
||||||
<span class="text-sm leading-tight font-semibold tabular-nums" :class="full ? 'text-blood-700' : rate < 0 ? 'text-blood-700' : 'text-ink-900'">
|
<span class="leading-tight font-semibold tabular-nums" :class="full || rate < 0 ? 'text-blood-700' : 'text-ink-900'">
|
||||||
{{ formatAmount(amount) }}
|
{{ formatAmount(amount) }}
|
||||||
</span>
|
</span>
|
||||||
<span class="mt-0.5 h-1 w-full min-w-10 overflow-hidden rounded-[1px] bg-parchment-300" aria-hidden="true">
|
<span class="h-0.5 w-full min-w-8 bg-parchment-300" aria-hidden="true">
|
||||||
<span class="block h-full" :class="full ? 'bg-blood-700' : share > 0.85 ? 'bg-gold-500' : 'bg-moss-600'" :style="{ width: `${share * 100}%` }" />
|
<span class="block h-full" :class="full ? 'bg-blood-700' : share > 0.85 ? 'bg-gold-500' : 'bg-moss-600'" :style="{ width: `${share * 100}%` }" />
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
|
|
|
||||||
|
|
@ -8,14 +8,14 @@ const isActive = (path: string) => route.path === `${base.value}${path}`
|
||||||
<!-- On phones the village's screens sit in a bar at the bottom, in thumb reach. -->
|
<!-- On phones the village's screens sit in a bar at the bottom, in thumb reach. -->
|
||||||
<template>
|
<template>
|
||||||
<nav
|
<nav
|
||||||
class="fixed inset-x-0 bottom-0 z-40 grid grid-cols-5 border-t-4 border-wood-950 bg-wood-900 pb-[env(safe-area-inset-bottom)] md:hidden"
|
class="fixed inset-x-0 bottom-0 z-40 grid grid-cols-5 border-t-2 border-wood-950 bg-wood-900 pb-[env(safe-area-inset-bottom)] md:hidden"
|
||||||
:aria-label="$t('village.screens.label')"
|
:aria-label="$t('village.screens.label')"
|
||||||
>
|
>
|
||||||
<NuxtLink
|
<NuxtLink
|
||||||
v-for="s in VILLAGE_SCREENS"
|
v-for="s in VILLAGE_SCREENS"
|
||||||
:key="s.name"
|
:key="s.name"
|
||||||
:to="`${base}${s.path}`"
|
:to="`${base}${s.path}`"
|
||||||
class="flex flex-col items-center gap-0.5 px-1 pt-1.5 pb-1 text-[11px] leading-tight font-semibold"
|
class="flex flex-col items-center gap-0.5 px-1 py-1 text-[11px] leading-tight font-semibold"
|
||||||
:class="isActive(s.path) ? 'bg-wood-800 text-gold-400' : 'text-parchment-200'"
|
:class="isActive(s.path) ? 'bg-wood-800 text-gold-400' : 'text-parchment-200'"
|
||||||
:aria-current="isActive(s.path) ? 'page' : undefined"
|
:aria-current="isActive(s.path) ? 'page' : undefined"
|
||||||
>
|
>
|
||||||
|
|
|
||||||
|
|
@ -20,92 +20,83 @@ async function rename() {
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
The village bar under the menu, on every screen of the world: which village, its
|
Above the content, like the header of Die Stämme: the quick bar with the village's
|
||||||
stock with storage meters, incoming troops, and its screens as tabs (on phones the
|
screens, then one row with the village and its stock. Plain numbers in thin cells;
|
||||||
tabs move to the bottom bar).
|
each resource leads to the workforce, where it is made.
|
||||||
-->
|
-->
|
||||||
<template>
|
<template>
|
||||||
<div class="sticky top-0 z-30 border-b-2 border-wood-700 bg-parchment-200">
|
<div class="space-y-1 text-[13px]">
|
||||||
<div class="mx-auto flex max-w-[96rem] flex-wrap items-center gap-x-6 gap-y-2 px-3 pt-2 pb-2 sm:px-6 md:pb-0">
|
<nav class="hidden border border-wood-700 bg-parchment-200 md:flex" :aria-label="$t('village.screens.label')">
|
||||||
<!-- Which village. -->
|
|
||||||
<div class="flex min-w-0 flex-1 items-center gap-2 md:flex-none md:pb-2">
|
|
||||||
<form v-if="renaming !== null" class="flex items-center gap-1.5" @submit.prevent="rename">
|
|
||||||
<input v-model="renaming" type="text" maxlength="32" class="input w-44 px-2 py-0.5" :aria-label="$t('village.rename')" @keydown.esc="renaming = null" />
|
|
||||||
<button type="submit" class="btn btn-primary px-2 py-0.5" :disabled="v.busy.value || !renaming.trim()">{{ $t('village.rename_save') }}</button>
|
|
||||||
<button type="button" class="btn btn-ghost px-2 py-0.5" @click="renaming = null">{{ $t('village.rename_cancel') }}</button>
|
|
||||||
</form>
|
|
||||||
<template v-else>
|
|
||||||
<div class="min-w-0">
|
|
||||||
<div class="flex min-w-0 items-center gap-1.5">
|
|
||||||
<NuxtLink :to="base" class="truncate font-display text-lg leading-tight font-semibold text-wood-900 hover:text-blood-700" style="font-variant: small-caps">
|
|
||||||
{{ village.name }}
|
|
||||||
</NuxtLink>
|
|
||||||
<button type="button" class="shrink-0 text-ink-400 hover:text-blood-700" :title="$t('village.rename')" @click="renaming = village.name">
|
|
||||||
<IconUi name="edit" class="size-3.5" />
|
|
||||||
<span class="sr-only">{{ $t('village.rename') }}</span>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
<div class="flex items-center gap-2 text-xs text-ink-500">
|
|
||||||
<NuxtLink
|
|
||||||
:to="{ path: `/map/${village.world_id}`, query: { x: village.x, y: village.y } }"
|
|
||||||
class="tabular-nums hover:text-blood-700 hover:underline"
|
|
||||||
:title="$t('village.on_map')"
|
|
||||||
>
|
|
||||||
{{ village.x }}|{{ village.y }} {{ village.continent }}
|
|
||||||
</NuxtLink>
|
|
||||||
<span>·</span>
|
|
||||||
<span class="tabular-nums">{{ $t('village.points', { points: village.points }) }}</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Incoming troops, red for attacks, with the next arrival. -->
|
|
||||||
<NuxtLink
|
|
||||||
v-if="incoming.length"
|
|
||||||
:to="`${base}/rally`"
|
|
||||||
class="order-2 flex items-center gap-2 rounded-sm border-2 px-2 py-1 text-sm font-semibold md:order-3 md:mb-2"
|
|
||||||
:class="attacks.length ? 'border-blood-800 bg-blood-700 text-parchment-50' : 'border-moss-700 bg-moss-600 text-parchment-50'"
|
|
||||||
:title="$t('village.incoming', { count: attacks.length })"
|
|
||||||
>
|
|
||||||
<span v-if="attacks.length" class="inline-flex items-center gap-1"><IconUi name="attack" class="size-4" />{{ attacks.length }}</span>
|
|
||||||
<span v-if="support" class="inline-flex items-center gap-1"><IconUi name="support" class="size-4" />{{ support }}</span>
|
|
||||||
<span v-if="nextAttack" class="hidden tabular-nums sm:inline">{{ formatDuration(v.secondsUntil(nextAttack.arrives_at)) }}</span>
|
|
||||||
</NuxtLink>
|
|
||||||
|
|
||||||
<!-- The stock: four resources with their storage meters, the storage cap and the villagers. -->
|
|
||||||
<div class="order-3 grid w-full grid-cols-[repeat(4,minmax(0,1fr))_auto] items-center gap-x-3 md:order-2 md:mb-2 md:ml-auto md:flex md:w-auto md:gap-x-4">
|
|
||||||
<!-- Each resource leads to where it is made: the workforce, production per building. -->
|
|
||||||
<NuxtLink v-for="r in (['wood', 'clay', 'iron', 'food'] as const)" :key="r" :to="`${base}/workforce`" class="min-w-0 hover:opacity-80">
|
|
||||||
<GameResource :resource="r" :amount="resources[r]" :cap="village.storage_cap" :rate="village.rates[r]" />
|
|
||||||
</NuxtLink>
|
|
||||||
<span class="hidden items-center gap-1.5 text-sm text-ink-700 tabular-nums lg:inline-flex" :title="$t('village.resources.cap')">
|
|
||||||
<IconBuilding type="storage" class="size-4" />{{ village.storage_cap }}
|
|
||||||
</span>
|
|
||||||
<NuxtLink
|
|
||||||
:to="`${base}/workforce`"
|
|
||||||
class="inline-flex items-center gap-1.5 text-sm text-ink-700 tabular-nums hover:text-blood-700"
|
|
||||||
:title="`${$t('village.population.villagers')}: ${village.population.villagers} · ${$t('village.population.upkeep')}: ${village.population.upkeep}/${village.population.food_budget}`"
|
|
||||||
>
|
|
||||||
<IconUi name="users" class="size-4" />{{ village.population.villagers }}
|
|
||||||
</NuxtLink>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- The village's screens as tabs that sit on the page below. -->
|
|
||||||
<nav class="order-4 -mb-0.5 hidden w-full items-end gap-1 md:flex" :aria-label="$t('village.screens.label')">
|
|
||||||
<NuxtLink
|
<NuxtLink
|
||||||
v-for="s in VILLAGE_SCREENS"
|
v-for="s in VILLAGE_SCREENS"
|
||||||
:key="s.name"
|
:key="s.name"
|
||||||
:to="`${base}${s.path}`"
|
:to="`${base}${s.path}`"
|
||||||
class="tab"
|
class="quick"
|
||||||
:class="{ 'tab-active': isActive(s.path) }"
|
:class="{ 'quick-active': isActive(s.path) }"
|
||||||
:aria-current="isActive(s.path) ? 'page' : undefined"
|
:aria-current="isActive(s.path) ? 'page' : undefined"
|
||||||
:title="$t('app.shortcut', { key: SHORTCUTS[s.name].toUpperCase() })"
|
:title="$t('app.shortcut', { key: SHORTCUTS[s.name].toUpperCase() })"
|
||||||
>
|
>
|
||||||
<IconBuilding :type="s.icon" class="size-4" />
|
<IconBuilding :type="s.icon" class="size-4 text-wood-800" />
|
||||||
{{ $t(`village.screens.${s.name}`) }}
|
{{ $t(`village.screens.${s.name}`) }}
|
||||||
</NuxtLink>
|
</NuxtLink>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
|
<div class="flex flex-wrap items-stretch border border-wood-700 bg-parchment-200">
|
||||||
|
<!-- Which village. -->
|
||||||
|
<div class="flex min-w-0 flex-1 items-center gap-1.5 px-2 py-1">
|
||||||
|
<form v-if="renaming !== null" class="flex items-center gap-1" @submit.prevent="rename">
|
||||||
|
<input v-model="renaming" type="text" maxlength="32" class="input w-40" :aria-label="$t('village.rename')" @keydown.esc="renaming = null" />
|
||||||
|
<button type="submit" class="btn btn-primary" :disabled="v.busy.value || !renaming.trim()">{{ $t('village.rename_save') }}</button>
|
||||||
|
<button type="button" class="btn btn-ghost" @click="renaming = null">{{ $t('village.rename_cancel') }}</button>
|
||||||
|
</form>
|
||||||
|
<template v-else>
|
||||||
|
<NuxtLink :to="base" class="truncate font-bold text-wood-950 hover:text-blood-700">{{ village.name }}</NuxtLink>
|
||||||
|
<NuxtLink
|
||||||
|
:to="{ path: `/map/${village.world_id}`, query: { x: village.x, y: village.y } }"
|
||||||
|
class="shrink-0 font-bold text-wood-950 tabular-nums hover:text-blood-700"
|
||||||
|
:title="$t('village.on_map')"
|
||||||
|
>
|
||||||
|
({{ village.x }}|{{ village.y }}) {{ village.continent }}
|
||||||
|
</NuxtLink>
|
||||||
|
<span class="hidden shrink-0 text-ink-500 tabular-nums sm:inline">{{ $t('village.points', { points: village.points }) }}</span>
|
||||||
|
<button type="button" class="shrink-0 text-ink-400 hover:text-blood-700" :title="$t('village.rename')" @click="renaming = village.name">
|
||||||
|
<IconUi name="edit" class="size-3.5" />
|
||||||
|
<span class="sr-only">{{ $t('village.rename') }}</span>
|
||||||
|
</button>
|
||||||
|
</template>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- The stock: four resources, the storage cap and the villagers, each in its own cell. -->
|
||||||
|
<div class="grid w-full grid-cols-5 border-t border-parchment-300 sm:flex sm:w-auto sm:border-t-0">
|
||||||
|
<NuxtLink v-for="r in (['wood', 'clay', 'iron', 'food'] as const)" :key="r" :to="`${base}/workforce`" class="cell flex hover:bg-parchment-100">
|
||||||
|
<GameResource :resource="r" :amount="resources[r]" :cap="village.storage_cap" :rate="village.rates[r]" />
|
||||||
|
</NuxtLink>
|
||||||
|
<span class="cell hidden lg:flex" :title="$t('village.resources.cap')">
|
||||||
|
<IconBuilding type="storage" class="size-4 text-wood-800" />
|
||||||
|
<span class="tabular-nums">{{ village.storage_cap }}</span>
|
||||||
|
</span>
|
||||||
|
<NuxtLink
|
||||||
|
:to="`${base}/workforce`"
|
||||||
|
class="cell flex hover:bg-parchment-100"
|
||||||
|
:title="`${$t('village.population.villagers')}: ${village.population.villagers} · ${$t('village.population.upkeep')}: ${village.population.upkeep}/${village.population.food_budget}`"
|
||||||
|
>
|
||||||
|
<IconUi name="users" class="size-4 text-wood-800" />
|
||||||
|
<span class="tabular-nums">{{ village.population.villagers }}</span>
|
||||||
|
</NuxtLink>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Incoming troops: red for attacks, green for support, with the next arrival. -->
|
||||||
|
<NuxtLink
|
||||||
|
v-if="incoming.length"
|
||||||
|
:to="`${base}/rally`"
|
||||||
|
class="flex items-center gap-2 border-l border-wood-700 px-2 font-bold"
|
||||||
|
:class="attacks.length ? 'bg-blood-700 text-parchment-50' : 'bg-moss-600 text-parchment-50'"
|
||||||
|
:title="$t('village.incoming', { count: attacks.length })"
|
||||||
|
>
|
||||||
|
<span v-if="attacks.length" class="inline-flex items-center gap-1"><IconUi name="attack" class="size-4" />{{ attacks.length }}</span>
|
||||||
|
<span v-if="support" class="inline-flex items-center gap-1"><IconUi name="support" class="size-4" />{{ support }}</span>
|
||||||
|
<span v-if="nextAttack" class="tabular-nums">{{ formatDuration(v.secondsUntil(nextAttack.arrives_at)) }}</span>
|
||||||
|
</NuxtLink>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -113,10 +104,13 @@ async function rename() {
|
||||||
<style scoped>
|
<style scoped>
|
||||||
@reference "~/assets/css/main.css";
|
@reference "~/assets/css/main.css";
|
||||||
|
|
||||||
.tab {
|
.quick {
|
||||||
@apply inline-flex items-center gap-1.5 rounded-t-sm border-2 border-b-0 border-transparent px-3 pt-1.5 pb-2 text-sm font-semibold text-wood-800 hover:bg-parchment-100 hover:text-blood-700;
|
@apply flex items-center gap-1.5 border-r border-parchment-300 px-3 py-1 font-semibold text-wood-900 last:border-r-0 hover:bg-parchment-100 hover:text-blood-700;
|
||||||
}
|
}
|
||||||
.tab-active {
|
.quick-active {
|
||||||
@apply border-wood-700 bg-parchment-100 text-blood-700;
|
@apply bg-parchment-50 text-blood-700;
|
||||||
|
}
|
||||||
|
.cell {
|
||||||
|
@apply items-center justify-center gap-1 border-l border-parchment-300 px-2 py-1 first:border-l-0 sm:first:border-l;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
const props = defineProps<{ villageId: number }>()
|
const props = defineProps<{ villageId: number }>()
|
||||||
|
|
||||||
// One village state for every screen in the world: the village bar, the village's own
|
// One village state for every screen in the world: the village header, the village's
|
||||||
// screens, the map and the reports all read it through useVillageContext().
|
// own screens, the map and the reports all read it through useVillageContext().
|
||||||
const v = useVillage(props.villageId)
|
const v = useVillage(props.villageId)
|
||||||
provideVillage(v)
|
provideVillage(v)
|
||||||
v.refresh()
|
v.refresh()
|
||||||
|
|
@ -12,7 +12,7 @@ watch(v.village, (state) => {
|
||||||
if (state) enter(state.world_id, state.id)
|
if (state) enter(state.world_id, state.id)
|
||||||
})
|
})
|
||||||
|
|
||||||
// One key per screen of the world, as the tab titles show.
|
// One key per screen of the world, as the menu and quick bar titles show.
|
||||||
useShortcuts(() => {
|
useShortcuts(() => {
|
||||||
const base = `/village/${props.villageId}`
|
const base = `/village/${props.villageId}`
|
||||||
const worldId = v.village.value?.world_id
|
const worldId = v.village.value?.world_id
|
||||||
|
|
@ -23,8 +23,10 @@ useShortcuts(() => {
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<!-- The centred column: village header, thin notices, then the framed content. -->
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
|
<div class="mx-auto max-w-[1100px] space-y-1 px-1 pt-1.5 sm:px-2">
|
||||||
<GameVillageBar v-if="v.village.value && v.resources.value" :village="v.village.value" :resources="v.resources.value" />
|
<GameVillageBar v-if="v.village.value && v.resources.value" :village="v.village.value" :resources="v.resources.value" />
|
||||||
<GameProtectionBar
|
<GameProtectionBar
|
||||||
v-if="v.village.value?.rally.protected_until"
|
v-if="v.village.value?.rally.protected_until"
|
||||||
|
|
@ -38,9 +40,12 @@ useShortcuts(() => {
|
||||||
:levy="v.village.value.levy"
|
:levy="v.village.value.levy"
|
||||||
:seconds-until="v.secondsUntil"
|
:seconds-until="v.secondsUntil"
|
||||||
/>
|
/>
|
||||||
<p v-if="v.error.value" class="alert mx-4 mt-3 sm:mx-6" role="alert">{{ v.error.value }}</p>
|
<p v-if="v.error.value" class="alert" role="alert">{{ v.error.value }}</p>
|
||||||
<main>
|
</div>
|
||||||
|
<main class="mx-auto max-w-[1100px] px-1 pt-1 pb-4 sm:px-2">
|
||||||
|
<div class="frame">
|
||||||
<slot />
|
<slot />
|
||||||
|
</div>
|
||||||
</main>
|
</main>
|
||||||
<GameTabBar :village-id="villageId" />
|
<GameTabBar :village-id="villageId" />
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,7 @@ const own = computed(() => props.village.own)
|
||||||
<NuxtLink
|
<NuxtLink
|
||||||
v-if="from && from.id !== village.id"
|
v-if="from && from.id !== village.id"
|
||||||
:to="{ path: `/village/${from.id}/rally`, query: { x: village.x, y: village.y } }"
|
:to="{ path: `/village/${from.id}/rally`, query: { x: village.x, y: village.y } }"
|
||||||
class="btn btn-primary px-2 py-1 text-xs"
|
class="btn btn-attack"
|
||||||
>
|
>
|
||||||
<IconUi name="attack" class="size-3.5" />
|
<IconUi name="attack" class="size-3.5" />
|
||||||
{{ $t('map.info.send') }}
|
{{ $t('map.info.send') }}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,22 @@
|
||||||
|
<script setup lang="ts">
|
||||||
|
import type { RouteLocationRaw } from 'vue-router'
|
||||||
|
|
||||||
|
defineProps<{ items: { key: string; label: string; to: RouteLocationRaw; active: boolean; count?: number }[] }>()
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<!-- A list page's sub-menu on the left, like the report and message folders in Die Stämme. -->
|
||||||
|
<template>
|
||||||
|
<nav class="border border-wood-700 bg-parchment-200 text-[13px]">
|
||||||
|
<NuxtLink
|
||||||
|
v-for="item in items"
|
||||||
|
:key="item.key"
|
||||||
|
:to="item.to"
|
||||||
|
class="flex items-center justify-between border-b border-parchment-300 px-2 py-1 font-semibold last:border-b-0"
|
||||||
|
:class="item.active ? 'bg-wood-800 text-gold-400' : 'text-wood-950 hover:bg-parchment-100 hover:text-blood-700'"
|
||||||
|
:aria-current="item.active ? 'page' : undefined"
|
||||||
|
>
|
||||||
|
{{ item.label }}
|
||||||
|
<span v-if="item.count" class="tabular-nums">({{ item.count }})</span>
|
||||||
|
</NuxtLink>
|
||||||
|
</nav>
|
||||||
|
</template>
|
||||||
|
|
@ -6,22 +6,22 @@ defineProps<{ tabs: { key: K; label: string; icon?: UiIconName; count?: number }
|
||||||
const current = defineModel<K>({ required: true })
|
const current = defineModel<K>({ required: true })
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<!-- A building screen's own sections, like the tabs under a Die Stämme building header. -->
|
<!-- A screen's own sections as a row of small boxes, like the tabs under a Die Stämme building header. -->
|
||||||
<template>
|
<template>
|
||||||
<nav class="flex flex-wrap gap-1 border-b-2 border-wood-700" role="tablist">
|
<nav class="flex flex-wrap gap-0.5 text-[13px]" role="tablist">
|
||||||
<button
|
<button
|
||||||
v-for="tab in tabs"
|
v-for="tab in tabs"
|
||||||
:key="tab.key"
|
:key="tab.key"
|
||||||
type="button"
|
type="button"
|
||||||
role="tab"
|
role="tab"
|
||||||
:aria-selected="current === tab.key"
|
:aria-selected="current === tab.key"
|
||||||
class="-mb-0.5 inline-flex items-center gap-1.5 rounded-t-sm border-2 border-b-0 px-3 py-1.5 text-sm font-semibold"
|
class="inline-flex items-center gap-1 border border-wood-800 px-2 py-0.5 font-semibold"
|
||||||
:class="current === tab.key ? 'border-wood-700 bg-parchment-50 text-blood-700' : 'border-transparent text-wood-800 hover:text-blood-700'"
|
:class="current === tab.key ? 'bg-wood-800 text-gold-400' : 'bg-parchment-300 text-wood-950 hover:bg-parchment-200'"
|
||||||
@click="current = tab.key"
|
@click="current = tab.key"
|
||||||
>
|
>
|
||||||
<IconUi v-if="tab.icon" :name="tab.icon" class="size-4" />
|
<IconUi v-if="tab.icon" :name="tab.icon" class="size-3.5" />
|
||||||
{{ tab.label }}
|
{{ tab.label }}
|
||||||
<span v-if="tab.count" class="rounded-sm bg-blood-700 px-1.5 text-xs text-parchment-50 tabular-nums">{{ tab.count }}</span>
|
<span v-if="tab.count" class="font-bold text-blood-700 tabular-nums" :class="current === tab.key ? 'text-gold-400' : ''">({{ tab.count }})</span>
|
||||||
</button>
|
</button>
|
||||||
</nav>
|
</nav>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
|
|
@ -91,9 +91,8 @@ const demolishable = computed(() =>
|
||||||
type="button"
|
type="button"
|
||||||
role="tab"
|
role="tab"
|
||||||
:aria-selected="tab === name"
|
:aria-selected="tab === name"
|
||||||
class="rounded-sm border px-3 py-1 font-display text-base font-semibold"
|
class="inline-flex items-center gap-1 border border-wood-800 px-2 py-0.5 text-[13px] font-semibold"
|
||||||
:class="tab === name ? 'border-wood-700 bg-parchment-50 text-wood-900' : 'border-transparent text-ink-500 hover:text-wood-900'"
|
:class="tab === name ? 'bg-wood-800 text-gold-400' : 'bg-parchment-200 text-wood-950 hover:bg-parchment-100'"
|
||||||
style="font-variant: small-caps"
|
|
||||||
@click="tab = name"
|
@click="tab = name"
|
||||||
>
|
>
|
||||||
{{ $t(`village.build.tab_${name}`) }}
|
{{ $t(`village.build.tab_${name}`) }}
|
||||||
|
|
@ -119,7 +118,7 @@ const demolishable = computed(() =>
|
||||||
<tr v-for="row in rows" :key="row.key" class="border-b border-parchment-300 last:border-b-0 even:bg-parchment-100">
|
<tr v-for="row in rows" :key="row.key" class="border-b border-parchment-300 last:border-b-0 even:bg-parchment-100">
|
||||||
<td class="px-3 py-1">
|
<td class="px-3 py-1">
|
||||||
<div class="flex items-center gap-2">
|
<div class="flex items-center gap-2">
|
||||||
<VillagePortraitTile :type="row.type" :level="row.kind === 'upgrade' ? row.building.level : 1" class="size-11" />
|
<VillagePortraitTile :type="row.type" :level="row.kind === 'upgrade' ? row.building.level : 1" class="size-8" />
|
||||||
<div class="min-w-0 leading-tight">
|
<div class="min-w-0 leading-tight">
|
||||||
<button
|
<button
|
||||||
v-if="row.kind === 'upgrade'"
|
v-if="row.kind === 'upgrade'"
|
||||||
|
|
@ -178,7 +177,7 @@ const demolishable = computed(() =>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<template v-if="locked.length">
|
<template v-if="locked.length">
|
||||||
<h3 class="border-y-2 border-wood-700 bg-parchment-200 px-3 py-1.5 font-display text-sm font-semibold text-wood-900" style="font-variant: small-caps">
|
<h3 class="border-y border-wood-700 bg-parchment-300 px-2 py-0.5 text-[13px] font-bold text-wood-950">
|
||||||
{{ $t('village.build.not_available') }}
|
{{ $t('village.build.not_available') }}
|
||||||
</h3>
|
</h3>
|
||||||
<table class="w-full border-collapse text-sm">
|
<table class="w-full border-collapse text-sm">
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ const emit = defineEmits<{
|
||||||
<div class="flex items-center gap-3 border-b-2 border-wood-700 bg-parchment-200 px-4 py-3">
|
<div class="flex items-center gap-3 border-b-2 border-wood-700 bg-parchment-200 px-4 py-3">
|
||||||
<VillagePortraitTile :type="building.type" :level="building.level" class="size-14" />
|
<VillagePortraitTile :type="building.type" :level="building.level" class="size-14" />
|
||||||
<div class="min-w-0 flex-1">
|
<div class="min-w-0 flex-1">
|
||||||
<h2 class="truncate font-display text-lg font-semibold text-wood-900" style="font-variant: small-caps">{{ $t(`buildings.${building.type}`) }}</h2>
|
<h2 class="truncate font-display text-base font-bold text-wood-950">{{ $t(`buildings.${building.type}`) }}</h2>
|
||||||
<p class="text-xs text-ink-500">
|
<p class="text-xs text-ink-500">
|
||||||
{{ $t('village.buildings.level_n', { level: building.level }) }}
|
{{ $t('village.buildings.level_n', { level: building.level }) }}
|
||||||
<template v-if="building.space"> · {{ $t('village.build.space', { space: building.space }) }}</template>
|
<template v-if="building.space"> · {{ $t('village.build.space', { space: building.space }) }}</template>
|
||||||
|
|
|
||||||
|
|
@ -8,11 +8,11 @@ defineProps<{
|
||||||
}>()
|
}>()
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<!-- A flat strip under the village header while the food stock drains or is empty. -->
|
<!-- A thin notice under the village header while the food stock drains or is empty. -->
|
||||||
<template>
|
<template>
|
||||||
<div
|
<div
|
||||||
v-if="starvation.since"
|
v-if="starvation.since"
|
||||||
class="flex flex-wrap items-center gap-x-3 gap-y-1 border-b-2 border-wood-700 bg-blood-700 px-4 py-2 text-sm text-parchment-50 sm:px-6"
|
class="flex flex-wrap items-center gap-x-3 gap-y-0.5 border border-blood-800 bg-blood-700 px-2 py-0.5 text-[13px] text-parchment-50"
|
||||||
role="alert"
|
role="alert"
|
||||||
>
|
>
|
||||||
<IconResource resource="food" class="size-5" />
|
<IconResource resource="food" class="size-5" />
|
||||||
|
|
@ -27,7 +27,7 @@ defineProps<{
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
v-else-if="starvation.food_empty_at"
|
v-else-if="starvation.food_empty_at"
|
||||||
class="flex flex-wrap items-center gap-x-3 gap-y-1 border-b-2 border-wood-700 bg-gold-400 px-4 py-2 text-sm text-ink-900 sm:px-6"
|
class="flex flex-wrap items-center gap-x-3 gap-y-0.5 border border-gold-600 bg-gold-400 px-2 py-0.5 text-[13px] text-ink-900"
|
||||||
role="status"
|
role="status"
|
||||||
>
|
>
|
||||||
<IconResource resource="food" class="size-5" />
|
<IconResource resource="food" class="size-5" />
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@ function order(o: BuildOrder) {
|
||||||
|
|
||||||
<!-- The column beside the village: small boxes with the numbers that matter at a glance. -->
|
<!-- The column beside the village: small boxes with the numbers that matter at a glance. -->
|
||||||
<template>
|
<template>
|
||||||
<aside class="space-y-3 bg-parchment-100 p-3 text-sm">
|
<aside class="space-y-2 p-2 text-[13px]">
|
||||||
<section v-if="incoming.length" class="side-box border-blood-700">
|
<section v-if="incoming.length" class="side-box border-blood-700">
|
||||||
<h2 class="side-title bg-blood-700 text-parchment-50">{{ $t('village.side.incoming') }}</h2>
|
<h2 class="side-title bg-blood-700 text-parchment-50">{{ $t('village.side.incoming') }}</h2>
|
||||||
<ul class="side-body">
|
<ul class="side-body">
|
||||||
|
|
@ -117,16 +117,15 @@ function order(o: BuildOrder) {
|
||||||
@reference "~/assets/css/main.css";
|
@reference "~/assets/css/main.css";
|
||||||
|
|
||||||
.side-box {
|
.side-box {
|
||||||
@apply rounded-sm border-2 border-wood-700 bg-parchment-50;
|
@apply border border-wood-700 bg-parchment-50;
|
||||||
}
|
}
|
||||||
.side-title {
|
.side-title {
|
||||||
@apply border-b border-wood-700 bg-parchment-200 px-2.5 py-1 font-display text-sm font-semibold text-wood-900;
|
@apply border-b border-wood-700 bg-parchment-300 px-1.5 py-0.5 text-[13px] font-bold text-wood-950;
|
||||||
font-variant: small-caps;
|
|
||||||
}
|
}
|
||||||
.side-body {
|
.side-body {
|
||||||
@apply space-y-1 px-2.5 py-1.5;
|
@apply space-y-0.5 px-1.5 py-1;
|
||||||
}
|
}
|
||||||
.side-link {
|
.side-link {
|
||||||
@apply block pt-0.5 text-sm font-semibold text-blood-700 hover:underline;
|
@apply block font-semibold text-blood-700 hover:underline;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ const reason = computed(() => {
|
||||||
<div class="flex items-center gap-3 border-b-2 border-wood-700 bg-parchment-200 px-4 py-3">
|
<div class="flex items-center gap-3 border-b-2 border-wood-700 bg-parchment-200 px-4 py-3">
|
||||||
<VillagePortraitTile :type="option.type" :level="1" class="size-14" />
|
<VillagePortraitTile :type="option.type" :level="1" class="size-14" />
|
||||||
<div class="min-w-0 flex-1">
|
<div class="min-w-0 flex-1">
|
||||||
<h2 class="truncate font-display text-lg font-semibold text-wood-900" style="font-variant: small-caps">{{ $t(`buildings.${option.type}`) }}</h2>
|
<h2 class="truncate font-display text-base font-bold text-wood-950">{{ $t(`buildings.${option.type}`) }}</h2>
|
||||||
<p class="text-xs text-ink-500">
|
<p class="text-xs text-ink-500">
|
||||||
{{ another ? $t('village.plot.another') : $t('village.build.not_built') }}
|
{{ another ? $t('village.plot.another') : $t('village.build.not_built') }}
|
||||||
<template v-if="option.space"> · {{ $t('village.build.space', { space: option.space }) }}</template>
|
<template v-if="option.space"> · {{ $t('village.build.space', { space: option.space }) }}</template>
|
||||||
|
|
|
||||||
|
|
@ -74,14 +74,13 @@ function progress(o: RecruitOrder) {
|
||||||
type="button"
|
type="button"
|
||||||
role="tab"
|
role="tab"
|
||||||
:aria-selected="m === current"
|
:aria-selected="m === current"
|
||||||
class="inline-flex items-center gap-1.5 rounded-sm border px-2.5 py-1 font-display text-base font-semibold"
|
class="inline-flex items-center gap-1 border border-wood-800 px-2 py-0.5 text-[13px] font-semibold"
|
||||||
:class="m === current ? 'border-wood-700 bg-parchment-50 text-wood-900' : 'border-transparent text-ink-500 hover:text-wood-900'"
|
:class="m === current ? 'bg-wood-800 text-gold-400' : 'bg-parchment-200 text-wood-950 hover:bg-parchment-100'"
|
||||||
style="font-variant: small-caps"
|
|
||||||
@click="selected = m.building_id"
|
@click="selected = m.building_id"
|
||||||
>
|
>
|
||||||
<IconBuilding :type="m.type" class="size-4" />
|
<IconBuilding :type="m.type" class="size-4" />
|
||||||
{{ tabName(m) }}
|
{{ tabName(m) }}
|
||||||
<span class="font-sans text-xs font-normal text-ink-500" style="font-variant: normal">{{ m.level }}</span>
|
<span class="font-normal">({{ m.level }})</span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<span class="badge badge-plain">
|
<span class="badge badge-plain">
|
||||||
|
|
|
||||||
|
|
@ -10,18 +10,16 @@ defineProps<{
|
||||||
}>()
|
}>()
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<!-- The top of a building screen, like Die Stämme's: the building's picture, its name and level, and what it does. -->
|
<!-- The top of a building screen, like Die Stämme's: the building's picture, "Name (Level n)", and one line on what it does. -->
|
||||||
<template>
|
<template>
|
||||||
<header class="flex items-center gap-4">
|
<header class="flex items-start gap-3">
|
||||||
<VillagePortraitTile :type="type" :level="level ?? 1" class="size-20 rounded-md p-1 shadow-hard sm:size-24" />
|
<VillagePortraitTile :type="type" :level="level ?? 1" class="size-16 p-0.5" />
|
||||||
<div class="min-w-0">
|
<div class="min-w-0">
|
||||||
<h1 class="font-display text-2xl leading-tight font-semibold text-wood-900" style="font-variant: small-caps">
|
<h1 class="font-display text-lg leading-tight font-bold text-wood-950">
|
||||||
{{ title }}
|
{{ title }}
|
||||||
<span v-if="level !== null" class="ml-1 align-middle font-sans text-sm font-semibold text-ink-500" style="font-variant: normal">
|
<span v-if="level !== null" class="font-normal">({{ $t('village.buildings.level_n', { level }) }})</span>
|
||||||
{{ $t('village.buildings.level_n', { level }) }}
|
|
||||||
</span>
|
|
||||||
</h1>
|
</h1>
|
||||||
<p class="mt-1 max-w-prose text-sm text-ink-700">{{ description }}</p>
|
<p class="mt-0.5 max-w-[60rem] text-[13px] text-ink-700">{{ description }}</p>
|
||||||
<slot />
|
<slot />
|
||||||
</div>
|
</div>
|
||||||
</header>
|
</header>
|
||||||
|
|
|
||||||
|
|
@ -172,7 +172,7 @@ function modeHint(m: VillageState['rally']['modes'][number]) {
|
||||||
</dl>
|
</dl>
|
||||||
|
|
||||||
<div class="flex flex-wrap gap-2">
|
<div class="flex flex-wrap gap-2">
|
||||||
<button type="submit" class="btn btn-primary" :disabled="!canSend">
|
<button type="submit" class="btn btn-attack" :disabled="!canSend">
|
||||||
<IconUi name="attack" class="size-4" />
|
<IconUi name="attack" class="size-4" />
|
||||||
{{ $t('village.rally.attack') }}
|
{{ $t('village.rally.attack') }}
|
||||||
</button>
|
</button>
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ const route = useRoute()
|
||||||
const { current } = useCurrentWorld()
|
const { current } = useCurrentWorld()
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The village whose bar stays on top of every screen in the world: the one in the
|
* The village whose header stays on top of every screen in the world: the one in the
|
||||||
* URL on village screens, else the one last opened in this world (map, reports).
|
* URL on village screens, else the one last opened in this world (map, reports).
|
||||||
*/
|
*/
|
||||||
const villageId = computed(() => {
|
const villageId = computed(() => {
|
||||||
|
|
@ -13,15 +13,17 @@ const villageId = computed(() => {
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<!-- Inside a world: the menu bar, then the village bar and its screens, like Die Stämme. -->
|
<!-- Inside a world: the main menu, then the village header and its screens, like Die Stämme. -->
|
||||||
<template>
|
<template>
|
||||||
<div class="min-h-dvh pb-16 md:pb-0">
|
<div class="min-h-dvh pb-14 md:pb-0">
|
||||||
<GameMenuBar in-world />
|
<GameMenuBar in-world />
|
||||||
<GameVillageFrame v-if="villageId" :key="villageId" :village-id="villageId">
|
<GameVillageFrame v-if="villageId" :key="villageId" :village-id="villageId">
|
||||||
<slot />
|
<slot />
|
||||||
</GameVillageFrame>
|
</GameVillageFrame>
|
||||||
<main v-else>
|
<main v-else class="mx-auto max-w-[1100px] px-1 pt-1.5 pb-4 sm:px-2">
|
||||||
|
<div class="frame">
|
||||||
<slot />
|
<slot />
|
||||||
|
</div>
|
||||||
</main>
|
</main>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
|
|
@ -142,10 +142,10 @@ const from = computed(() => {
|
||||||
const v = bar?.village.value
|
const v = bar?.village.value
|
||||||
return v && v.world_id === worldId ? { id: v.id, x: v.x, y: v.y } : null
|
return v && v.world_id === worldId ? { id: v.id, x: v.x, y: v.y } : null
|
||||||
})
|
})
|
||||||
/** Where a field sits inside the map frame, in px (the frame's border is 4 px). */
|
/** Where a field sits inside the map frame, in px (the frame's border is 2 px). */
|
||||||
function fieldAt(x: number, y: number) {
|
function fieldAt(x: number, y: number) {
|
||||||
const v = visible.value!
|
const v = visible.value!
|
||||||
return { left: 4 + RULER + (x - v.left + 0.5) * field.value, top: 4 + RULER + (y - v.top) * field.value }
|
return { left: 2 + RULER + (x - v.left + 0.5) * field.value, top: 2 + RULER + (y - v.top) * field.value }
|
||||||
}
|
}
|
||||||
const popupAt = (x: number, y: number, below: boolean) => {
|
const popupAt = (x: number, y: number, below: boolean) => {
|
||||||
const p = fieldAt(x, y)
|
const p = fieldAt(x, y)
|
||||||
|
|
@ -185,11 +185,11 @@ const continent = computed(() => (rounded.value ? `K${Math.floor(rounded.value.y
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="px-4 py-5 lg:px-6">
|
<div class="p-2.5">
|
||||||
<header class="mb-4 flex flex-wrap items-end justify-between gap-3">
|
<header class="mb-2 flex flex-wrap items-center justify-between gap-2">
|
||||||
<div>
|
<div>
|
||||||
<p class="text-xs font-semibold tracking-wide text-ink-500 uppercase">{{ $t('map.title') }}</p>
|
<p class="text-xs font-semibold tracking-wide text-ink-500 uppercase">{{ $t('map.title') }}</p>
|
||||||
<h1 class="font-display text-2xl font-semibold text-wood-900 sm:text-3xl" style="font-variant: small-caps">
|
<h1 class="font-display text-lg font-bold text-wood-950">
|
||||||
{{ $t('map.continent', { k: continent }) }}
|
{{ $t('map.continent', { k: continent }) }}
|
||||||
<span v-if="rounded" class="ml-2 text-lg font-normal text-ink-500 tabular-nums">{{ rounded.x }}|{{ rounded.y }}</span>
|
<span v-if="rounded" class="ml-2 text-lg font-normal text-ink-500 tabular-nums">{{ rounded.x }}|{{ rounded.y }}</span>
|
||||||
</h1>
|
</h1>
|
||||||
|
|
@ -206,10 +206,10 @@ const continent = computed(() => (rounded.value ? `K${Math.floor(rounded.value.y
|
||||||
|
|
||||||
<p v-if="error" class="alert mb-4" role="alert">{{ error }}</p>
|
<p v-if="error" class="alert mb-4" role="alert">{{ error }}</p>
|
||||||
|
|
||||||
<div class="grid gap-5 xl:grid-cols-[1fr_20rem]">
|
<div class="grid gap-3 lg:grid-cols-[1fr_16rem]">
|
||||||
<div ref="box" class="relative min-w-0">
|
<div ref="box" class="relative min-w-0">
|
||||||
<!-- A dark wooden frame around the map, like a board on the table. -->
|
<!-- A dark wooden frame around the map, like a board on the table. -->
|
||||||
<div class="overflow-hidden rounded-md border-4 border-wood-800 bg-[#4f6129] shadow-hard">
|
<div class="overflow-hidden border-2 border-wood-900 bg-[#4f6129]">
|
||||||
<MapWorldMap
|
<MapWorldMap
|
||||||
v-if="visible"
|
v-if="visible"
|
||||||
:view="view"
|
:view="view"
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ const subject = computed(() => {
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="mx-auto max-w-4xl px-4 py-6 sm:px-6">
|
<div class="p-2.5">
|
||||||
<NuxtLink :to="`/reports/${worldId}`" class="mb-3 inline-block text-sm font-semibold text-blood-700 hover:underline">‹ {{ $t('reports.back') }}</NuxtLink>
|
<NuxtLink :to="`/reports/${worldId}`" class="mb-3 inline-block text-sm font-semibold text-blood-700 hover:underline">‹ {{ $t('reports.back') }}</NuxtLink>
|
||||||
<p v-if="error" class="alert mb-3" role="alert">{{ error }}</p>
|
<p v-if="error" class="alert mb-3" role="alert">{{ error }}</p>
|
||||||
<section v-if="report" class="panel">
|
<section v-if="report" class="panel">
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,25 @@ useCurrentWorld().enter(worldId)
|
||||||
const { t } = useI18n()
|
const { t } = useI18n()
|
||||||
const clock = useNow()
|
const clock = useNow()
|
||||||
|
|
||||||
|
// The kind of reports comes from the URL, so the menu's dropdown and the side menu link here.
|
||||||
|
const KINDS = ['attack', 'defense', 'support'] as const
|
||||||
|
watch(
|
||||||
|
() => route.query.type,
|
||||||
|
(q) => {
|
||||||
|
type.value = KINDS.includes(q as ReportType) ? (q as ReportType) : null
|
||||||
load(Number(route.query.page) || 1)
|
load(Number(route.query.page) || 1)
|
||||||
|
},
|
||||||
|
{ immediate: true },
|
||||||
|
)
|
||||||
|
const kinds = computed(() =>
|
||||||
|
(['all', ...KINDS] as const).map((k) => ({
|
||||||
|
key: k,
|
||||||
|
label: t(`reports.kinds.${k}`),
|
||||||
|
to: k === 'all' ? `/reports/${worldId}` : { path: `/reports/${worldId}`, query: { type: k } },
|
||||||
|
active: (type.value ?? 'all') === k,
|
||||||
|
count: k === 'all' ? page.value?.unread : undefined,
|
||||||
|
})),
|
||||||
|
)
|
||||||
|
|
||||||
const selected = ref<number[]>([])
|
const selected = ref<number[]>([])
|
||||||
watch(page, () => (selected.value = []))
|
watch(page, () => (selected.value = []))
|
||||||
|
|
@ -24,80 +42,60 @@ function subject(r: Report) {
|
||||||
return t('reports.title_attack', { from: villageLabel(r.payload.attacker.village), to: villageLabel(r.payload.defender.village) })
|
return t('reports.title_attack', { from: villageLabel(r.payload.attacker.village), to: villageLabel(r.payload.defender.village) })
|
||||||
}
|
}
|
||||||
|
|
||||||
// Kinds of reports as tabs, like the report folders in Die Stämme.
|
|
||||||
const kind = computed({
|
|
||||||
get: () => type.value ?? 'all',
|
|
||||||
set: (value: 'all' | ReportType) => {
|
|
||||||
type.value = value === 'all' ? null : value
|
|
||||||
load(1)
|
|
||||||
},
|
|
||||||
})
|
|
||||||
const kinds = computed(() => [
|
|
||||||
{ key: 'all' as const, label: t('reports.kinds.all'), icon: 'report' as const },
|
|
||||||
{ key: 'attack' as const, label: t('reports.kinds.attack'), icon: 'attack' as const },
|
|
||||||
{ key: 'defense' as const, label: t('reports.kinds.defense'), icon: 'support' as const },
|
|
||||||
{ key: 'support' as const, label: t('reports.kinds.support'), icon: 'users' as const },
|
|
||||||
])
|
|
||||||
|
|
||||||
const DOT = { won: 'bg-moss-600', losses: 'bg-gold-500', lost: 'bg-blood-700', info: 'bg-iron-400' }
|
const DOT = { won: 'bg-moss-600', losses: 'bg-gold-500', lost: 'bg-blood-700', info: 'bg-iron-400' }
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<!-- The report list, like Die Stämme's: a coloured dot for the outcome, unread in bold, newest first. -->
|
<!-- The report list, like Die Stämme's: kinds on the left; a dot for the outcome, unread in bold, newest first; act on checked rows. -->
|
||||||
<template>
|
<template>
|
||||||
<div class="mx-auto max-w-4xl px-4 py-6 sm:px-6">
|
<div class="space-y-2 p-2.5">
|
||||||
<section class="panel">
|
<h1 class="font-display text-lg font-bold text-wood-950">{{ $t('reports.title') }}</h1>
|
||||||
<div class="panel-head">
|
<div class="grid gap-2 md:grid-cols-[10rem_minmax(0,1fr)]">
|
||||||
<h1 class="panel-title">{{ $t('reports.title') }}</h1>
|
<UiSideMenu :items="kinds" class="self-start" />
|
||||||
<button v-if="page?.unread" type="button" class="text-sm font-semibold text-blood-700 hover:underline" :disabled="busy" @click="readAll()">
|
|
||||||
{{ $t('reports.read_all') }}
|
<section class="panel min-w-0">
|
||||||
</button>
|
<p v-if="error" class="alert m-2" role="alert">{{ error }}</p>
|
||||||
</div>
|
<p v-if="!page" class="py-6 text-center text-[13px] text-ink-500">{{ $t('common.loading') }}</p>
|
||||||
<div class="panel-body">
|
<p v-else-if="!page.reports.length" class="py-6 text-center text-[13px] text-ink-500">{{ $t('reports.none') }}</p>
|
||||||
<UiSubTabs v-model="kind" :tabs="kinds" class="mb-3" />
|
|
||||||
<p v-if="error" class="alert mb-3" role="alert">{{ error }}</p>
|
|
||||||
<p v-if="!page" class="py-6 text-center text-sm text-ink-500">{{ $t('common.loading') }}</p>
|
|
||||||
<p v-else-if="!page.reports.length" class="py-6 text-center text-sm text-ink-500">{{ $t('reports.none') }}</p>
|
|
||||||
<template v-else>
|
<template v-else>
|
||||||
<table class="w-full text-sm">
|
<table class="grid-table">
|
||||||
<thead>
|
<thead>
|
||||||
<tr class="border-b-2 border-parchment-300 text-left text-xs text-ink-500">
|
<tr>
|
||||||
<th class="w-8 py-1.5">
|
<th class="w-6"><input type="checkbox" :checked="allSelected" :aria-label="$t('reports.select_all')" @change="toggleAll" /></th>
|
||||||
<input type="checkbox" :checked="allSelected" :aria-label="$t('reports.select_all')" @change="toggleAll" />
|
<th>{{ $t('reports.subject') }}</th>
|
||||||
</th>
|
<th class="text-right">{{ $t('reports.received') }}</th>
|
||||||
<th class="py-1.5 font-semibold">{{ $t('reports.subject') }}</th>
|
|
||||||
<th class="py-1.5 text-right font-semibold">{{ $t('reports.received') }}</th>
|
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody class="divide-y divide-parchment-300">
|
<tbody>
|
||||||
<tr v-for="r in page.reports" :key="r.id">
|
<tr v-for="r in page.reports" :key="r.id" class="hover:bg-parchment-100">
|
||||||
<td class="py-1.5">
|
<td><input v-model="selected" type="checkbox" :value="r.id" :aria-label="$t('reports.select', { subject: subject(r) })" /></td>
|
||||||
<input v-model="selected" type="checkbox" :value="r.id" :aria-label="$t('reports.select', { subject: subject(r) })" />
|
<td>
|
||||||
</td>
|
<NuxtLink :to="`/reports/${worldId}/${r.id}`" class="flex items-center gap-1.5 hover:text-blood-700 hover:underline" :class="r.read ? '' : 'font-bold'">
|
||||||
<td class="py-1.5 pr-2">
|
<span class="size-2 shrink-0 rounded-full" :class="DOT[reportTone(r)]" :title="$t(`reports.tone.${reportTone(r)}`)" />
|
||||||
<NuxtLink :to="`/reports/${worldId}/${r.id}`" class="flex items-center gap-2 hover:underline" :class="r.read ? '' : 'font-semibold'">
|
<IconUi :name="r.type === 'support' ? 'support' : 'attack'" class="size-3.5 shrink-0 text-ink-500" />
|
||||||
<span class="size-2.5 shrink-0 rounded-full" :class="DOT[reportTone(r)]" :title="$t(`reports.tone.${reportTone(r)}`)" />
|
|
||||||
<IconUi :name="r.type === 'support' ? 'support' : 'attack'" class="size-4 shrink-0 text-ink-500" />
|
|
||||||
<span class="min-w-0">{{ subject(r) }}</span>
|
<span class="min-w-0">{{ subject(r) }}</span>
|
||||||
<span v-if="!r.read" class="sr-only">({{ $t('reports.unread') }})</span>
|
<span v-if="!r.read" class="sr-only">({{ $t('reports.unread') }})</span>
|
||||||
</NuxtLink>
|
</NuxtLink>
|
||||||
</td>
|
</td>
|
||||||
<td class="py-1.5 text-right whitespace-nowrap text-ink-700 tabular-nums">{{ formatArrival(Date.parse(r.happened_at), clock, t) }}</td>
|
<td class="text-right whitespace-nowrap text-ink-700 tabular-nums">{{ formatArrival(Date.parse(r.happened_at), clock, t) }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<div class="mt-3 flex flex-wrap items-center gap-2 border-t-2 border-parchment-300 pt-3">
|
<div class="flex flex-wrap items-center gap-2 bg-parchment-200 px-1.5 py-1">
|
||||||
<button type="button" class="btn btn-outline px-2.5 py-1" :disabled="busy || !selected.length" @click="remove(selected)">
|
<label class="flex items-center gap-1 text-[13px]">
|
||||||
{{ $t('reports.delete') }}
|
<input type="checkbox" :checked="allSelected" @change="toggleAll" />
|
||||||
</button>
|
{{ $t('reports.select_all') }}
|
||||||
<div v-if="page.pages > 1" class="ml-auto flex items-center gap-2 text-sm">
|
</label>
|
||||||
<button type="button" class="btn btn-ghost px-2 py-1" :disabled="busy || page.page <= 1" @click="load(page.page - 1)">‹ {{ $t('reports.prev') }}</button>
|
<button type="button" class="btn btn-primary" :disabled="busy || !selected.length" @click="remove(selected)">{{ $t('reports.delete') }}</button>
|
||||||
|
<button v-if="page.unread" type="button" class="btn btn-outline" :disabled="busy" @click="readAll()">{{ $t('reports.read_all') }}</button>
|
||||||
|
<div v-if="page.pages > 1" class="ml-auto flex items-center gap-1 text-[13px]">
|
||||||
|
<button type="button" class="btn btn-ghost" :disabled="busy || page.page <= 1" @click="load(page.page - 1)">‹ {{ $t('reports.prev') }}</button>
|
||||||
<span class="tabular-nums text-ink-700">{{ $t('reports.page', { page: page.page, pages: page.pages }) }}</span>
|
<span class="tabular-nums text-ink-700">{{ $t('reports.page', { page: page.page, pages: page.pages }) }}</span>
|
||||||
<button type="button" class="btn btn-ghost px-2 py-1" :disabled="busy || page.page >= page.pages" @click="load(page.page + 1)">{{ $t('reports.next') }} ›</button>
|
<button type="button" class="btn btn-ghost" :disabled="busy || page.page >= page.pages" @click="load(page.page + 1)">{{ $t('reports.next') }} ›</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</div>
|
|
||||||
</section>
|
</section>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
|
|
@ -12,9 +12,9 @@ const showInVillage = (id: number) => navigateTo({ path: `/village/${route.param
|
||||||
|
|
||||||
<!-- The headquarters screen: every building to construct, upgrade or tear down, and the queue. -->
|
<!-- The headquarters screen: every building to construct, upgrade or tear down, and the queue. -->
|
||||||
<template>
|
<template>
|
||||||
<div class="mx-auto max-w-[96rem] space-y-6 px-4 py-6 sm:px-6">
|
<div class="space-y-3 p-2.5">
|
||||||
<VillageScreenHeader type="headquarters" :level="hq?.level ?? null" :title="$t('buildings.headquarters')" :description="$t('village.about.build')" />
|
<VillageScreenHeader type="headquarters" :level="hq?.level ?? null" :title="$t('buildings.headquarters')" :description="$t('village.about.build')" />
|
||||||
<div class="grid gap-6 lg:grid-cols-[minmax(0,1fr)_22rem] 2xl:grid-cols-[minmax(0,1fr)_26rem]">
|
<div class="grid gap-3 lg:grid-cols-[minmax(0,1fr)_18rem]">
|
||||||
<VillageBuildForm
|
<VillageBuildForm
|
||||||
:options="village.buildable"
|
:options="village.buildable"
|
||||||
:buildings="village.buildings"
|
:buildings="village.buildings"
|
||||||
|
|
|
||||||
|
|
@ -37,15 +37,15 @@ async function build(type: BuildingType) {
|
||||||
|
|
||||||
<!-- The village overview, laid out like Die Stämme's: the village, and a narrow column beside it. -->
|
<!-- The village overview, laid out like Die Stämme's: the village, and a narrow column beside it. -->
|
||||||
<template>
|
<template>
|
||||||
<div class="lg:grid lg:grid-cols-[minmax(0,1fr)_17rem] xl:grid-cols-[minmax(0,1fr)_19rem]">
|
<div class="lg:grid lg:grid-cols-[minmax(0,1fr)_15rem]">
|
||||||
<div class="relative">
|
<div class="relative">
|
||||||
<div class="h-[clamp(260px,82vw,460px)] sm:h-[clamp(380px,calc(100dvh-9rem),880px)]">
|
<div class="h-[clamp(260px,82vw,440px)] sm:h-[520px] lg:h-full lg:min-h-[520px]">
|
||||||
<VillageDiorama v-model:selected="selected" v-model:plot="plot" :village="village" :seconds-until="v.secondsUntil" />
|
<VillageDiorama v-model:selected="selected" v-model:plot="plot" :village="village" :seconds-until="v.secondsUntil" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<VillageBuildingCard
|
<VillageBuildingCard
|
||||||
v-if="selectedBuilding"
|
v-if="selectedBuilding"
|
||||||
class="mx-4 my-4 lg:absolute lg:top-4 lg:right-4 lg:z-10 lg:m-0 lg:w-80"
|
class="m-2 lg:absolute lg:top-2 lg:right-2 lg:z-10 lg:m-0 lg:w-72"
|
||||||
:building="selectedBuilding"
|
:building="selectedBuilding"
|
||||||
:resources="resources"
|
:resources="resources"
|
||||||
:can-afford="v.canAfford"
|
:can-afford="v.canAfford"
|
||||||
|
|
@ -58,7 +58,7 @@ async function build(type: BuildingType) {
|
||||||
/>
|
/>
|
||||||
<VillagePlotCard
|
<VillagePlotCard
|
||||||
v-else-if="plotOption"
|
v-else-if="plotOption"
|
||||||
class="mx-4 my-4 lg:absolute lg:top-4 lg:right-4 lg:z-10 lg:m-0 lg:w-80"
|
class="m-2 lg:absolute lg:top-2 lg:right-2 lg:z-10 lg:m-0 lg:w-72"
|
||||||
:option="plotOption"
|
:option="plotOption"
|
||||||
:resources="resources"
|
:resources="resources"
|
||||||
:can-afford="v.canAfford"
|
:can-afford="v.canAfford"
|
||||||
|
|
|
||||||
|
|
@ -28,11 +28,11 @@ const home = computed(() => unitRows(village.value.troops))
|
||||||
|
|
||||||
<!-- The rally point: send troops and follow them, see where the troops are, and simulate battles. -->
|
<!-- The rally point: send troops and follow them, see where the troops are, and simulate battles. -->
|
||||||
<template>
|
<template>
|
||||||
<div class="mx-auto max-w-[96rem] space-y-5 px-4 py-6 sm:px-6">
|
<div class="space-y-3 p-2.5">
|
||||||
<VillageScreenHeader type="rally_point" :level="rallyPoint?.level ?? null" :title="$t('buildings.rally_point')" :description="$t('village.about.rally')" />
|
<VillageScreenHeader type="rally_point" :level="rallyPoint?.level ?? null" :title="$t('buildings.rally_point')" :description="$t('village.about.rally')" />
|
||||||
<UiSubTabs v-model="tab" :tabs="tabs" />
|
<UiSubTabs v-model="tab" :tabs="tabs" />
|
||||||
|
|
||||||
<div v-if="tab === 'commands'" class="grid gap-6 xl:grid-cols-[minmax(0,1fr)_minmax(0,1fr)]">
|
<div v-if="tab === 'commands'" class="grid gap-3 lg:grid-cols-[minmax(0,1fr)_minmax(0,1fr)]">
|
||||||
<VillageSendTroops
|
<VillageSendTroops
|
||||||
:key="`${route.query.x}|${route.query.y}`"
|
:key="`${route.query.x}|${route.query.y}`"
|
||||||
class="self-start"
|
class="self-start"
|
||||||
|
|
@ -54,7 +54,7 @@ const home = computed(() => unitRows(village.value.troops))
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div v-else-if="tab === 'troops'" class="grid gap-6 lg:grid-cols-[22rem_minmax(0,1fr)]">
|
<div v-else-if="tab === 'troops'" class="grid gap-3 lg:grid-cols-[18rem_minmax(0,1fr)]">
|
||||||
<section class="panel self-start">
|
<section class="panel self-start">
|
||||||
<div class="panel-head">
|
<div class="panel-head">
|
||||||
<h2 class="panel-title">{{ $t('village.rally.at_home') }}</h2>
|
<h2 class="panel-title">{{ $t('village.rally.at_home') }}</h2>
|
||||||
|
|
|
||||||
|
|
@ -15,14 +15,14 @@ const shown = computed(() => village.value.military.find((m) => m.building_id ==
|
||||||
|
|
||||||
<!-- Recruiting at every military building, the troops at home and the levy. -->
|
<!-- Recruiting at every military building, the troops at home and the levy. -->
|
||||||
<template>
|
<template>
|
||||||
<div class="mx-auto max-w-[96rem] space-y-6 px-4 py-6 sm:px-6">
|
<div class="space-y-3 p-2.5">
|
||||||
<VillageScreenHeader
|
<VillageScreenHeader
|
||||||
:type="shown?.type ?? 'barracks'"
|
:type="shown?.type ?? 'barracks'"
|
||||||
:level="shown?.level ?? null"
|
:level="shown?.level ?? null"
|
||||||
:title="shown ? $t(`buildings.${shown.type}`) : $t('village.screens.recruit')"
|
:title="shown ? $t(`buildings.${shown.type}`) : $t('village.screens.recruit')"
|
||||||
:description="$t('village.about.recruit')"
|
:description="$t('village.about.recruit')"
|
||||||
/>
|
/>
|
||||||
<div class="grid gap-6 lg:grid-cols-[minmax(0,1fr)_22rem] 2xl:grid-cols-[minmax(0,1fr)_26rem]">
|
<div class="grid gap-3 lg:grid-cols-[minmax(0,1fr)_18rem]">
|
||||||
<VillageRecruit
|
<VillageRecruit
|
||||||
v-if="village.military.length"
|
v-if="village.military.length"
|
||||||
v-model:selected="recruitAt"
|
v-model:selected="recruitAt"
|
||||||
|
|
|
||||||
|
|
@ -10,9 +10,9 @@ const showInVillage = (id: number) => navigateTo({ path: `/village/${route.param
|
||||||
|
|
||||||
<!-- Who works where: staffing and priorities per building, and the population behind it. -->
|
<!-- Who works where: staffing and priorities per building, and the population behind it. -->
|
||||||
<template>
|
<template>
|
||||||
<div class="mx-auto max-w-[96rem] space-y-6 px-4 py-6 sm:px-6">
|
<div class="space-y-3 p-2.5">
|
||||||
<VillageScreenHeader type="farm" :level="farm?.level ?? null" :title="$t('village.screens.workforce')" :description="$t('village.about.workforce')" />
|
<VillageScreenHeader type="farm" :level="farm?.level ?? null" :title="$t('village.screens.workforce')" :description="$t('village.about.workforce')" />
|
||||||
<div class="grid gap-6 lg:grid-cols-[minmax(0,1fr)_22rem] 2xl:grid-cols-[minmax(0,1fr)_26rem]">
|
<div class="grid gap-3 lg:grid-cols-[minmax(0,1fr)_18rem]">
|
||||||
<VillageBuildingTable :buildings="village.buildings" :busy="v.busy.value" @select="showInVillage" @priority="v.setPriority" />
|
<VillageBuildingTable :buildings="village.buildings" :busy="v.busy.value" @select="showInVillage" @priority="v.setPriority" />
|
||||||
<VillagePopulationPanel :population="village.population" :militia="village.levy.militia" />
|
<VillagePopulationPanel :population="village.population" :militia="village.levy.militia" />
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue