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. -->
|
<!-- Details of the building selected in the diorama, with its actions. -->
|
||||||
<template>
|
<template>
|
||||||
<section class="panel bg-white/95 shadow-lg backdrop-blur" :aria-label="$t(`buildings.${building.type}`)">
|
<section class="panel" :aria-label="$t(`buildings.${building.type}`)">
|
||||||
<div class="flex items-center gap-3 border-b border-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">
|
||||||
<IconBuildingTile :type="building.type" class="size-11" />
|
<IconBuildingTile :type="building.type" class="size-11" />
|
||||||
<div class="min-w-0 flex-1">
|
<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">
|
<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>
|
||||||
|
|
@ -51,7 +51,7 @@ const emit = defineEmits<{
|
||||||
|
|
||||||
<div class="flex items-center justify-between gap-3 text-sm">
|
<div class="flex items-center justify-between gap-3 text-sm">
|
||||||
<span class="text-ink-500">{{ $t('village.buildings.priority') }}</span>
|
<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
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
class="btn btn-ghost rounded-r-none p-1"
|
class="btn btn-ghost rounded-r-none p-1"
|
||||||
|
|
@ -74,7 +74,7 @@ const emit = defineEmits<{
|
||||||
</div>
|
</div>
|
||||||
</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">
|
<div class="flex items-center justify-between gap-2 text-xs text-ink-500">
|
||||||
<UiCost :cost="building.upgrade.cost" :have="resources" />
|
<UiCost :cost="building.upgrade.cost" :have="resources" />
|
||||||
<span class="flex items-center gap-1 tabular-nums">
|
<span class="flex items-center gap-1 tabular-nums">
|
||||||
|
|
|
||||||
|
|
@ -29,23 +29,27 @@ function showInVillage(id: number) {
|
||||||
<div v-if="village && resources">
|
<div v-if="village && resources">
|
||||||
<VillageResourceBar class="sticky top-0 z-30" :village="village" :resources="resources" />
|
<VillageResourceBar class="sticky top-0 z-30" :village="village" :resources="resources" />
|
||||||
|
|
||||||
<section class="relative border-b border-parchment-300/70">
|
<section class="border-b-2 border-wood-700">
|
||||||
<div class="px-4 pt-4 sm:pointer-events-none sm:absolute sm:top-5 sm:left-6 sm:z-10 sm:p-0">
|
<!-- Village header: a flat parchment strip above the land, so nothing covers the view. -->
|
||||||
<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">
|
<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">
|
||||||
<p class="text-xs font-medium tracking-wide text-ink-500 uppercase">{{ $t('village.title') }}</p>
|
<div class="min-w-0">
|
||||||
<h1 class="font-display text-xl font-semibold sm:text-2xl">{{ village.name }}</h1>
|
<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
|
<NuxtLink
|
||||||
:to="{ path: `/map/${village.world_id}`, query: { x: village.x, y: village.y } }"
|
: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"
|
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')"
|
:title="$t('village.on_map')"
|
||||||
>
|
>
|
||||||
<IconUi name="pin" class="size-3.5" />
|
<IconUi name="pin" class="size-3.5" />
|
||||||
<span class="tabular-nums">{{ village.x }}|{{ village.y }} · {{ village.continent }}</span>
|
<span class="font-semibold tabular-nums">{{ village.x }}|{{ village.y }}</span>
|
||||||
<span>· {{ $t('village.points', { points: village.points }) }}</span>
|
<span class="text-ink-500">· {{ village.continent }} · {{ $t('village.points', { points: village.points }) }}</span>
|
||||||
</NuxtLink>
|
</NuxtLink>
|
||||||
<div class="mt-2.5 sm:w-52">
|
<div class="w-full sm:ml-auto sm:w-64">
|
||||||
<div class="mb-1 flex justify-between gap-3 text-xs">
|
<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 text-ink-700">{{ $t('village.diorama.space') }}</span>
|
||||||
<span class="font-semibold tabular-nums">
|
<span class="font-semibold tabular-nums">
|
||||||
{{ $t('village.diorama.space_value', { used: village.space.used, max: village.space.max }) }}
|
{{ $t('village.diorama.space_value', { used: village.space.used, max: village.space.max }) }}
|
||||||
</span>
|
</span>
|
||||||
|
|
@ -53,21 +57,21 @@ function showInVillage(id: number) {
|
||||||
<UiBar :value="spaceShare" :tone="spaceShare >= 1 ? 'rose' : 'emerald'" />
|
<UiBar :value="spaceShare" :tone="spaceShare >= 1 ? 'rose' : 'emerald'" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="h-[clamp(240px,74vw,440px)] sm:h-[clamp(320px,64vh,780px)]">
|
<div class="relative">
|
||||||
|
<div class="h-[clamp(260px,82vw,460px)] sm:h-[clamp(340px,62vh,760px)]">
|
||||||
<VillageDiorama v-model:selected="selected" :village="village" />
|
<VillageDiorama v-model:selected="selected" :village="village" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<p
|
<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"
|
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') }}
|
{{ $t('village.diorama.hint') }}
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<VillageBuildingCard
|
<VillageBuildingCard
|
||||||
v-if="selectedBuilding"
|
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"
|
class="mx-4 my-4 lg:absolute lg:top-4 lg:right-6 lg:z-10 lg:m-0 lg:w-80"
|
||||||
:building="selectedBuilding"
|
:building="selectedBuilding"
|
||||||
:resources="resources"
|
:resources="resources"
|
||||||
:can-afford="v.canAfford"
|
:can-afford="v.canAfford"
|
||||||
|
|
@ -77,6 +81,7 @@ function showInVillage(id: number) {
|
||||||
@priority="v.setPriority"
|
@priority="v.setPriority"
|
||||||
@close="selected = null"
|
@close="selected = null"
|
||||||
/>
|
/>
|
||||||
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<div class="space-y-6 px-4 py-6 sm:px-6">
|
<div class="space-y-6 px-4 py-6 sm:px-6">
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue