style: medieval shell, panels and pages in flat colours
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
55daa09066
commit
5138bdde27
46
app/app.vue
46
app/app.vue
|
|
@ -7,17 +7,17 @@ const currentWorld = useState<number | null>('world.current', () => null)
|
|||
|
||||
const connection = computed(() =>
|
||||
isMockServer
|
||||
? { text: t('app.mock'), tone: 'bg-amber-100 text-amber-800' }
|
||||
? { text: t('app.mock'), tone: 'badge-gold' }
|
||||
: ws.is_opened.value
|
||||
? { text: t('app.connected'), tone: 'bg-emerald-100 text-emerald-800' }
|
||||
: { text: t('app.offline'), tone: 'bg-rose-100 text-rose-800' },
|
||||
? { text: t('app.connected'), tone: 'badge-moss' }
|
||||
: { text: t('app.offline'), tone: 'badge-blood' },
|
||||
)
|
||||
|
||||
const toastTone = {
|
||||
success: 'border-emerald-200 bg-emerald-50 text-emerald-900',
|
||||
error: 'border-rose-200 bg-rose-50 text-rose-900',
|
||||
warning: 'border-amber-200 bg-amber-50 text-amber-900',
|
||||
info: 'border-parchment-300 bg-white text-ink-900',
|
||||
success: 'border-moss-700 bg-parchment-50 text-moss-700',
|
||||
error: 'border-blood-700 bg-[#f0d6c8] text-blood-800',
|
||||
warning: 'border-gold-600 bg-parchment-50 text-wood-900',
|
||||
info: 'border-wood-700 bg-parchment-50 text-ink-900',
|
||||
}
|
||||
|
||||
useHead({ title: () => t('app.title') })
|
||||
|
|
@ -25,21 +25,24 @@ useHead({ title: () => t('app.title') })
|
|||
|
||||
<template>
|
||||
<div class="min-h-dvh">
|
||||
<header class="border-b border-parchment-300/70 bg-parchment-50/90">
|
||||
<div class="flex items-center gap-2 px-4 py-2.5 sm:gap-3 sm:px-6">
|
||||
<!-- A dark wooden bar, like a tavern sign board. -->
|
||||
<header class="border-b-4 border-wood-950 bg-wood-900 text-parchment-100">
|
||||
<div class="flex items-center gap-2 px-4 py-2 sm:gap-3 sm:px-6">
|
||||
<NuxtLink to="/" class="flex min-w-0 items-center gap-2">
|
||||
<span class="grid size-8 shrink-0 place-items-center rounded-lg bg-amber-700 text-amber-50 shadow-sm">
|
||||
<span class="grid size-8 shrink-0 place-items-center rounded-sm border border-gold-600 bg-blood-700 text-gold-400">
|
||||
<IconBuilding type="headquarters" class="size-5" />
|
||||
</span>
|
||||
<span class="hidden font-display text-lg font-semibold sm:inline">{{ t('app.title') }}</span>
|
||||
<span class="hidden font-display text-lg font-semibold text-gold-400 sm:inline" style="font-variant: small-caps">
|
||||
{{ t('app.title') }}
|
||||
</span>
|
||||
</NuxtLink>
|
||||
|
||||
<nav v-if="user" class="ml-1 flex items-center gap-1">
|
||||
<NuxtLink to="/worlds" class="btn btn-ghost" active-class="bg-parchment-200/70">
|
||||
<NuxtLink to="/worlds" class="nav-link" active-class="nav-link-active">
|
||||
<IconUi name="globe" class="size-4" />
|
||||
{{ t('app.worlds') }}
|
||||
</NuxtLink>
|
||||
<NuxtLink v-if="currentWorld" :to="`/map/${currentWorld}`" class="btn btn-ghost" active-class="bg-parchment-200/70">
|
||||
<NuxtLink v-if="currentWorld" :to="`/map/${currentWorld}`" class="nav-link" active-class="nav-link-active">
|
||||
<IconUi name="pin" class="size-4" />
|
||||
{{ t('app.map') }}
|
||||
</NuxtLink>
|
||||
|
|
@ -52,8 +55,8 @@ useHead({ title: () => t('app.title') })
|
|||
{{ connection.text }}
|
||||
</span>
|
||||
<template v-if="user">
|
||||
<span class="hidden truncate text-sm text-ink-500 md:inline">{{ user.name }}</span>
|
||||
<button type="button" class="btn btn-ghost px-2" :title="t('app.logout')" @click="logout()">
|
||||
<span class="hidden truncate text-sm text-parchment-300 md:inline">{{ user.name }}</span>
|
||||
<button type="button" class="nav-link px-2" :title="t('app.logout')" @click="logout()">
|
||||
<IconUi name="logout" class="size-4" />
|
||||
<span class="hidden sm:inline">{{ t('app.logout') }}</span>
|
||||
</button>
|
||||
|
|
@ -77,7 +80,7 @@ useHead({ title: () => t('app.title') })
|
|||
v-for="n in notices.list.value"
|
||||
:key="n.id"
|
||||
type="button"
|
||||
class="pointer-events-auto w-full max-w-sm rounded-lg border px-3 py-2 text-left text-sm shadow-md"
|
||||
class="pointer-events-auto w-full max-w-sm rounded-sm border-2 px-3 py-2 text-left text-sm shadow-hard"
|
||||
:class="toastTone[n.type]"
|
||||
@click="notices.dismiss(n.id)"
|
||||
>
|
||||
|
|
@ -87,3 +90,14 @@ useHead({ title: () => t('app.title') })
|
|||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
@reference "~/assets/css/main.css";
|
||||
|
||||
.nav-link {
|
||||
@apply inline-flex items-center gap-1.5 rounded-sm border border-transparent px-3 py-1.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;
|
||||
}
|
||||
.nav-link-active {
|
||||
@apply border-gold-600 bg-wood-800 text-gold-400;
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ defineProps<{ type: BuildingType }>()
|
|||
|
||||
<!-- The building glyph on its coloured square, for lists and the queue. -->
|
||||
<template>
|
||||
<span class="grid shrink-0 place-items-center rounded-lg border" :style="buildingTileStyle(type)">
|
||||
<span class="grid shrink-0 place-items-center rounded-sm border-2" :style="buildingTileStyle(type)">
|
||||
<IconBuilding :type="type" class="size-[60%]" />
|
||||
</span>
|
||||
</template>
|
||||
|
|
|
|||
|
|
@ -7,11 +7,11 @@ defineProps<{ title: string }>()
|
|||
<div class="flex min-h-[calc(100dvh-3.5rem)] items-center justify-center px-4 py-10">
|
||||
<div class="w-full max-w-sm">
|
||||
<div class="mb-6 flex flex-col items-center gap-3 text-center">
|
||||
<span class="grid size-14 place-items-center rounded-2xl bg-amber-700 text-amber-50 shadow-md">
|
||||
<span class="grid size-14 place-items-center rounded-sm border-2 border-gold-600 bg-blood-700 text-gold-400 shadow-hard">
|
||||
<IconBuilding type="headquarters" class="size-8" />
|
||||
</span>
|
||||
<div>
|
||||
<h1 class="font-display text-2xl font-semibold">{{ title }}</h1>
|
||||
<h1 class="font-display text-2xl font-semibold text-wood-900" style="font-variant: small-caps">{{ title }}</h1>
|
||||
<p class="mt-1 text-sm text-ink-500">{{ $t('auth.tagline') }}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,21 +1,22 @@
|
|||
<script setup lang="ts">
|
||||
// Tone names stay generic; they map onto the medieval palette.
|
||||
const props = withDefaults(defineProps<{ value: number; tone?: 'amber' | 'emerald' | 'rose' | 'sky' }>(), {
|
||||
tone: 'amber',
|
||||
})
|
||||
|
||||
const fill = {
|
||||
amber: 'bg-amber-500',
|
||||
emerald: 'bg-emerald-500',
|
||||
rose: 'bg-rose-500',
|
||||
sky: 'bg-sky-500',
|
||||
amber: 'bg-gold-500',
|
||||
emerald: 'bg-moss-600',
|
||||
rose: 'bg-blood-700',
|
||||
sky: 'bg-iron-600',
|
||||
}
|
||||
|
||||
const width = computed(() => `${Math.round(Math.min(1, Math.max(0, props.value)) * 100)}%`)
|
||||
</script>
|
||||
|
||||
<!-- A thin fill bar, 0..1. -->
|
||||
<!-- A flat fill bar, 0..1, framed like a wooden gauge. -->
|
||||
<template>
|
||||
<div class="h-1.5 w-full overflow-hidden rounded-full bg-parchment-200">
|
||||
<div class="h-full rounded-full transition-[width] duration-300" :class="fill[tone]" :style="{ width }" />
|
||||
<div class="h-2 w-full overflow-hidden rounded-[2px] border border-wood-700/60 bg-parchment-200">
|
||||
<div class="h-full transition-[width] duration-300" :class="fill[tone]" :style="{ width }" />
|
||||
</div>
|
||||
</template>
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ const list = ['wood', 'clay', 'iron'] as const
|
|||
v-for="r in list"
|
||||
:key="r"
|
||||
class="inline-flex items-center gap-1"
|
||||
:class="have && have[r] < cost[r] ? 'font-semibold text-rose-700' : 'text-ink-700'"
|
||||
:class="have && have[r] < cost[r] ? 'font-semibold text-blood-700' : 'text-ink-700'"
|
||||
:title="$t(`resources.${r}`)"
|
||||
>
|
||||
<IconResource :resource="r" class="size-4" />
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ function status(o: BuildOption) {
|
|||
<section class="panel">
|
||||
<div class="panel-head">
|
||||
<h2 class="panel-title">{{ $t('village.build.title') }}</h2>
|
||||
<span class="badge bg-parchment-200 text-ink-700">
|
||||
<span class="badge badge-plain">
|
||||
{{ $t('village.build.free_space', { free: space.max - space.used }) }}
|
||||
</span>
|
||||
</div>
|
||||
|
|
@ -30,7 +30,7 @@ function status(o: BuildOption) {
|
|||
<article
|
||||
v-for="o in options"
|
||||
:key="o.type"
|
||||
class="flex flex-col gap-2.5 rounded-lg bg-parchment-50 p-3 ring-1 ring-parchment-200"
|
||||
class="flex flex-col gap-2.5 rounded-sm border-2 border-parchment-300 bg-parchment-100 p-3"
|
||||
:class="o.blocked ? 'opacity-60' : ''"
|
||||
>
|
||||
<div class="flex items-center gap-2.5">
|
||||
|
|
@ -50,7 +50,7 @@ function status(o: BuildOption) {
|
|||
</div>
|
||||
<UiCost :cost="o.cost" :have="resources" />
|
||||
<div class="mt-auto flex items-center justify-between gap-2">
|
||||
<span class="text-xs text-rose-700">{{ status(o) }}</span>
|
||||
<span class="text-xs font-semibold text-blood-700">{{ status(o) }}</span>
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-primary"
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ function progress(o: BuildOrder) {
|
|||
<section class="panel">
|
||||
<div class="panel-head">
|
||||
<h2 class="panel-title">{{ $t('village.queue.title') }}</h2>
|
||||
<span class="badge bg-parchment-200 text-ink-700">
|
||||
<span class="badge badge-plain">
|
||||
<IconUi name="hammer" class="size-3.5" />
|
||||
{{ $t('village.queue.builders', { count: builders }) }}
|
||||
</span>
|
||||
|
|
@ -41,8 +41,8 @@ function progress(o: BuildOrder) {
|
|||
<li
|
||||
v-for="o in queue"
|
||||
:key="o.id"
|
||||
class="rounded-lg p-3 ring-1"
|
||||
:class="o.finishes_at ? 'bg-white ring-amber-200' : 'bg-parchment-50 ring-parchment-200'"
|
||||
class="rounded-sm border-2 p-3"
|
||||
:class="o.finishes_at ? 'border-gold-600 bg-parchment-50' : 'border-parchment-300 bg-parchment-100'"
|
||||
>
|
||||
<div class="flex items-center gap-2.5">
|
||||
<IconBuildingTile :type="o.type" class="size-9" />
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ const demolishTitle = (b: Building) =>
|
|||
<section class="panel">
|
||||
<div class="panel-head">
|
||||
<h2 class="panel-title">{{ $t('village.buildings.title') }}</h2>
|
||||
<span class="badge bg-parchment-200 text-ink-700">{{ buildings.length }}</span>
|
||||
<span class="badge badge-plain">{{ buildings.length }}</span>
|
||||
</div>
|
||||
<ul class="divide-y divide-parchment-200">
|
||||
<li
|
||||
|
|
@ -36,7 +36,7 @@ const demolishTitle = (b: Building) =>
|
|||
<div class="min-w-0">
|
||||
<button
|
||||
type="button"
|
||||
class="block max-w-full truncate text-left font-medium hover:text-amber-800 hover:underline"
|
||||
class="block max-w-full truncate text-left font-medium hover:text-blood-700 hover:underline"
|
||||
:title="$t('village.buildings.show')"
|
||||
@click="emit('select', b.id)"
|
||||
>
|
||||
|
|
@ -65,7 +65,7 @@ const demolishTitle = (b: Building) =>
|
|||
</div>
|
||||
<div class="min-w-0">
|
||||
<p class="text-xs text-ink-500">{{ $t('village.buildings.priority') }}</p>
|
||||
<div class="mt-0.5 inline-flex items-center rounded-lg ring-1 ring-parchment-300">
|
||||
<div class="mt-0.5 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"
|
||||
|
|
|
|||
|
|
@ -19,14 +19,14 @@ const stats = computed(() => [
|
|||
</div>
|
||||
<div class="panel-body space-y-4">
|
||||
<div class="grid grid-cols-2 gap-3">
|
||||
<div class="rounded-lg bg-parchment-50 p-3 ring-1 ring-parchment-200">
|
||||
<div class="rounded-sm border-2 border-parchment-300 bg-parchment-100 p-3">
|
||||
<p class="text-xs text-ink-500">{{ $t('village.population.food_budget') }}</p>
|
||||
<p class="mt-0.5 flex items-center gap-1 font-semibold tabular-nums">
|
||||
<IconResource resource="food" class="size-4" />
|
||||
{{ $t('village.population.food_per_hour', { value: population.food_budget }) }}
|
||||
</p>
|
||||
</div>
|
||||
<div class="rounded-lg bg-parchment-50 p-3 ring-1 ring-parchment-200">
|
||||
<div class="rounded-sm border-2 border-parchment-300 bg-parchment-100 p-3">
|
||||
<p class="text-xs text-ink-500">{{ $t('village.population.upkeep') }}</p>
|
||||
<p class="mt-0.5 flex items-center gap-1 font-semibold tabular-nums">
|
||||
<IconResource resource="food" class="size-4" />
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ const list: Resource[] = ['wood', 'clay', 'iron', 'food']
|
|||
|
||||
<!-- Projected stock per resource, its rate, and how full storage is. -->
|
||||
<template>
|
||||
<div class="border-b border-parchment-300/70 bg-parchment-50/95 shadow-sm backdrop-blur">
|
||||
<div class="border-b-2 border-wood-700 bg-parchment-200">
|
||||
<div class="grid grid-cols-4 gap-x-3 px-4 py-2 sm:px-6 sm:grid-cols-[repeat(4,minmax(0,1fr))_auto] sm:gap-x-5">
|
||||
<div
|
||||
v-for="r in list"
|
||||
|
|
@ -26,7 +26,7 @@ const list: Resource[] = ['wood', 'clay', 'iron', 'food']
|
|||
</span>
|
||||
<span
|
||||
class="text-[11px] tabular-nums sm:text-xs"
|
||||
:class="village.rates[r] < 0 ? 'text-rose-700' : village.rates[r] > 0 ? 'text-emerald-700' : 'text-ink-400'"
|
||||
:class="village.rates[r] < 0 ? 'text-blood-700' : village.rates[r] > 0 ? 'text-moss-700' : 'text-ink-400'"
|
||||
>
|
||||
{{ $t('village.resources.per_hour', { rate: formatRate(village.rates[r]) }) }}
|
||||
</span>
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ async function submit() {
|
|||
|
||||
<template>
|
||||
<UiAuthCard :title="$t('auth.login.title')">
|
||||
<p v-if="mock" class="mb-4 rounded-lg bg-amber-50 px-3 py-2 text-xs text-amber-800">{{ $t('auth.mock_hint') }}</p>
|
||||
<p v-if="mock" class="mb-4 rounded-sm border border-gold-600 bg-parchment-200 px-3 py-2 text-xs text-wood-900">{{ $t('auth.mock_hint') }}</p>
|
||||
<form class="space-y-4" @submit.prevent="submit">
|
||||
<label class="block">
|
||||
<span class="label">{{ $t('auth.email') }}</span>
|
||||
|
|
@ -38,7 +38,7 @@ async function submit() {
|
|||
<button type="submit" class="btn btn-primary w-full py-2" :disabled="busy">{{ $t('auth.login.submit') }}</button>
|
||||
</form>
|
||||
<template #footer>
|
||||
<NuxtLink to="/register" class="font-medium text-amber-800 hover:underline">{{ $t('auth.login.to_register') }}</NuxtLink>
|
||||
<NuxtLink to="/register" class="font-semibold text-blood-700 hover:underline">{{ $t('auth.login.to_register') }}</NuxtLink>
|
||||
</template>
|
||||
</UiAuthCard>
|
||||
</template>
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ async function submit() {
|
|||
|
||||
<template>
|
||||
<UiAuthCard :title="$t('auth.register.title')">
|
||||
<p v-if="mock" class="mb-4 rounded-lg bg-amber-50 px-3 py-2 text-xs text-amber-800">{{ $t('auth.mock_hint') }}</p>
|
||||
<p v-if="mock" class="mb-4 rounded-sm border border-gold-600 bg-parchment-200 px-3 py-2 text-xs text-wood-900">{{ $t('auth.mock_hint') }}</p>
|
||||
<form class="space-y-4" @submit.prevent="submit">
|
||||
<label class="block">
|
||||
<span class="label">{{ $t('auth.name') }}</span>
|
||||
|
|
@ -43,7 +43,7 @@ async function submit() {
|
|||
<button type="submit" class="btn btn-primary w-full py-2" :disabled="busy">{{ $t('auth.register.submit') }}</button>
|
||||
</form>
|
||||
<template #footer>
|
||||
<NuxtLink to="/login" class="font-medium text-amber-800 hover:underline">{{ $t('auth.register.to_login') }}</NuxtLink>
|
||||
<NuxtLink to="/login" class="font-semibold text-blood-700 hover:underline">{{ $t('auth.register.to_login') }}</NuxtLink>
|
||||
</template>
|
||||
</UiAuthCard>
|
||||
</template>
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ async function resetMock() {
|
|||
<template>
|
||||
<div class="mx-auto max-w-2xl px-4 py-10">
|
||||
<header class="mb-6">
|
||||
<h1 class="font-display text-3xl font-semibold">{{ $t('worlds.title') }}</h1>
|
||||
<h1 class="font-display text-3xl font-semibold text-wood-900" style="font-variant: small-caps">{{ $t('worlds.title') }}</h1>
|
||||
<p class="mt-1 text-ink-500">{{ $t('worlds.subtitle') }}</p>
|
||||
</header>
|
||||
|
||||
|
|
@ -27,16 +27,16 @@ async function resetMock() {
|
|||
<div class="panel overflow-hidden">
|
||||
<p v-if="!worlds" class="px-4 py-8 text-center text-sm text-ink-500">{{ $t('common.loading') }}</p>
|
||||
<p v-else-if="!worlds.length" class="px-4 py-8 text-center text-sm text-ink-500">{{ $t('worlds.none') }}</p>
|
||||
<ul v-else class="divide-y divide-parchment-200">
|
||||
<ul v-else class="divide-y-2 divide-parchment-200">
|
||||
<li v-for="w in worlds" :key="w.id" class="flex items-center gap-4 px-4 py-4">
|
||||
<span class="grid size-11 shrink-0 place-items-center rounded-xl bg-sky-50 text-sky-700 ring-1 ring-sky-200">
|
||||
<span class="grid size-11 shrink-0 place-items-center rounded-sm border-2 border-wood-700 bg-moss-600 text-parchment-50">
|
||||
<IconUi name="globe" class="size-6" />
|
||||
</span>
|
||||
<div class="min-w-0 flex-1">
|
||||
<p class="truncate font-medium">{{ w.name }}</p>
|
||||
<p class="truncate font-display text-lg font-semibold text-wood-900">{{ w.name }}</p>
|
||||
<p class="mt-0.5 flex flex-wrap gap-1.5">
|
||||
<span class="badge bg-parchment-200 text-ink-700">{{ $t('worlds.speed_value', { speed: w.speed }) }}</span>
|
||||
<span v-if="w.village_id" class="badge bg-emerald-100 text-emerald-800">{{ $t('worlds.joined') }}</span>
|
||||
<span class="badge badge-plain">{{ $t('worlds.speed_value', { speed: w.speed }) }}</span>
|
||||
<span v-if="w.village_id" class="badge badge-moss">{{ $t('worlds.joined') }}</span>
|
||||
</p>
|
||||
</div>
|
||||
<button
|
||||
|
|
|
|||
|
|
@ -1,16 +1,16 @@
|
|||
import type { BuildingType } from '~/types/game'
|
||||
|
||||
/** Tile colours per building type: a soft fill and a darker line for border and glyph. */
|
||||
/** Icon tile colours per building type, flat and muted: a parchment-toned fill and a dark line for border and glyph. */
|
||||
export const BUILDING_COLORS: Record<BuildingType, { fill: string; line: string }> = {
|
||||
headquarters: { fill: '#f6e3bf', line: '#a8661b' },
|
||||
storage: { fill: '#ece0cb', line: '#80603f' },
|
||||
farm: { fill: '#eef2cf', line: '#76892a' },
|
||||
timber_camp: { fill: '#dfecd5', line: '#3f7a37' },
|
||||
clay_pit: { fill: '#f6dccd', line: '#b0502a' },
|
||||
iron_mine: { fill: '#e3e7ed', line: '#55606f' },
|
||||
hiding_place: { fill: '#ebe3f2', line: '#6e5390' },
|
||||
wall: { fill: '#e7e3dc', line: '#6a6257' },
|
||||
rally_point: { fill: '#f6dfdf', line: '#a63a3a' },
|
||||
headquarters: { fill: '#e6c98f', line: '#6e3a12' },
|
||||
storage: { fill: '#dcc497', line: '#57391f' },
|
||||
farm: { fill: '#d9cf8c', line: '#556b1e' },
|
||||
timber_camp: { fill: '#c9cf9a', line: '#3d5a26' },
|
||||
clay_pit: { fill: '#e2b897', line: '#7b2e16' },
|
||||
iron_mine: { fill: '#c8c6bd', line: '#43484c' },
|
||||
hiding_place: { fill: '#d4c2a8', line: '#4b3622' },
|
||||
wall: { fill: '#cfc7b6', line: '#4f4a42' },
|
||||
rally_point: { fill: '#e2b8a6', line: '#7b1e16' },
|
||||
}
|
||||
|
||||
export const buildingTileStyle = (type: BuildingType) => ({
|
||||
|
|
|
|||
Loading…
Reference in New Issue