game-village-politics-frontend/app/components/village/Walker.vue

29 lines
1.1 KiB
Vue
Raw Normal View History

<script setup lang="ts">
import { scale } from '~/diorama/iso'
const props = defineProps<{
shirt: string
/** What the villager carries on the shoulder, as a colour; none when empty-handed. */
carry?: string | null
}>()
const shirtShade = computed(() => scale(props.shirt, 0.72))
const carryTop = computed(() => (props.carry ? scale(props.carry, 1.15) : ''))
const carryShade = computed(() => (props.carry ? scale(props.carry, 0.7) : ''))
</script>
<!-- A villager in a few flat, shaded panels: legs, a two-tone shirt, head and hair, a load. -->
<template>
<g>
<path d="M-1.5 -2.4h1.2V0h-1.2zM0.3 -2.4h1.2V0h-1.2z" fill="#3a2a1c" />
<path d="M-1.9 -6.9L0 -7.3V-2.2H-1.7z" :fill="shirt" />
<path d="M0 -7.3L1.9 -6.9L1.7 -2.2H0z" :fill="shirtShade" />
<circle cy="-8.9" r="1.65" fill="#d8a982" />
<path d="M-1.7 -9.1Q0 -11.5 1.7 -9.1Q0 -9.9 -1.7 -9.1z" fill="#4a3220" />
<template v-if="carry">
<path d="M0.3 -9.3L3.1 -9.8L4.7 -9L1.9 -8.5z" :fill="carryTop" />
<path d="M0.3 -9.3L1.9 -8.5V-6.9L0.3 -7.7z" :fill="carry" />
<path d="M1.9 -8.5L4.7 -9V-7.4L1.9 -6.9z" :fill="carryShade" />
</template>
</g>
</template>