feat: flat village header strip above the land and a solid details card
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
f5b7c41f99
commit
435aaff19b
|
|
@ -17,11 +17,11 @@ const emit = defineEmits<{
|
|||
|
||||
<!-- Details of the building selected in the diorama, with its actions. -->
|
||||
<template>
|
||||
<section class="panel bg-white/95 shadow-lg backdrop-blur" :aria-label="$t(`buildings.${building.type}`)">
|
||||
<div class="flex items-center gap-3 border-b border-parchment-200 px-4 py-3">
|
||||
<section class="panel" :aria-label="$t(`buildings.${building.type}`)">
|
||||
<div class="flex items-center gap-3 border-b-2 border-wood-700 bg-parchment-200 px-4 py-3">
|
||||
<IconBuildingTile :type="building.type" class="size-11" />
|
||||
<div class="min-w-0 flex-1">
|
||||
<h2 class="truncate font-display text-lg font-semibold">{{ $t(`buildings.${building.type}`) }}</h2>
|
||||
<h2 class="truncate font-display text-lg font-semibold text-wood-900" style="font-variant: small-caps">{{ $t(`buildings.${building.type}`) }}</h2>
|
||||
<p class="text-xs text-ink-500">
|
||||
{{ $t('village.buildings.level_n', { level: building.level }) }}
|
||||
<template v-if="building.space"> · {{ $t('village.build.space', { space: building.space }) }}</template>
|
||||
|
|
@ -51,7 +51,7 @@ const emit = defineEmits<{
|
|||
|
||||
<div class="flex items-center justify-between gap-3 text-sm">
|
||||
<span class="text-ink-500">{{ $t('village.buildings.priority') }}</span>
|
||||
<div class="inline-flex items-center rounded-lg ring-1 ring-parchment-300">
|
||||
<div class="inline-flex items-center rounded-sm border border-wood-600 bg-parchment-50">
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-ghost rounded-r-none p-1"
|
||||
|
|
@ -74,7 +74,7 @@ const emit = defineEmits<{
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div v-if="building.upgrade" class="space-y-1.5 rounded-lg bg-parchment-50 p-3 ring-1 ring-parchment-200">
|
||||
<div v-if="building.upgrade" class="space-y-1.5 rounded-sm border border-wood-600/50 bg-parchment-100 p-3">
|
||||
<div class="flex items-center justify-between gap-2 text-xs text-ink-500">
|
||||
<UiCost :cost="building.upgrade.cost" :have="resources" />
|
||||
<span class="flex items-center gap-1 tabular-nums">
|
||||
|
|
|
|||
|
|
@ -29,54 +29,59 @@ function showInVillage(id: number) {
|
|||
<div v-if="village && resources">
|
||||
<VillageResourceBar class="sticky top-0 z-30" :village="village" :resources="resources" />
|
||||
|
||||
<section class="relative border-b border-parchment-300/70">
|
||||
<div class="px-4 pt-4 sm:pointer-events-none sm:absolute sm:top-5 sm:left-6 sm:z-10 sm:p-0">
|
||||
<div class="rounded-xl bg-white/85 px-4 py-3 shadow-sm ring-1 ring-parchment-300/70 backdrop-blur sm:pointer-events-auto">
|
||||
<p class="text-xs font-medium tracking-wide text-ink-500 uppercase">{{ $t('village.title') }}</p>
|
||||
<h1 class="font-display text-xl font-semibold sm:text-2xl">{{ village.name }}</h1>
|
||||
<NuxtLink
|
||||
:to="{ path: `/map/${village.world_id}`, query: { x: village.x, y: village.y } }"
|
||||
class="mt-0.5 inline-flex items-center gap-1 text-xs text-ink-500 hover:text-amber-800 hover:underline"
|
||||
:title="$t('village.on_map')"
|
||||
>
|
||||
<IconUi name="pin" class="size-3.5" />
|
||||
<span class="tabular-nums">{{ village.x }}|{{ village.y }} · {{ village.continent }}</span>
|
||||
<span>· {{ $t('village.points', { points: village.points }) }}</span>
|
||||
</NuxtLink>
|
||||
<div class="mt-2.5 sm:w-52">
|
||||
<div class="mb-1 flex justify-between gap-3 text-xs">
|
||||
<span class="text-ink-500">{{ $t('village.diorama.space') }}</span>
|
||||
<span class="font-semibold tabular-nums">
|
||||
{{ $t('village.diorama.space_value', { used: village.space.used, max: village.space.max }) }}
|
||||
</span>
|
||||
</div>
|
||||
<UiBar :value="spaceShare" :tone="spaceShare >= 1 ? 'rose' : 'emerald'" />
|
||||
<section class="border-b-2 border-wood-700">
|
||||
<!-- Village header: a flat parchment strip above the land, so nothing covers the view. -->
|
||||
<div class="flex flex-wrap items-center gap-x-6 gap-y-2 border-b-2 border-wood-700 bg-parchment-200 px-4 py-2.5 sm:px-6">
|
||||
<div class="min-w-0">
|
||||
<p class="text-xs font-semibold tracking-wide text-ink-500 uppercase">{{ $t('village.title') }}</p>
|
||||
<h1 class="truncate font-display text-xl font-semibold text-wood-900 sm:text-2xl" style="font-variant: small-caps">
|
||||
{{ village.name }}
|
||||
</h1>
|
||||
</div>
|
||||
<NuxtLink
|
||||
:to="{ path: `/map/${village.world_id}`, query: { x: village.x, y: village.y } }"
|
||||
class="inline-flex items-center gap-1 rounded-sm border border-wood-600/50 bg-parchment-50 px-2 py-1 text-sm text-ink-700 hover:border-blood-700 hover:text-blood-700"
|
||||
:title="$t('village.on_map')"
|
||||
>
|
||||
<IconUi name="pin" class="size-3.5" />
|
||||
<span class="font-semibold tabular-nums">{{ village.x }}|{{ village.y }}</span>
|
||||
<span class="text-ink-500">· {{ village.continent }} · {{ $t('village.points', { points: village.points }) }}</span>
|
||||
</NuxtLink>
|
||||
<div class="w-full sm:ml-auto sm:w-64">
|
||||
<div class="mb-1 flex justify-between gap-3 text-xs">
|
||||
<span class="font-semibold text-ink-700">{{ $t('village.diorama.space') }}</span>
|
||||
<span class="font-semibold tabular-nums">
|
||||
{{ $t('village.diorama.space_value', { used: village.space.used, max: village.space.max }) }}
|
||||
</span>
|
||||
</div>
|
||||
<UiBar :value="spaceShare" :tone="spaceShare >= 1 ? 'rose' : 'emerald'" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="h-[clamp(240px,74vw,440px)] sm:h-[clamp(320px,64vh,780px)]">
|
||||
<VillageDiorama v-model:selected="selected" :village="village" />
|
||||
<div class="relative">
|
||||
<div class="h-[clamp(260px,82vw,460px)] sm:h-[clamp(340px,62vh,760px)]">
|
||||
<VillageDiorama v-model:selected="selected" :village="village" />
|
||||
</div>
|
||||
|
||||
<p
|
||||
class="pointer-events-none absolute bottom-3 left-1/2 hidden -translate-x-1/2 rounded-sm border border-wood-700 bg-parchment-50 px-3 py-1 text-xs text-ink-700 sm:block"
|
||||
>
|
||||
{{ $t('village.diorama.hint') }}
|
||||
</p>
|
||||
|
||||
<VillageBuildingCard
|
||||
v-if="selectedBuilding"
|
||||
class="mx-4 my-4 lg:absolute lg:top-4 lg:right-6 lg:z-10 lg:m-0 lg:w-80"
|
||||
:building="selectedBuilding"
|
||||
:resources="resources"
|
||||
:can-afford="v.canAfford"
|
||||
:busy="busy"
|
||||
@upgrade="v.upgrade"
|
||||
@demolish="v.demolish"
|
||||
@priority="v.setPriority"
|
||||
@close="selected = null"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<p
|
||||
class="pointer-events-none absolute bottom-3 left-1/2 hidden -translate-x-1/2 rounded-full bg-white/75 px-3 py-1 text-xs text-ink-500 shadow-sm sm:block"
|
||||
>
|
||||
{{ $t('village.diorama.hint') }}
|
||||
</p>
|
||||
|
||||
<VillageBuildingCard
|
||||
v-if="selectedBuilding"
|
||||
class="mx-4 mb-4 lg:absolute lg:top-5 lg:right-6 lg:z-10 lg:m-0 lg:w-80"
|
||||
:building="selectedBuilding"
|
||||
:resources="resources"
|
||||
:can-afford="v.canAfford"
|
||||
:busy="busy"
|
||||
@upgrade="v.upgrade"
|
||||
@demolish="v.demolish"
|
||||
@priority="v.setPriority"
|
||||
@close="selected = null"
|
||||
/>
|
||||
</section>
|
||||
|
||||
<div class="space-y-6 px-4 py-6 sm:px-6">
|
||||
|
|
|
|||
Loading…
Reference in New Issue