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

d80beea3ff9e761c2f6fd6092bd660d37d9e5bdf
wotaku/docs/.vitepress/theme/components/Authors.vue history · blame · raw

81 lines · 2023 bytes

 1<!--
 2  Copyright (c) 2024 taskylizard
 3
 4  Licensed under the Apache License, Version 2.0 (the "License");
 5  you may not use this file except in compliance with the License.
 6  You may obtain a copy of the License at
 7
 8  http://www.apache.org/licenses/LICENSE-2.0
 9
10  Unless required by applicable law or agreed to in writing, software
11  distributed under the License is distributed on an "AS IS" BASIS,
12  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  See the License for the specific language governing permissions and
14  limitations under the License.
15-->
16<script setup lang="ts">
17import { computed } from 'vue'
18
19const props = defineProps<{
20  page: string
21}>()
22
23interface CreditsInfo {
24  [key: string]: {
25    name: string
26    avatar: string
27    // Optional.
28    site?: string
29  }[]
30}
31
32const credits = {
33  imagedit: [
34    {
35      name: 'Oakminati',
36      site: 'https://nyaa.si/user/Oakminati',
37      avatar: '/pfp/oak.png'
38    },
39    {
40      name: 'XRA-Empire',
41      site: 'https://nyaa.si/?f=0&c=3_1&q=xra',
42      avatar: '/pfp/xra.png'
43    }
44  ],
45
46  audiog: [
47    {
48      name: 'DenpaEater',
49      site: 'https://x.com/shibayanfanclub',
50      avatar: '/pfp/denpa.jpg'
51    }
52  ],
53  discrip: [
54    {
55      name: 'nullishcat',
56      site: 'https://nullish.cat/',
57      avatar: 'https://github.com/nullish-cat.png'
58    }
59  ],
60  fate: [
61    {
62      name: 'Archziac',
63      site: 'https://www.behance.net/archziac',
64      avatar: 'https://github.com/archziac.png'
65    }
66  ]
67} satisfies CreditsInfo
68
69const Credits = computed(() => credits[props.page] || ([] as CreditsInfo[]))
70</script>
71<template>
72  <div class="flex flex-wrap gap-4 pt-2">
73    <span class="text-lg font-medium">By</span>
74    <div v-for="(c, index) of Credits" class="flex items-center gap-2">
75      <img :src="c.avatar" class="h-8 w-8 rounded-full" />
76      <a v-if="c.site" :href="c.site">{{ c.name }}</a>
77      <span v-else>{{ c.name }}</span>
78      <span v-if="index < Credits.length - 1">•</span>
79    </div>
80  </div>
81</template>