Skip to content

Commit

Permalink
feat(theme): 补全在移动设备下的博主信息
Browse files Browse the repository at this point in the history
  • Loading branch information
pengzhanbo committed Apr 11, 2024
1 parent 82bbc77 commit cc4837c
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 4 deletions.
34 changes: 33 additions & 1 deletion theme/src/client/components/Blog/BlogExtract.vue
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,16 @@ const showBlogExtract = computed(() => {
<p class="desc">
{{ avatar.description }}
</p>
<div class="avatar-info">
<div v-if="avatar.location" class="avatar-location">
<span class="vpi-location" />
<p v-if="avatar.location" v-html="avatar.location" />
</div>
<div v-if="avatar.organization" class="avatar-organization">
<span class="vpi-organization" />
<p v-if="avatar.organization" v-html="avatar.organization" />
</div>
</div>
</div>
</div>
<div v-if="hasBlogExtract" class="blog-nav" :class="{ 'no-avatar': !avatar }">
Expand All @@ -87,7 +97,7 @@ const showBlogExtract = computed(() => {
bottom: 30%;
z-index: calc(var(--vp-z-index-nav) - 1);
display: block;
padding: 4px 10px;
padding: 6px 10px;
cursor: pointer;
background-color: var(--vp-c-bg);
border: solid 1px var(--vp-c-divider);
Expand Down Expand Up @@ -212,4 +222,26 @@ const showBlogExtract = computed(() => {
height: 1em;
margin-right: 4px;
}
.avatar-info {
display: flex;
flex-wrap: wrap;
gap: 0 20px;
align-items: center;
}
.avatar-location,
.avatar-organization {
display: flex;
align-items: center;
justify-content: center;
font-size: 14px;
color: var(--vp-c-text-3);
transition: color var(--t-color);
}
.avatar-location p,
.avatar-organization p {
margin: 0 4px;
}
</style>
4 changes: 1 addition & 3 deletions theme/src/client/components/Blog/BlogProfile.vue
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,11 @@ const avatar = computed(() => theme.value.avatar)
border-radius: 8px;
box-shadow: var(--vp-shadow-1);
transition: var(--t-color);
transition-property: background-color, color, box-shadow, transform;
transform: scale(1);
transition-property: background-color, color, box-shadow;
}
.avatar-profile:hover {
box-shadow: var(--vp-shadow-2);
transform: scale(1.002);
}
.avatar-profile img {
Expand Down
1 change: 1 addition & 0 deletions theme/src/node/blogTags.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { hasOwn, random, toArray } from '@pengzhanbo/utils'

export type BlogTagsColorsItem = readonly [
string, // normal color
string, // hover color
Expand Down

0 comments on commit cc4837c

Please sign in to comment.