吴雨瞳添加了注释

master
wyt 6 months ago
parent 829942e9d5
commit 53c7f5cc09

@ -1,29 +1,37 @@
<template>
<!-- 个人资料组件容器设置高度宽度圆角阴影等样式背景使用渐变 -->
<div class="h-98 w-full rounded-2xl relative shadow-xl mb-8" :style="gradientBackground">
<!-- 个人资料卡片深色背景圆角半透明居中布局带悬停阴影效果 -->
<div
class="ob-gradient-cut-plate absolute bg-ob-deep-900 rounded-xl opacity-90 flex justify-center items-center pt-4 px-6 shadow-lg hover:shadow-2xl duration-300"
data-dia="author">
class="ob-gradient-cut-plate absolute bg-ob-deep-900 rounded-xl opacity-90 flex justify-center items-center pt-4 px-6 shadow-lg hover:shadow-2xl duration-300"
data-dia="author">
<div class="profile absolute w-full flex flex-col justify-center items-center">
<div class="flex flex-col justify-center items-center">
<!-- 作者头像优先使用配置中的头像否则使用默认头像 -->
<img v-if="websiteConfig.authorAvatar" :class="avatarClass" :src="websiteConfig.authorAvatar" />
<img v-else :class="avatarClass" :src="default" />
<!-- 作者名称使用配置中的作者名否则显示骨架屏 -->
<h2 class="text-center pt-4 text-4xl font-semibold text-ob-bright">
<template v-if="websiteConfig.author">
{{ websiteConfig.author }}
</template>
<ob-skeleton v-else height="2.25rem" width="7rem" />
</h2>
<!-- 名称下方的渐变分隔线 -->
<span class="h-1 w-14 rounded-full mt-2" :style="gradientBackground" />
<!-- 作者简介使用配置中的简介否则显示骨架屏 -->
<p
v-if="websiteConfig.authorIntro"
class="pt-6 px-10 w-full text-s text-center"
v-html="websiteConfig.authorIntro" />
v-if="websiteConfig.authorIntro"
class="pt-6 px-10 w-full text-s text-center"
v-html="websiteConfig.authorIntro" />
<p v-else class="pt-6 px-10 w-full text-sm text-center flex flex-col gap-2">
<ob-skeleton :count="2" height="20px" width="10rem" />
</p>
</div>
<div class="h-full w-full flex flex-col flex-1 justify-end items-end">
<!-- 社交媒体链接组件 -->
<Social />
<!-- 统计数据列表文章数说说数分类数标签数 -->
<ul class="grid grid-cols-4 pt-4 w-full px-2 text-lg">
<li class="col-span-1 text-center">
<span class="text-ob-bright">
@ -51,36 +59,54 @@
</template>
<script lang="ts">
//
import { useAppStore } from '@/stores/app'
// Vue
import { computed, defineComponent } from 'vue'
//
import { useI18n } from 'vue-i18n'
//
import Social from '@/components/Social.vue'
//
export default defineComponent({
name: 'Profile',
//
components: { Social },
setup() {
//
const appStore = useAppStore()
//
const { t } = useI18n()
return {
//
default: 'https://static.linhaojun.top/aurora/config/52a81cd2772167b645569342e81ce312.jpg',
// +
avatarClass: computed(() => {
return {
'ob-avatar': true,
[appStore.themeConfig.profile_shape]: true
}
}),
//
themeConfig: computed(() => appStore.themeConfig),
// 使CSS
gradientBackground: computed(() => {
return { background: appStore.themeConfig.header_gradient_css }
}),
//
websiteConfig: computed(() => {
return appStore.websiteConfig
}),
//
articleCount: computed(() => appStore.articleCount),
//
talkCount: computed(() => appStore.talkCount),
//
categoryCount: computed(() => appStore.categoryCount),
//
tagCount: computed(() => appStore.tagCount),
//
t
}
}
@ -88,9 +114,10 @@ export default defineComponent({
</script>
<style lang="scss" scoped>
//
.profile {
top: -7%;
height: 100%;
max-height: 100%;
}
</style>
</style>
Loading…
Cancel
Save