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

41 lines
1.2 KiB
Vue
Raw Normal View History

<script setup lang="ts">
const { t } = useI18n()
const notices = useNotices()
const toastTone = {
success: 'border-moss-700 bg-parchment-50 text-moss-700',
error: 'border-blood-700 bg-[#f0d6c8] text-blood-800',
warning: 'border-gold-600 bg-parchment-50 text-wood-900',
info: 'border-wood-700 bg-parchment-50 text-ink-900',
}
useHead({ title: () => t('app.title') })
</script>
<!-- Pages pick their frame: `game` inside a world (village, map, reports), `default` outside. -->
<template>
<NuxtLayout>
<NuxtPage />
</NuxtLayout>
<div class="pointer-events-none fixed inset-x-4 bottom-20 z-50 flex flex-col items-end gap-2 md:bottom-4">
<TransitionGroup
enter-from-class="translate-y-2 opacity-0"
leave-to-class="opacity-0"
enter-active-class="transition duration-200"
leave-active-class="transition duration-200"
>
<button
v-for="n in notices.list.value"
:key="n.id"
type="button"
class="pointer-events-auto w-full max-w-sm rounded-sm border-2 px-3 py-2 text-left text-sm shadow-hard"
:class="toastTone[n.type]"
@click="notices.dismiss(n.id)"
>
{{ n.text }}
</button>
</TransitionGroup>
</div>
</template>