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> </div>
<!-- 脚本BootCDN jQuery / Artalk --> <!-- 脚本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="js/config.js?version=20251125"></script>
<script src="https://cdn.bootcdn.net/ajax/libs/artalk/2.9.1/Artalk.js"></script> <script src="https://cdn.bootcdn.net/ajax/libs/artalk/2.9.1/Artalk.js"></script>
<script src="js/about.js?version=20251125"></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-size: 1.3em;
font-weight: normal; font-weight: normal;
letter-spacing: 2px; letter-spacing: 2px;
color: #f0f0f0; color: #ffffff;
-webkit-font-smoothing: antialiased; -webkit-font-smoothing: antialiased;
margin-bottom: 20px; margin-bottom: 20px;
} }
@@ -275,7 +275,7 @@ pre code { padding: 0; background: none; border: none; word-wrap: normal; }
line-height: 2; line-height: 2;
letter-spacing: 2px; letter-spacing: 2px;
color: #ffffff; 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; position: relative;
z-index: 1; z-index: 1;
font-feature-settings: 'kern' 1; font-feature-settings: 'kern' 1;
@@ -872,7 +872,7 @@ nav {
.weixin-qrcode-desc { .weixin-qrcode-desc {
font-size: 14px; font-size: 14px;
color: #666; color: #555;
margin-bottom: 15px; margin-bottom: 15px;
} }
@@ -986,12 +986,12 @@ nav {
display: inline-block; display: inline-block;
margin: 0 5px; margin: 0 5px;
font-size: 0.5em; font-size: 0.5em;
color: rgba(255, 255, 255, 0.7); color: rgba(255, 255, 255, 0.85);
line-height: 1.2; line-height: 1.2;
} }
.power a { .power a {
color: rgba(255, 255, 255, 0.8); color: rgba(255, 255, 255, 0.95);
font-size: 0.5em; font-size: 0.5em;
text-decoration: none; text-decoration: none;
transition: color 0.3s ease; transition: color 0.3s ease;
@@ -1006,8 +1006,7 @@ nav {
.remark .power:not(:last-child):after { .remark .power:not(:last-child):after {
content: "|"; content: "|";
margin-left: 8px; margin-left: 8px;
color: rgba(255, 255, 255, 0.5); color: rgba(255, 255, 255, 0.7);
color: rgba(255, 255, 255, 0.5);
} }

View File

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

View File

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