docs/.vitepress/theme/components/Contributors.vue

fabbc73f44fa8a9ed8d745b70c2681e7a9f4df4e
wotaku/docs/.vitepress/theme/components/Contributors.vue history · blame · raw

117 lines · 2685 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'
 10import { contribs, type Contributors } from '../../credits'
 11
 12const contributors = computed(() => contribs || ({} as Contributors))
 13</script>
 14
 15<template>
 16  <h1 class="text-center">Core Team</h1>
 17  <hr />
 18  <div class="contrib-grid">
 19    <a
 20      v-for="c of contributors.core"
 21      :key="c.name"
 22      :href="c.site || undefined"
 23      :target="c.site ? '_blank' : undefined"
 24      class="contrib-card"
 25      :class="{ 'no-link': !c.site }"
 26    >
 27      <img :src="c.avatar" class="contrib-avatar" />
 28      <span class="contrib-name">{{ c.name }}</span>
 29    </a>
 30  </div>
 31
 32  <h1 class="mt-section text-center">Contributors</h1>
 33  <hr />
 34  <div class="contrib-grid">
 35    <a
 36      v-for="c of contributors.contributors"
 37      :key="c.name"
 38      :href="c.site || undefined"
 39      :target="c.site ? '_blank' : undefined"
 40      class="contrib-card"
 41      :class="{ 'no-link': !c.site }"
 42    >
 43      <img :src="c.avatar" class="contrib-avatar" />
 44      <span class="contrib-name">{{ c.name }}</span>
 45    </a>
 46  </div>
 47
 48  <h1 class="mt-section text-center">Special Thanks to</h1>
 49  <hr />
 50  <div class="contrib-grid">
 51    <a
 52      v-for="c of contributors.special"
 53      :key="c.name"
 54      :href="c.site || undefined"
 55      :target="c.site ? '_blank' : undefined"
 56      class="contrib-card"
 57      :class="{ 'no-link': !c.site }"
 58    >
 59      <img :src="c.avatar" class="contrib-avatar" />
 60      <span class="contrib-name">{{ c.name }}</span>
 61    </a>
 62  </div>
 63</template>
 64
 65<style scoped>
 66.contrib-grid {
 67  display: flex;
 68  flex-wrap: wrap;
 69  gap: 8px;
 70  padding-top: 8px;
 71}
 72
 73.mt-section {
 74  margin-top: 30px;
 75}
 76
 77.contrib-card {
 78  display: flex;
 79  align-items: center;
 80  gap: 10px;
 81  padding: 10px 16px 10px 10px;
 82  border: 1px solid var(--vp-c-bg-soft);
 83  border-radius: 8px;
 84  background-color: var(--vp-c-bg-soft);
 85  text-decoration: none !important;
 86  color: var(--vp-c-text-1) !important;
 87  transition: border-color 0.25s;
 88  cursor: pointer;
 89}
 90
 91.contrib-card:hover {
 92  border-color: var(--vp-c-brand-1, #3c8dff);
 93}
 94
 95.contrib-card.no-link {
 96  cursor: default;
 97}
 98
 99.contrib-card.no-link:hover {
100  border-color: var(--vp-c-bg-soft);
101}
102
103.contrib-avatar {
104  width: 36px;
105  height: 36px;
106  border-radius: 50%;
107  object-fit: cover;
108  flex-shrink: 0;
109}
110
111.contrib-name {
112  font-size: 14px;
113  font-weight: 500;
114  line-height: 1;
115  white-space: nowrap;
116}
117</style>