优化细节✅
This commit is contained in:
parent
b4ed327373
commit
d0cafa72de
@ -51,8 +51,8 @@ document.addEventListener('DOMContentLoaded', () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 核心方法
|
// 核心方法
|
||||||
function setGlobals() {
|
function setGlobals(dom) {
|
||||||
state.canvas = document.querySelector(".vh-aside-item.user > canvas");
|
state.canvas = document.querySelector(dom);
|
||||||
state.ctx = state.canvas.getContext("2d");
|
state.ctx = state.canvas.getContext("2d");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -178,7 +178,8 @@ document.addEventListener('DOMContentLoaded', () => {
|
|||||||
// 公共接口
|
// 公共接口
|
||||||
return {
|
return {
|
||||||
init: () => {
|
init: () => {
|
||||||
setGlobals();
|
if (!document.querySelector('.vh-aside-item.user > canvas')) return;
|
||||||
|
setGlobals(".vh-aside-item.user > canvas");
|
||||||
initializeButton();
|
initializeButton();
|
||||||
window.addEventListener('resize', handleResize);
|
window.addEventListener('resize', handleResize);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -61,7 +61,7 @@ import "./Aside.less";
|
|||||||
|
|
||||||
<!-- 公告块 -->
|
<!-- 公告块 -->
|
||||||
{
|
{
|
||||||
AsideShow.TipsShow && (
|
SITE_CONFIG.Tips && (
|
||||||
<section class="vh-aside-item tips">
|
<section class="vh-aside-item tips">
|
||||||
<span>
|
<span>
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
||||||
@ -71,8 +71,7 @@ import "./Aside.less";
|
|||||||
公告
|
公告
|
||||||
</span>
|
</span>
|
||||||
<div class="tips-content">
|
<div class="tips-content">
|
||||||
<p>欢迎访问我的博客,我是一名前端工程师,喜欢分享前端知识和技巧。</p>
|
<Fragment set:html={SITE_CONFIG.Tips} />
|
||||||
<p>如果你对我的博客感兴趣,欢迎关注我的公众号,我会定期发布一些前端技术文章和教程。</p>
|
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
)
|
)
|
||||||
|
|||||||
@ -430,7 +430,7 @@
|
|||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
padding: 0.188rem;
|
padding: 0.188rem;
|
||||||
margin: 0.188rem 0;
|
margin: 0.188rem 0;
|
||||||
border: solid 1px #E8E8E8;
|
border: solid 1px var(--vh-font-16);
|
||||||
display: block;
|
display: block;
|
||||||
max-height: 66px;
|
max-height: 66px;
|
||||||
object-fit: contain;
|
object-fit: contain;
|
||||||
|
|||||||
@ -51,7 +51,7 @@
|
|||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
padding: 0.66rem 0.66rem 0;
|
padding: 0.66rem 0.66rem 0;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
max-width: 26rem;
|
max-width: 28.88rem;
|
||||||
height: max-content;
|
height: max-content;
|
||||||
color: var(--vh-white-color);
|
color: var(--vh-white-color);
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
|||||||
@ -48,7 +48,7 @@ section.vh-art-page {
|
|||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
|
|
||||||
&>svg {
|
&>svg {
|
||||||
color: #E8E8E8;
|
color: var(--vh-font-16);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,20 +1,29 @@
|
|||||||
export default {
|
export default {
|
||||||
|
// 网站标题
|
||||||
Title: '韩小韩博客',
|
Title: '韩小韩博客',
|
||||||
|
// 网站地址
|
||||||
Site: 'https://www.vvhan.com',
|
Site: 'https://www.vvhan.com',
|
||||||
|
// 网站副标题
|
||||||
Subtitle: '不曾与你分享的时间,我在进步.',
|
Subtitle: '不曾与你分享的时间,我在进步.',
|
||||||
|
// 网站描述
|
||||||
Description: '韩小韩博客 专注于前开发与相关技术的实战分享,涵盖Vue框架、Node.js、Serverless等,并涉及Node、Python、Linux、Docker等领域。同时,博客也分享作者的生活、音乐和旅行的热爱。',
|
Description: '韩小韩博客 专注于前开发与相关技术的实战分享,涵盖Vue框架、Node.js、Serverless等,并涉及Node、Python、Linux、Docker等领域。同时,博客也分享作者的生活、音乐和旅行的热爱。',
|
||||||
|
// 网站作者
|
||||||
Author: '.𝙃𝙖𝙣',
|
Author: '.𝙃𝙖𝙣',
|
||||||
Motto: '运气是计划之外的东西.',
|
// 作者头像
|
||||||
Avatar: 'https://q1.qlogo.cn/g?b=qq&nk=1655466387&s=640',
|
Avatar: 'https://q1.qlogo.cn/g?b=qq&nk=1655466387&s=640',
|
||||||
|
// 网站座右铭
|
||||||
|
Motto: '运气是计划之外的东西.',
|
||||||
// Cover 网站缩略图
|
// Cover 网站缩略图
|
||||||
Cover: '/assets/images/banner/072c12ec85d2d3b5.webp',
|
Cover: '/assets/images/banner/072c12ec85d2d3b5.webp',
|
||||||
// 网站创建时间
|
// 网站侧边栏公告 (不填写即不开启)
|
||||||
CreateTime: '2021-09-01',
|
Tips: '<p>欢迎光临我的博客 🎉</p><p>这里会分享我的日常和学习中的收集、整理及总结,希望能对你有所帮助:) 💖</p>',
|
||||||
// 首页打字机文案列表
|
// 首页打字机文案列表
|
||||||
TypeWriteList: [
|
TypeWriteList: [
|
||||||
'不曾与你分享的时间,我在进步.',
|
'不曾与你分享的时间,我在进步.',
|
||||||
"I am making progress in the time I haven't shared with you.",
|
"I am making progress in the time I haven't shared with you.",
|
||||||
],
|
],
|
||||||
|
// 网站创建时间
|
||||||
|
CreateTime: '2021-09-01',
|
||||||
// 顶部 Banner 配置
|
// 顶部 Banner 配置
|
||||||
HomeBanner: {
|
HomeBanner: {
|
||||||
enable: true,
|
enable: true,
|
||||||
@ -41,7 +50,7 @@ export default {
|
|||||||
},
|
},
|
||||||
// 导航栏 (新窗口打开 newWindow: true)
|
// 导航栏 (新窗口打开 newWindow: true)
|
||||||
Navs: [
|
Navs: [
|
||||||
// 仅支持 SVG 且 SVG 需放在 public/assets/images/svg/ 目录下,填入文件名即可(封装了 SVG 组件 为了极致压缩 SVG)
|
// 仅支持 SVG 且 SVG 需放在 public/assets/images/svg/ 目录下,填入文件名即可 <不需要文件后缀名>(封装了 SVG 组件 为了极致压缩 SVG)
|
||||||
// 建议使用 https://tabler.io/icons 直接下载 SVG
|
// 建议使用 https://tabler.io/icons 直接下载 SVG
|
||||||
{ text: '朋友', link: '/links', icon: 'Nav_friends' },
|
{ text: '朋友', link: '/links', icon: 'Nav_friends' },
|
||||||
{ text: '圈子', link: '/friends', icon: 'Nav_rss' },
|
{ text: '圈子', link: '/friends', icon: 'Nav_rss' },
|
||||||
@ -53,7 +62,7 @@ export default {
|
|||||||
],
|
],
|
||||||
// 侧边栏个人网站
|
// 侧边栏个人网站
|
||||||
WebSites: [
|
WebSites: [
|
||||||
// 仅支持 SVG 且 SVG 需放在 public/assets/images/svg/ 目录下,填入文件名即可(封装了 SVG 组件 为了极致压缩 SVG)
|
// 仅支持 SVG 且 SVG 需放在 public/assets/images/svg/ 目录下,填入文件名即可 <不需要文件后缀名>(封装了 SVG 组件 为了极致压缩 SVG)
|
||||||
// 建议使用 https://tabler.io/icons 直接下载 SVG
|
// 建议使用 https://tabler.io/icons 直接下载 SVG
|
||||||
{ text: 'Github', link: 'https://github.com/uxiaohan', icon: 'WebSite_github' },
|
{ text: 'Github', link: 'https://github.com/uxiaohan', icon: 'WebSite_github' },
|
||||||
{ text: '韩小韩API', link: 'https://api.vvhan.com', icon: 'WebSite_api' },
|
{ text: '韩小韩API', link: 'https://api.vvhan.com', icon: 'WebSite_api' },
|
||||||
@ -65,13 +74,9 @@ export default {
|
|||||||
AsideShow: {
|
AsideShow: {
|
||||||
// 是否展示个人网站
|
// 是否展示个人网站
|
||||||
WebSitesShow: true,
|
WebSitesShow: true,
|
||||||
// 是否展示公告
|
|
||||||
TipsShow: true,
|
|
||||||
// 是否展示数量统计
|
|
||||||
CountShow: true,
|
|
||||||
// 是否展示分类
|
// 是否展示分类
|
||||||
CategoriesShow: true,
|
CategoriesShow: true,
|
||||||
// 是否展示个人标签
|
// 是否展示标签
|
||||||
TagsShow: true,
|
TagsShow: true,
|
||||||
// 是否展示推荐文章
|
// 是否展示推荐文章
|
||||||
recommendArticleShow: true
|
recommendArticleShow: true
|
||||||
@ -79,6 +84,7 @@ export default {
|
|||||||
// DNS预解析地址
|
// DNS预解析地址
|
||||||
DNSOptimization: [
|
DNSOptimization: [
|
||||||
'https://i0.wp.com',
|
'https://i0.wp.com',
|
||||||
|
'https://cn.cravatar.com',
|
||||||
'https://analytics.vvhan.com',
|
'https://analytics.vvhan.com',
|
||||||
'https://vh-api.4ce.cn',
|
'https://vh-api.4ce.cn',
|
||||||
'https://registry.npmmirror.com',
|
'https://registry.npmmirror.com',
|
||||||
|
|||||||
@ -400,7 +400,7 @@
|
|||||||
&>img.vh-article-img {
|
&>img.vh-article-img {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
aspect-ratio: 3 / 2;
|
aspect-ratio: 3 / 2;
|
||||||
border: solid 1px #E8E8E8;
|
border: solid 1px var(--vh-font-16);
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
object-fit: cover;
|
object-fit: cover;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
@ -415,7 +415,7 @@
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
aspect-ratio: 16 / 9;
|
aspect-ratio: 16 / 9;
|
||||||
border: solid 1px #E8E8E8;
|
border: solid 1px var(--vh-font-16);
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
@ -493,7 +493,7 @@
|
|||||||
width: max-content;
|
width: max-content;
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
max-height: 36rem;
|
max-height: 36rem;
|
||||||
border: solid 1px #E8E8E8;
|
border: solid 1px var(--vh-font-16);
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
cursor: zoom-in;
|
cursor: zoom-in;
|
||||||
cursor: -moz-zoom-in;
|
cursor: -moz-zoom-in;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user