Files
ywsandClaude Opus 5.5 cb7cd3649b 安全审计与加固:爱发电回调防投毒、回调日志封顶、令牌定长比较、转义补全;nginx 安全头 / 挡备份与原始内容文件(片段 + 文档)
- 没验证过的爱发电回调不再写进账本 pay_orders,只进 50 条封顶的待核对清单;回调日志只记关键头 + 正文 4KB、5MB 轮转(测试 +2)
- 福利券领取令牌定长比较;ys_admin.py 转义补上引号;星门格子提示转义;首页价格改读公开接口
- nginx 片段:安全头(HSTS/nosniff/XFO/Referrer/Permissions/CSP)、挡备份 / 预览稿 / 隐藏文件 / 原始内容 json、回调单独限流、server_tokens off
- 交接文档 2.9 安全加固 + 维护页挂法更新

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-06 12:52:16 +00:00

45 lines
2.9 KiB
JavaScript

/* 金钻宇宙 · 开场「星门」(2026-10-06 重做,替换原来的「星图载入中…」一行字)
---------------------------------------------------------------------------
three.js 在下载 / 星系在生成的这段时间,星图窗里是一道星门:
· 中间像素钻石,外面三圈光环反向慢转;底下一排格子 = 全部世界线(写好的 + 空槽);
· 一道光沿着格子来回扫,写好的世界线按编号一格一格点亮成它自己的颜色(空槽保持虚线);
· 星系第一帧画好(galaxy.js 的 onReady)→ JZGate.open():光环向外炸开、格子散开、星门淡出,
正好接上 galaxy.js 自己的镜头俯冲入场;
· 打不开 3D(老设备 / 没 WebGL)→ JZGate.fail(说明):星门停住,换成说明文字,下面的档案照样能看;
· 系统要求「减少动效」:不扫、不炸,直接淡出。 */
(function () {
'use strict';
var gate = document.getElementById('uGate'); if (!gate) return;
var reduce = matchMedia('(prefers-reduced-motion: reduce)').matches;
var msg = document.getElementById('uGateMsg'), slots = document.getElementById('uGateSlots');
var uv = window.JZP && window.JZP.universes ? window.JZP.universes() : { lit: [], empty: [], looks: {} };
var all = uv.lit.concat(uv.empty).sort(function (a, b) { return a.no < b.no ? -1 : 1; });
slots.innerHTML = all.map(function (u, i) {
var lk = uv.looks[u.no] || {}, c = u.empty ? '' : (lk.accent || u.tone || '#9A6BE0');
var e = window.JZP ? window.JZP.esc : function (x) { return String(x).replace(/[&<>"']/g, ''); };
return '<i class="' + (u.empty ? 'e' : 'l') + '" style="--i:' + i + (c ? ';--c:' + e(c) : '') + '" title="' + e(u.no) + '"></i>';
}).join('');
gate.style.setProperty('--n', all.length);
gate.classList.add('scan');
var t0 = performance.now(), opened = false;
/* 下载慢的时候换几句话,别让人以为卡死了 */
var lines = ['正在打开星门…', '正在装载星系引擎…', '正在排布 ' + all.length + ' 条世界线…', '马上就好…'];
var li = 0, lt = setInterval(function () { if (!opened && li < lines.length - 1) msg.textContent = lines[++li]; }, 1400);
window.JZGate = {
open: function () {
if (opened) return; opened = true; clearInterval(lt);
/* 至少让扫描走完一轮(约 1.1 秒),太快打开反而像闪了一下 */
var wait = reduce ? 0 : Math.max(0, 1100 - (performance.now() - t0));
setTimeout(function () {
msg.textContent = '已点亮 ' + uv.lit.length + ' 条世界线';
gate.classList.add('open');
setTimeout(function () { gate.remove(); }, reduce ? 300 : 1300);
}, wait);
},
fail: function (text) {
opened = true; clearInterval(lt);
gate.classList.remove('scan'); gate.classList.add('failed'); msg.textContent = text;
}
};
})();