game-village-politics-frontend/app/components/icon/Unit.vue

79 lines
2.5 KiB
Vue
Raw Normal View History

<script setup lang="ts">
import type { UnitType } from '~/types/game'
/** `militia` are villagers drafted by a levy, not a trainable unit. */
defineProps<{ unit: UnitType | 'militia' }>()
</script>
<!-- Line glyphs in currentColor, one per unit type. -->
<template>
<svg
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="1.7"
stroke-linecap="round"
stroke-linejoin="round"
aria-hidden="true"
class="shrink-0"
>
<g v-if="unit === 'spear'">
<path d="M4 20L15.5 8.5" />
<path d="M15.5 8.5l1-4.5 3.5-1-1 3.5z" />
<path d="M13 8l3 3" />
</g>
<g v-else-if="unit === 'sword'">
<path d="M20 4L9.5 14.5" />
<path d="M20 4l-4.5.8M20 4l-.8 4.5" />
<path d="M7 12l5 5" />
<path d="M9.5 14.5L5.5 18.5" />
<path d="M4 20l1.5-1.5" />
</g>
<g v-else-if="unit === 'archer'">
<path d="M8 3a14 14 0 0 1 0 18" />
<path d="M8 3v18" />
<path d="M3 12h16" />
<path d="M19 12l-3-2.5M19 12l-3 2.5" />
<path d="M3 12l-1-1.5M3 12l-1 1.5" />
</g>
<g v-else-if="unit === 'light_cavalry'">
<path d="M9 21c0-3-.8-4.8-2.6-5.8L4 13.8l1-3 3.5-2.2L10 4l2 2.6c4.3.8 7 4.4 7 8.6V21" />
<path d="M9.5 10h.01" />
<path d="M13 7.5c1.5.5 2.5 1.6 3 3" />
</g>
<g v-else-if="unit === 'heavy_cavalry'">
<path d="M9 21c0-3-.8-4.8-2.6-5.8L4 13.8l1-3 3.5-2.2L10 4l2 2.6c4.3.8 7 4.4 7 8.6V21" />
<path d="M9.5 10h.01" />
<path d="M6.5 13l5-3.5 2 4.5-6 3" />
<path d="M11 3l1-2 1.5 2" />
</g>
<g v-else-if="unit === 'ram'">
<path d="M5 11l6-5 6 5" />
<path d="M2.5 14h16l2.5 1.5-2.5 1.5h-16z" />
<circle cx="7" cy="19.5" r="1.8" />
<circle cx="15" cy="19.5" r="1.8" />
</g>
<g v-else-if="unit === 'catapult'">
<path d="M3 18h15" />
<path d="M6 18l3-5h4l3 5" />
<path d="M11 13l7-8.5" />
<path d="M16.5 3.2a2.2 2.2 0 1 0 3.1 3.1" />
<circle cx="6" cy="20" r="1.5" />
<circle cx="15" cy="20" r="1.5" />
</g>
<g v-else-if="unit === 'nobleman'">
<circle cx="12" cy="11" r="3.5" />
<path d="M5 21c0-4 3-6.5 7-6.5s7 2.5 7 6.5" />
<path d="M8.5 6.5L9 3.5l1.5 1.5L12 3l1.5 2L15 3.5l.5 3z" />
</g>
<g v-else-if="unit === 'militia'">
<path d="M12 21V9" />
<path d="M7 3v4a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2V3" />
<path d="M12 3v6" />
</g>
<g v-else>
<path d="M12 3l7 3v5c0 5-3 8.5-7 10-4-1.5-7-5-7-10V6z" />
</g>
</svg>
</template>