Polarcraft/webv2/pages/index.vue

44 lines
1.2 KiB
Vue
Raw Normal View History

2023-06-04 22:47:48 +02:00
<template>
<div>
2023-06-12 16:48:38 +02:00
<div class="mb-10 flex">
<UAvatarGroup size="xl" class="mr-5">
<UAvatar :src="discordAvatarUrl" alt="Discord Avatar" placeholder="DC" />
<UAvatar v-if="minecraftAvatarUrl" :src="minecraftAvatarUrl" alt="Minecraft Avatar" placeholder="MC" />
</UAvatarGroup>
<h2>
<span class="text-xl">
Welkom, <b>{{ user.username }}</b>
</span>
<p class="text-gray-400">
Happy to see you again
</p>
</h2>
</div>
<div class="grid w-full grid-cols-12 gap-6">
<div class="col-span-6 rounded-lg border border-gray-700 bg-gray-800 p-5">
Placeholder
</div>
2023-06-12 15:56:09 +02:00
</div>
2023-06-04 22:47:48 +02:00
</div>
</template>
<script lang="ts" setup>
definePageMeta({
2023-06-12 15:56:09 +02:00
middleware: ['auth'],
title: 'Dashboard | Polarcraft'
2023-06-04 22:47:48 +02:00
})
2023-06-12 16:48:38 +02:00
const user = useState<IUser>('user')
const discordAvatarUrl = computed(() => {
return 'https://cdn.discordapp.com/avatars/' + user.value.discord.id + '/' + user.value.discord.avatarHash + '.png'
})
const minecraftAvatarUrl = computed(() => {
if (!user.value.minecraft) {
return ''
}
return 'https://api.mineatar.io/face/' + user.value.minecraft.uuid + '?scale=16'
})
2023-06-04 22:47:48 +02:00
</script>