diff options
| author | 2023-04-19 17:30:39 +0800 | |
|---|---|---|
| committer | 2023-04-19 17:30:39 +0800 | |
| commit | 3adc965dd09490b7efa1cce9f09b0a3b30970277 (patch) | |
| tree | f813abb07d7b003984aa74e3154752b6ffc3ccd5 /docs/components/app/AppSocialIcons.vue | |
| parent | c7c9ca6f0c8eddf6d34cd40779f3b2d9463f3a46 (diff) | |
| download | HydroRoll-3adc965dd09490b7efa1cce9f09b0a3b30970277.tar.gz HydroRoll-3adc965dd09490b7efa1cce9f09b0a3b30970277.zip | |
✨优化文档
Diffstat (limited to 'docs/components/app/AppSocialIcons.vue')
| -rw-r--r-- | docs/components/app/AppSocialIcons.vue | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/docs/components/app/AppSocialIcons.vue b/docs/components/app/AppSocialIcons.vue new file mode 100644 index 0000000..c30f513 --- /dev/null +++ b/docs/components/app/AppSocialIcons.vue @@ -0,0 +1,58 @@ +<script setup lang="ts"> +const socials = ['twitter', 'facebook', 'instagram', 'youtube', 'github', 'medium'] + +const { config } = useDocus() + +const icons = computed<any>(() => { + return Object.entries(config.value.socials || {}) + .map(([key, value]) => { + if (typeof value === 'object') { + return value + } else if (typeof value === 'string' && value && socials.includes(key)) { + return { + href: `https://${key}.com/${value}`, + icon: `fa-brands:${key}`, + label: value + } + } else { + return null + } + }) + .filter(Boolean) +}) +</script> + +<template> + <NuxtLink + v-for="icon in icons" + :key="icon.label" + rel="noopener noreferrer" + :title="icon.label" + :aria-label="icon.label" + :href="icon.href" + target="_blank" + > + <Icon v-if="icon.icon" :name="icon.icon" /> + </NuxtLink> +</template> + +<style lang="ts" scoped> +css({ + a: { + display: 'flex', + color: '{color.gray.500}', + padding: '{space.4}', + + '@dark': { + color: '{color.gray.400}' + }, + + '&:hover': { + color: '{color.gray.700}', + '@dark': { + color: '{color.gray.200}', + } + }, + } +}) +</style> |
