docs/.vitepress/theme/components/Authors.vue

21a62f4ea39d79afc6fe7efc9effab0c52d40de9
wotaku/docs/.vitepress/theme/components/Authors.vue

73 lines · 1744 bytes

 1<!--
 2  All Rights Reserved
 3
 4  Copyright (c) 2025 taskylizard
 5
 6  All rights reserved. This code and its associated files may not be copied, modified, distributed, sublicensed, or used in any form, in whole or in part, without prior written permission from the copyright holder.
 7-->
 8<script setup lang="ts">
 9import { computed } from 'vue'
10
11const props = defineProps<{
12  page: string
13}>()
14
15interface CreditsInfo {
16  [key: string]: {
17    name: string
18    avatar: string
19    // Optional.
20    site?: string
21  }[]
22}
23
24const credits = {
25  imagedit: [
26    {
27      name: 'Oakminati',
28      site: 'https://nyaa.si/user/Oakminati',
29      avatar: '/pfp/oak.png'
30    },
31    {
32      name: 'XRA-Empire',
33      site: 'https://nyaa.si/?f=0&c=3_1&q=xra',
34      avatar: '/pfp/xra.png'
35    }
36  ],
37
38  audiog: [
39    {
40      name: 'DenpaEater',
41      site: 'https://impedance.bearblog.dev/',
42      avatar: 'https://i.wotaku.wiki/f/Denpa.png'
43    }
44  ],
45  discrip: [
46    {
47      name: 'nullishcat',
48      site: 'https://nullish.cat/',
49      avatar: 'https://github.com/nullish-cat.png'
50    }
51  ],
52  fate: [
53    {
54      name: 'Archziac',
55      site: 'https://www.behance.net/archziac',
56      avatar: 'https://github.com/archziac.png'
57    }
58  ]
59} satisfies CreditsInfo
60
61const Credits = computed(() => credits[props.page] || ([] as CreditsInfo[]))
62</script>
63<template>
64  <div class="flex flex-wrap gap-4 pt-2">
65    <span class="text-lg font-medium">By</span>
66    <div v-for="(c, index) of Credits" class="flex items-center gap-2">
67      <img :src="c.avatar" class="h-8 w-8 rounded-full" />
68      <a v-if="c.site" :href="c.site">{{ c.name }}</a>
69      <span v-else>{{ c.name }}</span>
70      <span v-if="index < Credits.length - 1">•</span>
71    </div>
72  </div>
73</template>