feat: the world map in the same grim palette: tired grass, dark water and firs, muddy shores, weathered villages

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Fabian @ Blax Software 2026-10-30 10:26:43 +01:00
parent 6ef5c3981e
commit e83076a819
4 changed files with 26 additions and 26 deletions

View File

@ -46,7 +46,7 @@ function onClick(e: MouseEvent) {
:aria-label="t('map.minimap')"
@click="onClick"
>
<rect :width="size.w" :height="size.h" fill="#5f7634" />
<rect :width="size.w" :height="size.h" fill="#4b5033" />
<line
v-for="(l, i) in lines"
:key="i"

View File

@ -9,10 +9,10 @@ const props = defineProps<{ tier: 1 | 2 | 3 | 4 | 5; relation: MapRelation; crow
// faces and a two-facet roof, so it reads as 3D like the village diorama.
const tones = computed(() =>
props.relation === 'barbarian'
? { wallLight: '#d6cfc2', wallDark: '#a99f90', roofLight: '#8e857a', roofDark: '#6c6459' }
: { wallLight: '#e3cfa2', wallDark: '#b49870', roofLight: '#9c4a26', roofDark: '#73321a' },
? { wallLight: '#948e83', wallDark: '#6c675f', roofLight: '#5a544c', roofDark: '#403b35' }
: { wallLight: '#9f8f72', wallDark: '#76684f', roofLight: '#6b3826', roofDark: '#4a2619' },
)
const STONE = { wallLight: '#b9b3a7', wallDark: '#8d877b', roofLight: '#5d636b', roofDark: '#464b52' }
const STONE = { wallLight: '#858078', wallDark: '#5f5b55', roofLight: '#464a50', roofDark: '#33363b' }
const flag = computed(() => ({ own: '#d9b44a', player: '#962a1f', barbarian: '#8b9094' })[props.relation])
interface Block {
@ -91,7 +91,7 @@ const pole = computed(() => {
<template>
<g>
<ellipse cx="50" cy="72" rx="42" ry="18" fill="#5f7531" />
<ellipse cx="50" cy="72" rx="42" ry="18" fill="#463f2e" />
<g v-for="(b, i) in blocks" :key="i">
<polygon :points="faces(b).left" :fill="faces(b).colors.wallDark" />
<polygon :points="faces(b).right" :fill="faces(b).colors.wallLight" />
@ -100,16 +100,16 @@ const pole = computed(() => {
</g>
<!-- A town's palisade or a keep's stone wall along the front of the ring. -->
<g v-if="tier === 4">
<rect v-for="(p, i) in ring" :key="i" :x="p.x - 2" :y="p.y - 9" width="4" height="10" :fill="i % 2 ? '#6a4526' : '#8a5f38'" />
<rect v-for="(p, i) in ring" :key="i" :x="p.x - 2" :y="p.y - 9" width="4" height="10" :fill="i % 2 ? '#3f3127' : '#5f4b38'" />
</g>
<g v-else-if="tier === 5">
<polygon
v-for="(p, i) in ring.slice(0, -1)"
:key="i"
:points="pts(p.x, p.y, ring[i + 1]!.x, ring[i + 1]!.y, ring[i + 1]!.x, ring[i + 1]!.y - 10, p.x, p.y - 10)"
:fill="i % 2 ? '#8d877b' : '#a39d92'"
:fill="i % 2 ? '#5f5b55' : '#77736b'"
/>
<rect v-for="i in [0, 7, 14]" :key="`t${i}`" :x="ring[i]!.x - 4" :y="ring[i]!.y - 16" width="8" height="16" fill="#847e74" />
<rect v-for="i in [0, 7, 14]" :key="`t${i}`" :x="ring[i]!.x - 4" :y="ring[i]!.y - 16" width="8" height="16" fill="#5a5751" />
</g>
<line :x1="pole.x" :y1="pole.y" :x2="pole.x" :y2="pole.y - 20" stroke="#4a3b2e" stroke-width="2" />
<polygon :points="pts(pole.x, pole.y - 20, pole.x + 15, pole.y - 15, pole.x, pole.y - 10)" :fill="flag" stroke="#2b2118" stroke-width="0.8" />

View File

@ -40,8 +40,8 @@ const hash = (x: number, y: number) => {
h = Math.imul(h ^ (h >>> 13), 1274126177)
return ((h ^ (h >>> 16)) >>> 0) / 4294967296
}
const GRASS = ['#7f9645', '#78903f', '#86994b', '#73893c']
const WATER = '#5f7f87'
const GRASS = ['#535838', '#4f5435', '#575a3b', '#5a573a']
const WATER = '#2f3b3c'
/** Smooth value noise: neighbouring fields get similar values, so terrain comes in patches. */
const smooth = (t: number) => t * t * (3 - 2 * t)
@ -238,7 +238,7 @@ function onKey(e: KeyboardEvent) {
</clipPath>
</defs>
<rect :width="width" :height="height" fill="#4f6129" />
<rect :width="width" :height="height" fill="#3d4228" />
<g clip-path="url(#map-fields)">
<!-- Fields sit at their world position; panning only moves this group. -->
@ -248,24 +248,24 @@ function onKey(e: KeyboardEvent) {
<g v-if="f.ground !== 'grass'" :transform="`translate(${f.x * field} ${f.y * field}) scale(${field / 100})`">
<template v-if="f.shore">
<!-- Sandy shore where the lake meets land, and a ripple. -->
<rect v-if="f.shore.top" x="0" y="0" width="100" height="9" fill="#b8a173" />
<rect v-if="f.shore.bottom" x="0" y="91" width="100" height="9" fill="#b8a173" />
<rect v-if="f.shore.left" x="0" y="0" width="9" height="100" fill="#b8a173" />
<rect v-if="f.shore.right" x="91" y="0" width="9" height="100" fill="#b8a173" />
<path :d="`M${28 + hash(f.x, f.y) * 30} 50h18M${40 + hash(f.y, f.x) * 20} 64h12`" stroke="#7e9da3" stroke-width="3" stroke-linecap="round" />
<rect v-if="f.shore.top" x="0" y="0" width="100" height="9" fill="#5a4c38" />
<rect v-if="f.shore.bottom" x="0" y="91" width="100" height="9" fill="#5a4c38" />
<rect v-if="f.shore.left" x="0" y="0" width="9" height="100" fill="#5a4c38" />
<rect v-if="f.shore.right" x="91" y="0" width="9" height="100" fill="#5a4c38" />
<path :d="`M${28 + hash(f.x, f.y) * 30} 50h18M${40 + hash(f.y, f.x) * 20} 64h12`" stroke="#45545a" stroke-width="3" stroke-linecap="round" />
</template>
<g v-else-if="f.ground === 'hill'">
<ellipse cx="52" cy="70" rx="40" ry="16" fill="#6f7f3d" />
<polygon points="18,72 40,30 58,72" fill="#8d877b" />
<polygon points="40,30 58,72 64,60" fill="#6f6a60" />
<polygon points="48,74 68,42 86,74" fill="#a39d92" />
<polygon points="68,42 86,74 90,66" fill="#7c776a" />
<ellipse cx="52" cy="70" rx="40" ry="16" fill="#464a31" />
<polygon points="18,72 40,30 58,72" fill="#6b675f" />
<polygon points="40,30 58,72 64,60" fill="#46443f" />
<polygon points="48,74 68,42 86,74" fill="#7a766e" />
<polygon points="68,42 86,74 90,66" fill="#504d47" />
</g>
<g v-for="(tr, i) in f.trees" :key="i" :transform="`translate(${tr[0]} ${tr[1]}) scale(${tr[2]})`">
<ellipse cx="4" cy="26" rx="12" ry="4" fill="#5f7531" />
<rect x="-2" y="18" width="4" height="9" fill="#57391f" />
<polygon points="0,-10 -13,20 0,16" fill="#2f5222" />
<polygon points="0,-10 13,20 0,16" fill="#46702f" />
<ellipse cx="4" cy="26" rx="12" ry="4" fill="#3c4128" />
<rect x="-2" y="18" width="4" height="9" fill="#352a21" />
<polygon points="0,-10 -13,20 0,16" fill="#1d271b" />
<polygon points="0,-10 13,20 0,16" fill="#2c3925" />
</g>
</g>
</g>

View File

@ -201,7 +201,7 @@ const continent = computed(() => (rounded.value ? continentOf(rounded.value.x, r
:style="staged ? { top: `${stage!.menuBottom.value}px` } : undefined"
>
<!-- A dark wooden frame around the map on a page; edge to edge on the stage. -->
<div class="h-full overflow-hidden bg-[#4f6129]" :class="staged ? '' : 'border-2 border-wood-900'">
<div class="h-full overflow-hidden bg-[#3d4228]" :class="staged ? '' : 'border-2 border-wood-900'">
<MapWorldMap
v-if="visible"
:view="view"