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

39 lines
2.0 KiB
Vue
Raw Permalink Normal View History

<script setup lang="ts">
import type { Resource } from '~/types/game'
defineProps<{ resource: Resource }>()
</script>
<!-- Small filled glyphs in each resource's own colours. -->
<template>
<svg viewBox="0 0 24 24" aria-hidden="true" class="shrink-0">
<g v-if="resource === 'wood'">
<rect x="2.5" y="12" width="17" height="7" rx="3.5" fill="#9a6232" />
<circle cx="19" cy="15.5" r="3.5" fill="#e7c08f" stroke="#9a6232" stroke-width="1.2" />
<circle cx="19" cy="15.5" r="1.3" fill="none" stroke="#b98450" stroke-width="0.8" />
<rect x="5.5" y="5" width="13" height="7" rx="3.5" fill="#7d4f24" />
<circle cx="18" cy="8.5" r="3.5" fill="#e7c08f" stroke="#7d4f24" stroke-width="1.2" />
<circle cx="18" cy="8.5" r="1.3" fill="none" stroke="#b98450" stroke-width="0.8" />
</g>
<g v-else-if="resource === 'clay'">
<rect x="2" y="13" width="9.5" height="6.5" rx="1" fill="#c25e35" />
<rect x="12.5" y="13" width="9.5" height="6.5" rx="1" fill="#a94d29" />
<rect x="7" y="5.5" width="10" height="6.5" rx="1" fill="#d97a4d" />
<path d="M3 15h7.5M13.5 15H21M8 7.5h8" stroke="#f3b393" stroke-width="0.9" stroke-linecap="round" />
</g>
<g v-else-if="resource === 'iron'">
<path d="M5.5 9h13l3.5 9H2z" fill="#6b7787" />
<path d="M5.5 9h13l-1.6 3.4H7.1z" fill="#aab5c3" />
<path d="M8 14.5h8" stroke="#8d99a8" stroke-width="1" stroke-linecap="round" />
</g>
<g v-else>
<path d="M12 22V7.5" stroke="#9a6a10" stroke-width="1.6" stroke-linecap="round" />
<ellipse cx="12" cy="4.6" rx="1.8" ry="2.8" fill="#e8b10f" />
<ellipse cx="9.3" cy="9.6" rx="1.8" ry="2.8" transform="rotate(-32 9.3 9.6)" fill="#d39b08" />
<ellipse cx="14.7" cy="9.6" rx="1.8" ry="2.8" transform="rotate(32 14.7 9.6)" fill="#d39b08" />
<ellipse cx="9.3" cy="14.4" rx="1.8" ry="2.8" transform="rotate(-32 9.3 14.4)" fill="#c08a06" />
<ellipse cx="14.7" cy="14.4" rx="1.8" ry="2.8" transform="rotate(32 14.7 14.4)" fill="#c08a06" />
</g>
</svg>
</template>