From 74484835865fe80a8d787351924a1a69f81d8340 Mon Sep 17 00:00:00 2001 From: pengzhanbo Date: Fri, 28 Jun 2024 03:10:07 +0800 Subject: [PATCH] feat(theme): optimize friends layout --- docs/friends.md | 47 ++++++++++++++++--- docs/notes/theme/config/frontmatter/friend.md | 11 +++-- theme/src/client/components/Blog/VPBlog.vue | 11 ++--- theme/src/client/components/VPContent.vue | 10 +++- theme/src/client/components/VPFooter.vue | 3 +- theme/src/client/components/VPFriends.vue | 17 +++---- .../src/client/components/VPFriendsGroup.vue | 9 ++-- theme/src/client/components/VPFriendsItem.vue | 34 +++++++------- theme/src/client/styles/normalize.css | 6 ++- theme/src/client/styles/vars.css | 3 +- theme/src/shared/frontmatter/friends.ts | 4 +- 11 files changed, 101 insertions(+), 54 deletions(-) diff --git a/docs/friends.md b/docs/friends.md index 288e62d2..babe6977 100644 --- a/docs/friends.md +++ b/docs/friends.md @@ -8,22 +8,59 @@ list: name: pengzhanbo link: https://github.com/pengzhanbo avatar: https://github.com/pengzhanbo.png - desc: 即使慢,驰而不息,纵会落后,纵会失败,但必须能够到达他所向的目标。 - name: pengzhanbo link: https://github.com/pengzhanbo avatar: https://github.com/pengzhanbo.png - desc: 即使慢,驰而不息,纵会落后,纵会失败,但必须能够到达他所向的目标。 - name: pengzhanbo link: https://github.com/pengzhanbo avatar: https://github.com/pengzhanbo.png - desc: 即使慢,驰而不息,纵会落后,纵会失败,但必须能够到达他所向的目标。 + - + name: pengzhanbo + link: https://github.com/pengzhanbo + avatar: https://github.com/pengzhanbo.png + socials: + - + icon: github + link: https://github.com/pengzhanbo + - + icon: twitter + link: https://twitter.com/pengzhanbo + - + name: pengzhanbo + link: https://github.com/pengzhanbo + avatar: https://github.com/pengzhanbo.png + socials: + - + icon: github + link: https://github.com/pengzhanbo + - + icon: twitter + link: https://twitter.com/pengzhanbo + - + name: pengzhanbo + link: https://github.com/pengzhanbo + avatar: https://github.com/pengzhanbo.png + socials: + - + icon: github + link: https://github.com/pengzhanbo + - + icon: twitter + link: https://twitter.com/pengzhanbo - name: pengzhanbo link: https://github.com/pengzhanbo avatar: https://github.com/pengzhanbo.png desc: 即使慢,驰而不息,纵会落后,纵会失败,但必须能够到达他所向的目标。 + socials: + - + icon: github + link: https://github.com/pengzhanbo + - + icon: twitter + link: https://twitter.com/pengzhanbo - name: pengzhanbo link: https://github.com/pengzhanbo @@ -34,6 +71,7 @@ list: link: https://github.com/pengzhanbo avatar: https://github.com/pengzhanbo.png desc: 即使慢,驰而不息,纵会落后,纵会失败,但必须能够到达他所向的目标。 + groups: - title: 分组 1 @@ -47,7 +85,6 @@ groups: backgroundColor: rgb(255,153,0) color: rgb(255,255,153) nameColor: rgb(255,255,170) - borderColor: rgb(255,255,204) - name: pengzhanbo link: https://github.com/pengzhanbo @@ -56,7 +93,6 @@ groups: backgroundColor: rgb(255,102,102) color: rgb(255,204,204) nameColor: rgb(255,238,238) - borderColor: rgb(255,255,238) - name: pengzhanbo link: https://github.com/pengzhanbo @@ -65,7 +101,6 @@ groups: backgroundColor: rgb(0,153,204) color: rgb(153,238,255) nameColor: rgb(153,255,255) - borderColor: rgb(153,238,255) - title: 分组 2 desc: 这里是分组 2 的描述文字 diff --git a/docs/notes/theme/config/frontmatter/friend.md b/docs/notes/theme/config/frontmatter/friend.md index 755d516c..0fb46e1b 100644 --- a/docs/notes/theme/config/frontmatter/friend.md +++ b/docs/notes/theme/config/frontmatter/friend.md @@ -80,6 +80,11 @@ interface FriendsItem { */ desc?: string + /** + * 社交链接 + */ + socials?: SocialLink[] + /** * 背景色 */ @@ -92,13 +97,11 @@ interface FriendsItem { * 名字颜色 */ nameColor?: string | { light: string, dark: string } - /** - * 边框颜色 - */ - borderColor?: string | { light: string, dark: string } } ``` +社交链接配置请查看 [配置/主题配置/社交链接](../../config/主题配置.md#social)。 + ### groups - 类型: `FriendsGroup[]` diff --git a/theme/src/client/components/Blog/VPBlog.vue b/theme/src/client/components/Blog/VPBlog.vue index 58cbe7b6..2f84ed29 100644 --- a/theme/src/client/components/Blog/VPBlog.vue +++ b/theme/src/client/components/Blog/VPBlog.vue @@ -74,6 +74,8 @@ const { theme, page } = useData() .vp-blog { position: relative; min-height: calc(100vh - var(--vp-footer-height, 0px)); + background-color: var(--vp-c-bg); + transition: background-color var(--t-color); } .blog-container { @@ -93,14 +95,7 @@ const { theme, page } = useData() @media (min-width: 768px) { .vp-blog { - min-height: calc(100vh + var(--vp-nav-height) - var(--vp-footer-height, 0px)); - } - - .vp-blog { - padding-top: var(--vp-nav-height); - margin-top: calc(var(--vp-nav-height) * -1); - background-color: var(--vp-c-bg-alt); - transition: background-color var(--t-color); + background-color: transparent; } .blog-container { diff --git a/theme/src/client/components/VPContent.vue b/theme/src/client/components/VPContent.vue index 79f64314..78faf224 100644 --- a/theme/src/client/components/VPContent.vue +++ b/theme/src/client/components/VPContent.vue @@ -1,11 +1,12 @@