diff --git a/components/help/HelpPreview.vue b/components/help/HelpPreview.vue index 2c08040b..b7d31232 100644 --- a/components/help/HelpPreview.vue +++ b/components/help/HelpPreview.vue @@ -32,7 +32,7 @@ const emit = defineEmits<{

diff --git a/package.json b/package.json index be919386..e22df274 100644 --- a/package.json +++ b/package.json @@ -21,6 +21,7 @@ "test:unit": "vitest", "test:typecheck": "vue-tsc --noEmit && vue-tsc --noEmit --project service-worker/tsconfig.json", "test": "nr test:unit", + "update:team:avatars": "esno scripts/avatars.ts", "postinstall": "nuxi prepare && simple-git-hooks", "release": "bumpp && esno scripts/release.ts" }, diff --git a/pages/settings/about/index.vue b/pages/settings/about/index.vue index 082172f7..52ac796b 100644 --- a/pages/settings/about/index.vue +++ b/pages/settings/about/index.vue @@ -91,7 +91,7 @@ const handleShowCommit = () => { external target="_blank" > diff --git a/public/avatars/antfu-100x100.png b/public/avatars/antfu-100x100.png new file mode 100644 index 00000000..ea35d0bd Binary files /dev/null and b/public/avatars/antfu-100x100.png differ diff --git a/public/avatars/antfu-60x60.png b/public/avatars/antfu-60x60.png new file mode 100644 index 00000000..9b2a5f55 Binary files /dev/null and b/public/avatars/antfu-60x60.png differ diff --git a/public/avatars/danielroe-100x100.png b/public/avatars/danielroe-100x100.png new file mode 100644 index 00000000..523b2a7b Binary files /dev/null and b/public/avatars/danielroe-100x100.png differ diff --git a/public/avatars/danielroe-60x60.png b/public/avatars/danielroe-60x60.png new file mode 100644 index 00000000..b3f6d686 Binary files /dev/null and b/public/avatars/danielroe-60x60.png differ diff --git a/public/avatars/patak-dev-100x100.png b/public/avatars/patak-dev-100x100.png new file mode 100644 index 00000000..4fa5974c Binary files /dev/null and b/public/avatars/patak-dev-100x100.png differ diff --git a/public/avatars/patak-dev-60x60.png b/public/avatars/patak-dev-60x60.png new file mode 100644 index 00000000..c113e318 Binary files /dev/null and b/public/avatars/patak-dev-60x60.png differ diff --git a/public/avatars/sxzz-100x100.png b/public/avatars/sxzz-100x100.png new file mode 100644 index 00000000..78d0e9a6 Binary files /dev/null and b/public/avatars/sxzz-100x100.png differ diff --git a/public/avatars/sxzz-60x60.png b/public/avatars/sxzz-60x60.png new file mode 100644 index 00000000..3c82caad Binary files /dev/null and b/public/avatars/sxzz-60x60.png differ diff --git a/scripts/avatars.ts b/scripts/avatars.ts new file mode 100644 index 00000000..708e586c --- /dev/null +++ b/scripts/avatars.ts @@ -0,0 +1,31 @@ +import { join, resolve } from 'pathe' +import fs from 'fs-extra' +import { $fetch } from 'ohmyfetch' +import { teams } from '../composables/about' + +const avatarsDir = resolve('./public/avatars/') + +const sizes = [60, 100] + +async function download(url: string, fileName: string) { + if (fs.existsSync(fileName)) + return + + console.log('downloading', fileName) + try { + const image = await $fetch(url, { responseType: 'arrayBuffer' }) + await fs.writeFile(fileName, Buffer.from(image)) + } + catch {} +} + +async function fetchAvatars() { + await fs.ensureDir(avatarsDir) + + await Promise.all(teams.reduce((acc, { github }) => { + acc.push(...sizes.map(s => download(`https://github.com/${github}.png?size=${s}`, join(avatarsDir, `${github}-${s}x${s}.png`)))) + return acc + }, [] as Promise[])) +} + +fetchAvatars()