GM 页:顶部合并为一行,赞助页改关于页(三张二维码),标签支持 hash 直达

- #hd 与 #tabs 合并成 #topbar,标签在左、连接状态在右,内容区多出 22px
- 赞助页改为关于页:介绍卡片 + 赞助我们/团队公众号组合面板,三张二维码同一行
- 二维码占位修复(img 在脚本前已 404,补 complete/naturalWidth 兜底)
- 标签支持 #home/#char/#item/#about 直达
- 内容区底部 62→71,修正被日志栏遮住 9px 的问题
This commit is contained in:
hanfuit committed 2026-11-05 15:16:39 +08:00
1 parent 06558415da
commit ee3e8d0ced
7 files changed
+130 -55

No files matched your search

+21 -8
View File
@@ -66,6 +66,7 @@
for (var j = 0; j < panes.length; j++) {
panes[j].className = 'pane' + (panes[j].id === 'pane-' + name ? ' on' : '');
}
try { if (location.hash !== '#' + name) location.hash = '#' + name; } catch (e) { }
}
function bindTabs() {
@@ -73,6 +74,13 @@
for (var i = 0; i < tabs.length; i++) {
tabs[i].onclick = function () { switchTab(this.getAttribute('data-tab')); };
}
// 支持用 #item / #char / #about / #home 直接打开某一页
var h = (location.hash || '').replace('#', '');
if (h && document.getElementById('pane-' + h)) switchTab(h);
window.onhashchange = function () {
var n = (location.hash || '').replace('#', '');
if (n && document.getElementById('pane-' + n)) switchTab(n);
};
}
/* ---------------------------------------------------------------- 状态页 */
@@ -419,16 +427,20 @@
function bindQr(id) {
var img = $(id);
if (!img) { return; }
img.onerror = function () {
var box = this.parentNode;
function showMiss() {
var box = img.parentNode;
if (box) { box.className = 'qr-box miss'; }
this.style.display = 'none';
};
img.onload = function () {
var box = this.parentNode;
img.style.display = 'none';
}
function showImg() {
var box = img.parentNode;
if (box) { box.className = 'qr-box'; }
this.style.display = '';
};
img.style.display = '';
}
img.onerror = showMiss;
img.onload = showImg;
/* 图片是 HTML 里带的 src,可能在脚本执行前就已经 404 了,onerror 来不及触发 */
if (img.complete && img.naturalWidth === 0) { showMiss(); }
}
/* ---------------------------------------------------------------- 启动 */
@@ -501,6 +513,7 @@
fillTypeOptions();
bindQr('qr-alipay');
bindQr('qr-wechat');
bindQr('qr-gzh');
renderPicked();
forceIME();