fix: responsive building pages: the send form and simulator size by their column, the build queue sits with the headquarters on the right, action buttons never wrap or clip, the menu shows icons only below 1024 px

Checked every world page at 1920, 1465, 1280, 1024, 900, 768, 600 and 390 px for clipped, spilling and page-wide overflow.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Fabian @ Blax Software 2026-10-30 13:52:30 +01:00
parent dfc02b1e5d
commit 8a83f8fe6d
5 changed files with 30 additions and 32 deletions

View File

@ -118,7 +118,7 @@ watch(() => route.fullPath, () => menuKey.value++)
:title="t('app.shortcut', { key: shortcutOf(e.key) })" :title="t('app.shortcut', { key: shortcutOf(e.key) })"
> >
<IconUi :name="e.icon" class="size-4" /> <IconUi :name="e.icon" class="size-4" />
<span class="hidden sm:inline">{{ t(`app.${e.key}`) }}</span> <span class="hidden lg:inline">{{ t(`app.${e.key}`) }}</span>
<span v-if="e.count" class="font-bold text-gold-400 tabular-nums">({{ e.count }})</span> <span v-if="e.count" class="font-bold text-gold-400 tabular-nums">({{ e.count }})</span>
</NuxtLink> </NuxtLink>
<div v-if="e.sub.length" class="menu-drop"> <div v-if="e.sub.length" class="menu-drop">
@ -128,7 +128,7 @@ watch(() => route.fullPath, () => menuKey.value++)
</nav> </nav>
<div class="ml-auto flex items-stretch"> <div class="ml-auto flex items-stretch">
<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="world" class="hidden items-center border-l border-wood-700 px-2.5 text-parchment-300 xl:flex">{{ world.name }}</span>
<button <button
v-if="entries.length" v-if="entries.length"
type="button" type="button"
@ -138,7 +138,7 @@ watch(() => route.fullPath, () => menuKey.value++)
@click="chat.toggle()" @click="chat.toggle()"
> >
<IconUi name="chat" class="size-4" /> <IconUi name="chat" class="size-4" />
<span class="hidden sm:inline">{{ t('app.chat') }}</span> <span class="hidden lg:inline">{{ t('app.chat') }}</span>
<span v-if="chat.unread.value" class="font-bold text-gold-400 tabular-nums">({{ chat.unread.value }})</span> <span v-if="chat.unread.value" class="font-bold text-gold-400 tabular-nums">({{ chat.unread.value }})</span>
</button> </button>
<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 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}`">
@ -148,7 +148,7 @@ watch(() => route.fullPath, () => menuKey.value++)
<div v-if="user" class="group relative flex"> <div v-if="user" class="group relative flex">
<button type="button" class="menu-item border-r-0 border-l" :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-28 truncate md:inline">{{ user.name }}</span> <span class="hidden max-w-28 truncate lg:inline">{{ user.name }}</span>
</button> </button>
<div class="menu-drop right-0 left-auto"> <div class="menu-drop right-0 left-auto">
<NuxtLink to="/worlds" class="menu-drop-item">{{ t('app.change_world') }}</NuxtLink> <NuxtLink to="/worlds" class="menu-drop-item">{{ t('app.change_world') }}</NuxtLink>

View File

@ -190,14 +190,14 @@ const demolishable = computed(() =>
<button <button
v-if="!reason(row.offer)" v-if="!reason(row.offer)"
type="button" type="button"
class="btn btn-primary min-w-[5.5rem] px-2.5 py-1" class="btn btn-primary min-w-[5.5rem] px-2.5 py-1 whitespace-nowrap"
:disabled="busy" :disabled="busy"
@click="emit('upgrade', row.building.id)" @click="emit('upgrade', row.building.id)"
> >
<IconUi name="up" class="size-3.5" /> <IconUi name="up" class="size-3.5" />
{{ $t('village.build.level_button', { level: row.offer!.target_level }) }} {{ $t('village.build.level_button', { level: row.offer!.target_level }) }}
</button> </button>
<span v-else class="text-xs font-semibold text-blood-700">{{ reason(row.offer) }}</span> <span v-else class="text-xs font-semibold whitespace-nowrap text-blood-700">{{ reason(row.offer) }}</span>
</td> </td>
</template> </template>
<template v-else> <template v-else>
@ -208,14 +208,14 @@ const demolishable = computed(() =>
<button <button
v-if="!reason(row.option)" v-if="!reason(row.option)"
type="button" type="button"
class="btn btn-outline min-w-[5.5rem] border-blood-700 px-2.5 py-1 text-blood-700" class="btn btn-outline min-w-[5.5rem] border-blood-700 px-2.5 py-1 whitespace-nowrap text-blood-700"
:disabled="busy" :disabled="busy"
@click="emit('build', row.type)" @click="emit('build', row.type)"
> >
<IconUi :name="row.another ? 'plus' : 'hammer'" class="size-3.5" /> <IconUi :name="row.another ? 'plus' : 'hammer'" class="size-3.5" />
{{ $t(row.another ? 'village.build.submit_another' : 'village.build.submit') }} {{ $t(row.another ? 'village.build.submit_another' : 'village.build.submit') }}
</button> </button>
<span v-else class="text-xs font-semibold text-blood-700">{{ reason(row.option) }}</span> <span v-else class="text-xs font-semibold whitespace-nowrap text-blood-700">{{ reason(row.option) }}</span>
</td> </td>
</template> </template>
</tr> </tr>
@ -275,7 +275,7 @@ const demolishable = computed(() =>
<button <button
v-if="b.demolish" v-if="b.demolish"
type="button" type="button"
class="btn btn-outline min-w-[5.5rem] border-blood-700 px-2.5 py-1 text-blood-700" class="btn btn-outline min-w-[5.5rem] border-blood-700 px-2.5 py-1 whitespace-nowrap text-blood-700"
:disabled="busy" :disabled="busy"
@click="emit('demolish', b.id)" @click="emit('demolish', b.id)"
> >

View File

@ -86,7 +86,7 @@ function modeHint(m: VillageState['rally']['modes'][number]) {
{{ $t('village.rally.all') }} {{ $t('village.rally.all') }}
</button> </button>
</div> </div>
<form class="panel-body space-y-4" @submit.prevent="submit('attack')"> <form class="@container panel-body space-y-4" @submit.prevent="submit('attack')">
<p v-if="!village.rally.has_rally_point" class="alert"> <p v-if="!village.rally.has_rally_point" class="alert">
{{ $t('village.rally.no_rally_point') }} {{ $t('village.rally.no_rally_point') }}
<NuxtLink :to="`/village/${village.id}/build`" class="font-semibold underline">{{ $t('village.rally.to_build') }}</NuxtLink> <NuxtLink :to="`/village/${village.id}/build`" class="font-semibold underline">{{ $t('village.rally.to_build') }}</NuxtLink>
@ -95,7 +95,7 @@ function modeHint(m: VillageState['rally']['modes'][number]) {
{{ $t('village.rally.protected', { time: formatArrival(Date.parse(village.rally.protected_until), now, t) }) }} {{ $t('village.rally.protected', { time: formatArrival(Date.parse(village.rally.protected_until), now, t) }) }}
</p> </p>
<div class="grid gap-x-6 gap-y-3 sm:grid-cols-2 xl:grid-cols-4"> <div class="grid gap-x-6 gap-y-3 @sm:grid-cols-2 @2xl:grid-cols-4">
<fieldset v-for="group in UNIT_GROUPS" :key="group.name"> <fieldset v-for="group in UNIT_GROUPS" :key="group.name">
<legend class="mb-1 text-xs font-semibold tracking-wide text-ink-500 uppercase">{{ $t(`village.rally.groups.${group.name}`) }}</legend> <legend class="mb-1 text-xs font-semibold tracking-wide text-ink-500 uppercase">{{ $t(`village.rally.groups.${group.name}`) }}</legend>
<div v-for="unit in group.units" :key="unit" class="flex items-center gap-2 py-0.5" :class="home(unit) ? '' : 'opacity-50'"> <div v-for="unit in group.units" :key="unit" class="flex items-center gap-2 py-0.5" :class="home(unit) ? '' : 'opacity-50'">
@ -123,7 +123,7 @@ function modeHint(m: VillageState['rally']['modes'][number]) {
</div> </div>
<p v-if="!hasTroops" class="text-sm text-ink-500">{{ $t('village.rally.none_home') }}</p> <p v-if="!hasTroops" class="text-sm text-ink-500">{{ $t('village.rally.none_home') }}</p>
<div class="grid gap-3 border-t-2 border-parchment-300 pt-3 sm:grid-cols-[10rem_1fr]"> <div class="grid gap-3 border-t-2 border-parchment-300 pt-3 @md:grid-cols-[10rem_1fr]">
<label for="send-target" class="label self-center">{{ $t('village.rally.target') }}</label> <label for="send-target" class="label self-center">{{ $t('village.rally.target') }}</label>
<input <input
id="send-target" id="send-target"

View File

@ -58,8 +58,8 @@ async function run() {
<IconUi name="plus" class="size-4 text-ink-500 group-open:hidden" /> <IconUi name="plus" class="size-4 text-ink-500 group-open:hidden" />
<IconUi name="minus" class="hidden size-4 text-ink-500 group-open:block" /> <IconUi name="minus" class="hidden size-4 text-ink-500 group-open:block" />
</summary> </summary>
<form class="panel-body space-y-4" @submit.prevent="run"> <form class="@container panel-body space-y-4" @submit.prevent="run">
<div class="grid gap-x-6 gap-y-2 sm:grid-cols-[auto_6rem_6rem]"> <div class="grid gap-x-6 gap-y-2 @md:grid-cols-[auto_6rem_6rem]">
<span /> <span />
<span class="text-xs font-semibold text-ink-500 uppercase">{{ $t('reports.battle.attacker') }}</span> <span class="text-xs font-semibold text-ink-500 uppercase">{{ $t('reports.battle.attacker') }}</span>
<span class="text-xs font-semibold text-ink-500 uppercase">{{ $t('reports.battle.defender') }}</span> <span class="text-xs font-semibold text-ink-500 uppercase">{{ $t('reports.battle.defender') }}</span>
@ -89,7 +89,7 @@ async function run() {
</template> </template>
</div> </div>
<div class="grid grid-cols-2 gap-3 border-t-2 border-parchment-300 pt-3 sm:grid-cols-5"> <div class="grid grid-cols-2 gap-3 border-t-2 border-parchment-300 pt-3 @xl:grid-cols-5">
<label class="text-sm"> <label class="text-sm">
<span class="label">{{ $t('buildings.wall') }}</span> <span class="label">{{ $t('buildings.wall') }}</span>
<input v-model.number="wall" type="number" min="0" max="20" class="input px-1.5 py-0.5 tabular-nums" /> <input v-model.number="wall" type="number" min="0" max="20" class="input px-1.5 py-0.5 tabular-nums" />

View File

@ -31,22 +31,6 @@ function showBuilding(id: number) {
@priority="v.setPriority" @priority="v.setPriority"
/> />
<VillageScreenHeader v-else type="headquarters" :level="null" :title="$t('buildings.headquarters')" :description="$t('village.about.build')" /> <VillageScreenHeader v-else type="headquarters" :level="null" :title="$t('buildings.headquarters')" :description="$t('village.about.build')" />
</template>
<div class="grid gap-3 @4xl:grid-cols-[minmax(0,1fr)_18rem]">
<VillageBuildForm
:options="village.buildable"
:buildings="village.buildings"
:space="village.space"
:resources="resources"
:can-afford="v.canAfford"
:busy="v.busy.value"
:hint="typeof route.query.hint === 'string' ? route.query.hint : null"
@build="v.build"
@upgrade="v.upgrade"
@demolish="v.demolish"
@select="showBuilding"
/>
<VillageBuildQueue <VillageBuildQueue
:queue="village.queue" :queue="village.queue"
:builders="village.builders" :builders="village.builders"
@ -54,6 +38,20 @@ function showBuilding(id: number) {
:busy="v.busy.value" :busy="v.busy.value"
@cancel="v.cancel" @cancel="v.cancel"
/> />
</div> </template>
<VillageBuildForm
:options="village.buildable"
:buildings="village.buildings"
:space="village.space"
:resources="resources"
:can-afford="v.canAfford"
:busy="v.busy.value"
:hint="typeof route.query.hint === 'string' ? route.query.hint : null"
@build="v.build"
@upgrade="v.upgrade"
@demolish="v.demolish"
@select="showBuilding"
/>
</VillageScreenLayout> </VillageScreenLayout>
</template> </template>