chore(site): 优化网站性能与样式细节

- 将 jQuery 引用从 BootCDN 改为本地文件以提升加载速度
- 移除页面 body 标签中的禁止右键和选择属性,提高用户体验
- 为事件监听器添加 passive 选项以提升滚动性能
- 调整 StarrySky.js 中 canvas 阴影模糊值以优化视觉效果
- 更新 CSS 样式颜色值,增强文字可读性与整体美观度
- 统一并优化部分文本阴影及字体抗锯齿设置
This commit is contained in:
hehh
2025-11-27 15:49:12 +08:00
parent 0c55a90662
commit 86468a9f77
4 changed files with 14 additions and 15 deletions

View File

@@ -322,7 +322,7 @@
</div>
<!-- 脚本BootCDN jQuery / Artalk -->
<script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.7.1/jquery.min.js"></script>
<script src="js/jquery.min.js"></script>
<script src="js/config.js?version=20251125"></script>
<script src="https://cdn.bootcdn.net/ajax/libs/artalk/2.9.1/Artalk.js"></script>
<script src="js/about.js?version=20251125"></script>

View File

@@ -262,7 +262,7 @@ pre code { padding: 0; background: none; border: none; word-wrap: normal; }
font-size: 1.3em;
font-weight: normal;
letter-spacing: 2px;
color: #f0f0f0;
color: #ffffff;
-webkit-font-smoothing: antialiased;
margin-bottom: 20px;
}
@@ -275,7 +275,7 @@ pre code { padding: 0; background: none; border: none; word-wrap: normal; }
line-height: 2;
letter-spacing: 2px;
color: #ffffff;
text-shadow: 0 1px 2px rgba(141, 114, 114, 0.2) !important;
text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4) !important;
position: relative;
z-index: 1;
font-feature-settings: 'kern' 1;
@@ -872,7 +872,7 @@ nav {
.weixin-qrcode-desc {
font-size: 14px;
color: #666;
color: #555;
margin-bottom: 15px;
}
@@ -986,12 +986,12 @@ nav {
display: inline-block;
margin: 0 5px;
font-size: 0.5em;
color: rgba(255, 255, 255, 0.7);
color: rgba(255, 255, 255, 0.85);
line-height: 1.2;
}
.power a {
color: rgba(255, 255, 255, 0.8);
color: rgba(255, 255, 255, 0.95);
font-size: 0.5em;
text-decoration: none;
transition: color 0.3s ease;
@@ -1006,8 +1006,7 @@ nav {
.remark .power:not(:last-child):after {
content: "|";
margin-left: 8px;
color: rgba(255, 255, 255, 0.5);
color: rgba(255, 255, 255, 0.5);
color: rgba(255, 255, 255, 0.7);
}

View File

@@ -64,7 +64,7 @@
</script>
</head>
<body oncontextmenu=self.event.returnValue=false onselectstart="return false">
<body>
<header id="panel" class="panel-cover">
<script>
WIDGET = {
@@ -277,7 +277,7 @@
// 防止滚动穿透
document.body.style.overflow = 'hidden';
// 添加ESC键关闭
document.addEventListener('keydown', closeOnEsc);
document.addEventListener('keydown', closeOnEsc, { passive: false });
}
function closeWeixin() {
@@ -286,7 +286,7 @@
// 恢复滚动
document.body.style.overflow = '';
// 移除ESC键监听
document.removeEventListener('keydown', closeOnEsc);
document.removeEventListener('keydown', closeOnEsc, { passive: false });
}
function closeOnEsc(e) {
@@ -300,12 +300,12 @@
if (e.target === this) {
closeWeixin();
}
});
}, { passive: false });
// 阻止点击弹框内容时关闭
document.querySelector('.weixin-qrcode-container').addEventListener('click', function (e) {
e.stopPropagation();
});
}, { passive: false });
</script>
</div>
<div class="remark iUp">

View File

@@ -84,7 +84,7 @@ const StarrySky = function () {
}
}
starCount = Math.ceil(canvasWidth * starCountLevel);
}, 200));
}, 200), { passive: true });
} else {
console.error('初始化失败必须传入Canvas元素');
}
@@ -160,7 +160,7 @@ const StarrySky = function () {
canvasContext.shadowOffsetX = 0;
canvasContext.shadowOffsetY = 0;
canvasContext.shadowColor = "rgb(" + star["color"] + ")";
canvasContext.shadowBlur = 10;
canvasContext.shadowBlur = 5;
canvasContext.beginPath();
canvasContext.arc(star_x, star_y, star_radius, 0, 2 * Math.PI);
canvasContext.fill();