优化细节

This commit is contained in:
Han 2025-04-07 11:34:37 +08:00
parent b4ed327373
commit d0cafa72de
7 changed files with 28 additions and 22 deletions

View File

@ -51,8 +51,8 @@ document.addEventListener('DOMContentLoaded', () => {
}
// 核心方法
function setGlobals() {
state.canvas = document.querySelector(".vh-aside-item.user > canvas");
function setGlobals(dom) {
state.canvas = document.querySelector(dom);
state.ctx = state.canvas.getContext("2d");
}
@ -178,7 +178,8 @@ document.addEventListener('DOMContentLoaded', () => {
// 公共接口
return {
init: () => {
setGlobals();
if (!document.querySelector('.vh-aside-item.user > canvas')) return;
setGlobals(".vh-aside-item.user > canvas");
initializeButton();
window.addEventListener('resize', handleResize);
}

View File

@ -61,7 +61,7 @@ import "./Aside.less";
<!-- 公告块 -->
{
AsideShow.TipsShow && (
SITE_CONFIG.Tips && (
<section class="vh-aside-item tips">
<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">
@ -71,8 +71,7 @@ import "./Aside.less";
公告
</span>
<div class="tips-content">
<p>欢迎访问我的博客,我是一名前端工程师,喜欢分享前端知识和技巧。</p>
<p>如果你对我的博客感兴趣,欢迎关注我的公众号,我会定期发布一些前端技术文章和教程。</p>
<Fragment set:html={SITE_CONFIG.Tips} />
</div>
</section>
)

View File

@ -430,7 +430,7 @@
box-sizing: border-box;
padding: 0.188rem;
margin: 0.188rem 0;
border: solid 1px #E8E8E8;
border: solid 1px var(--vh-font-16);
display: block;
max-height: 66px;
object-fit: contain;

View File

@ -51,7 +51,7 @@
box-sizing: border-box;
padding: 0.66rem 0.66rem 0;
width: 100%;
max-width: 26rem;
max-width: 28.88rem;
height: max-content;
color: var(--vh-white-color);
text-align: center;

View File

@ -48,7 +48,7 @@ section.vh-art-page {
pointer-events: none;
&>svg {
color: #E8E8E8;
color: var(--vh-font-16);
}
}

View File

@ -1,20 +1,29 @@
export default {
// 网站标题
Title: '韩小韩博客',
// 网站地址
Site: 'https://www.vvhan.com',
// 网站副标题
Subtitle: '不曾与你分享的时间,我在进步.',
// 网站描述
Description: '韩小韩博客 专注于前开发与相关技术的实战分享涵盖Vue框架、Node.js、Serverless等并涉及Node、Python、Linux、Docker等领域。同时博客也分享作者的生活、音乐和旅行的热爱。',
// 网站作者
Author: '.𝙃𝙖𝙣',
Motto: '运气是计划之外的东西.',
// 作者头像
Avatar: 'https://q1.qlogo.cn/g?b=qq&nk=1655466387&s=640',
// 网站座右铭
Motto: '运气是计划之外的东西.',
// Cover 网站缩略图
Cover: '/assets/images/banner/072c12ec85d2d3b5.webp',
// 网站创建时间
CreateTime: '2021-09-01',
// 网站侧边栏公告 (不填写即不开启)
Tips: '<p>欢迎光临我的博客 🎉</p><p>这里会分享我的日常和学习中的收集、整理及总结,希望能对你有所帮助:) 💖</p>',
// 首页打字机文案列表
TypeWriteList: [
'不曾与你分享的时间,我在进步.',
"I am making progress in the time I haven't shared with you.",
],
// 网站创建时间
CreateTime: '2021-09-01',
// 顶部 Banner 配置
HomeBanner: {
enable: true,
@ -41,7 +50,7 @@ export default {
},
// 导航栏 (新窗口打开 newWindow: true)
Navs: [
// 仅支持 SVG 且 SVG 需放在 public/assets/images/svg/ 目录下,填入文件名即可(封装了 SVG 组件 为了极致压缩 SVG
// 仅支持 SVG 且 SVG 需放在 public/assets/images/svg/ 目录下,填入文件名即可 <不需要文件后缀名>(封装了 SVG 组件 为了极致压缩 SVG
// 建议使用 https://tabler.io/icons 直接下载 SVG
{ text: '朋友', link: '/links', icon: 'Nav_friends' },
{ text: '圈子', link: '/friends', icon: 'Nav_rss' },
@ -53,7 +62,7 @@ export default {
],
// 侧边栏个人网站
WebSites: [
// 仅支持 SVG 且 SVG 需放在 public/assets/images/svg/ 目录下,填入文件名即可(封装了 SVG 组件 为了极致压缩 SVG
// 仅支持 SVG 且 SVG 需放在 public/assets/images/svg/ 目录下,填入文件名即可 <不需要文件后缀名>(封装了 SVG 组件 为了极致压缩 SVG
// 建议使用 https://tabler.io/icons 直接下载 SVG
{ text: 'Github', link: 'https://github.com/uxiaohan', icon: 'WebSite_github' },
{ text: '韩小韩API', link: 'https://api.vvhan.com', icon: 'WebSite_api' },
@ -65,13 +74,9 @@ export default {
AsideShow: {
// 是否展示个人网站
WebSitesShow: true,
// 是否展示公告
TipsShow: true,
// 是否展示数量统计
CountShow: true,
// 是否展示分类
CategoriesShow: true,
// 是否展示个人标签
// 是否展示标签
TagsShow: true,
// 是否展示推荐文章
recommendArticleShow: true
@ -79,6 +84,7 @@ export default {
// DNS预解析地址
DNSOptimization: [
'https://i0.wp.com',
'https://cn.cravatar.com',
'https://analytics.vvhan.com',
'https://vh-api.4ce.cn',
'https://registry.npmmirror.com',

View File

@ -400,7 +400,7 @@
&>img.vh-article-img {
width: 100%;
aspect-ratio: 3 / 2;
border: solid 1px #E8E8E8;
border: solid 1px var(--vh-font-16);
border-radius: 5px;
object-fit: cover;
overflow: hidden;
@ -415,7 +415,7 @@
align-items: center;
width: 100%;
aspect-ratio: 16 / 9;
border: solid 1px #E8E8E8;
border: solid 1px var(--vh-font-16);
border-radius: 5px;
overflow: hidden;
}
@ -493,7 +493,7 @@
width: max-content;
max-width: 100%;
max-height: 36rem;
border: solid 1px #E8E8E8;
border: solid 1px var(--vh-font-16);
border-radius: 5px;
cursor: zoom-in;
cursor: -moz-zoom-in;