perf: the contributor avatar source for the about page uses webp.se (halo-dev/console#413)

Signed-off-by: Ryan Wang <i@ryanc.cc>
pull/3445/head
Ryan Wang 2022-01-19 15:18:16 +08:00 committed by GitHub
parent 903a076bb6
commit f074d7819f
1 changed files with 11 additions and 1 deletions

View File

@ -51,7 +51,12 @@
<a-card :bodyStyle="{ padding: '16px' }" :bordered="false" :loading="contributorsLoading" title="开发者">
<a v-for="(item, index) in contributors" :key="index" :href="item.html_url" target="_blank">
<a-tooltip :title="item.login" placement="top">
<a-avatar :src="item.avatar_url" :style="{ marginRight: '10px', marginBottom: '10px' }" size="large" />
<a-avatar
:src="item.avatar_url | webpAvatarConvert"
:style="{ marginRight: '10px', marginBottom: '10px' }"
size="large"
:alt="item.login"
/>
</a-tooltip>
</a>
</a-card>
@ -258,6 +263,11 @@ User Agent${navigator.userAgent}`
}
return major * 1000000 + minor * 1000 + micro
}
},
filters: {
webpAvatarConvert(url) {
return url.replace('avatars.githubusercontent.com', 'avatars-githubusercontent.webp.se')
}
}
}
</script>