2026-10-28 23:38:54 +00:00
|
|
|
<script setup lang="ts">
|
|
|
|
|
const props = defineProps<{ villageId: number }>()
|
|
|
|
|
const route = useRoute()
|
|
|
|
|
const base = computed(() => `/village/${props.villageId}`)
|
|
|
|
|
const isActive = (path: string) => route.path === `${base.value}${path}`
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<!-- On phones the village's screens sit in a bar at the bottom, in thumb reach. -->
|
|
|
|
|
<template>
|
|
|
|
|
<nav
|
2026-10-29 00:26:08 +00:00
|
|
|
class="fixed inset-x-0 bottom-0 z-40 grid grid-cols-5 border-t-2 border-wood-950 bg-wood-900 pb-[env(safe-area-inset-bottom)] md:hidden"
|
2026-10-28 23:38:54 +00:00
|
|
|
:aria-label="$t('village.screens.label')"
|
|
|
|
|
>
|
|
|
|
|
<NuxtLink
|
|
|
|
|
v-for="s in VILLAGE_SCREENS"
|
|
|
|
|
:key="s.name"
|
|
|
|
|
:to="`${base}${s.path}`"
|
2026-10-29 13:09:03 +00:00
|
|
|
class="flex flex-col items-center gap-0.5 px-1 py-1 text-xs leading-tight font-semibold"
|
2026-10-28 23:38:54 +00:00
|
|
|
:class="isActive(s.path) ? 'bg-wood-800 text-gold-400' : 'text-parchment-200'"
|
|
|
|
|
:aria-current="isActive(s.path) ? 'page' : undefined"
|
|
|
|
|
>
|
|
|
|
|
<IconBuilding :type="s.icon" class="size-5" />
|
|
|
|
|
<span class="w-full truncate text-center">{{ $t(`village.screens.short.${s.name}`) }}</span>
|
|
|
|
|
</NuxtLink>
|
|
|
|
|
</nav>
|
|
|
|
|
</template>
|