全站按设计预览站重做(门户改多页 + 下单页对齐)、新加载动画、金钻宇宙开场星门;站点信息集中到 site-info.js

Browse Source
- 门户:单页改成 index / gallery / tools / universe / links / about 六页,标记 / 样式 / 交互照预览站;内容照旧读 content/site.js
- 画展:预览站作品墙 + 原有全部功能(筛选、排序、看过的、高清、本站视频、B 站、全景、动态壁纸、观展统计、外链);按最矮列投放保证时间顺序
- 加载动画 boot.js:像素钻石垒成形 → 白光 → 店名逐字 → 进度条 → 幕布上收(每个标签页只放一次,减少动效时不放)
- 金钻宇宙开场 gate.js:星门(钻石 + 光谱环 + 世界线格子逐个点亮),星系画好后炸开接镜头俯冲
- 下单页:全站顶栏 / 底栏 / 页脚、宽版面、落地「怎么下单?」两张路卡 + 下过单了 + 模板样图;下单逻辑和按钮 id 不动
- 站点固定信息(域名 / 群号 / 备案号 / 邮箱)只在 assets/site-info.js,仓库是占位,正式服务器只换这一个文件
- 像素字体换成常用 3755 字 + 全部内容的子集(门户和下单页共用);旧链接 /#/板块、/#0001 自动跳新页
- 交接文档 / 星系图说明 / nginx 片段同步更新

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
yws
2026-10-06 06:15:44 +00:00
co-authored by Claude Opus 5.5
parent b83511ff55
commit fd72f7192e
23 changed files with 2555 additions and 4892 deletions
+94
View File
@@ -0,0 +1,94 @@
/* 金钻客栈 · 加载动画(2026-10-06 重做)
---------------------------------------------------------------------------
像素钻石一块一块从上面落下来、从底往上垒成形(像 MC 里堆方块)→ 一道白光扫过钻石 →「金钻客栈」逐字弹出
→ 底下一条光谱色进度条跟着页面真实加载走 → 整块幕布往上收起,露出页面。
· 只在这个标签页第一次打开网站时放(sessionStorage 记一下),之后站内换页不再放;
· 系统设置了「减少动效」就完全不放(页面里那段内联脚本直接把幕布删掉);
· 最少放 1.25 秒(垒完 + 白光扫过;太短一闪而过很怪),页面 3 秒还没加载完也照样收起,绝不卡人。 */
(function () {
'use strict';
var boot = document.getElementById('jzBoot');
if (!boot) return;
var root = document.documentElement;
var cv = boot.querySelector('canvas'), ctx = cv.getContext('2d'), bar = boot.querySelector('.jz-boot-bar i');
var name = boot.querySelector('.jz-boot-name');
var N = 14, CELL = cv.width / N, T0 = performance.now(), MIN = 1250, MAX = 3000, done = false, ready = false;
var blocks = [];
/* 把每个字拆开,好一个个弹出来 */
name.innerHTML = name.textContent.split('').map(function (c, i) { return '<span style="--i:' + i + '">' + c + '</span>'; }).join('');
/* 钻石原图是 14×14 的像素画:按格子中心取色,得到要垒的方块 */
var src = new Image();
src.onload = function () {
var t = document.createElement('canvas'); t.width = t.height = N;
var tc = t.getContext('2d'); tc.imageSmoothingEnabled = false; tc.drawImage(src, 0, 0, N, N);
var d = tc.getImageData(0, 0, N, N).data;
for (var y = 0; y < N; y++) for (var x = 0; x < N; x++) {
var k = (y * N + x) * 4;
if (d[k + 3] < 128) continue;
/* 落下的先后:从底往上一层层垒,同一层里左右随机一点 */
var order = (N - 1 - y) + Math.random() * 0.9;
blocks.push({ x: x, y: y, c: 'rgb(' + d[k] + ',' + d[k + 1] + ',' + d[k + 2] + ')', t: order });
}
var maxT = 0; blocks.forEach(function (b) { if (b.t > maxT) maxT = b.t; });
blocks.forEach(function (b) { b.t = b.t / maxT; }); // 0..1
requestAnimationFrame(frame);
};
src.src = 'assets/gem.webp';
var BUILD = 620, FALL = 260; // 整颗垒完 620ms,每块落 260ms
function frame(now) {
var el = now - T0;
ctx.clearRect(0, 0, cv.width, cv.height);
var built = true;
for (var i = 0; i < blocks.length; i++) {
var b = blocks[i], start = b.t * BUILD, k = (el - start) / FALL;
if (k <= 0) { built = false; continue; }
if (k < 1) built = false;
k = Math.min(1, k);
var e = 1 - Math.pow(1 - k, 3); // 落地减速
var y = (b.y - (1 - e) * (b.y + 3)) * CELL;
ctx.globalAlpha = Math.min(1, k * 2.2);
ctx.fillStyle = b.c; ctx.fillRect(b.x * CELL, y, CELL, CELL);
/* 每块顶上一道亮边、底下一道暗边:方块感 */
ctx.globalAlpha *= 0.28;
ctx.fillStyle = '#fff'; ctx.fillRect(b.x * CELL, y, CELL, 2);
ctx.fillStyle = '#000'; ctx.fillRect(b.x * CELL, y + CELL - 2, CELL, 2);
}
ctx.globalAlpha = 1;
/* 垒完以后一道白光斜着扫过钻石 */
var sw = (el - BUILD - FALL) / 520;
if (sw > 0 && sw < 1) {
ctx.save(); ctx.globalCompositeOperation = 'source-atop';
var gx = -cv.width * 0.6 + sw * cv.width * 2.2;
var g = ctx.createLinearGradient(gx, 0, gx + cv.width * 0.5, cv.height);
g.addColorStop(0, 'rgba(255,255,255,0)'); g.addColorStop(0.5, 'rgba(255,255,255,.85)'); g.addColorStop(1, 'rgba(255,255,255,0)');
ctx.fillStyle = g; ctx.fillRect(0, 0, cv.width, cv.height); ctx.restore();
}
if (built && !boot.classList.contains('built')) boot.classList.add('built'); // 字开始弹出
/* 进度条:一半看时间(让动画走完),一半看页面真加载完没有 */
var p = Math.min(1, el / (BUILD + FALL + 300)) * (ready ? 1 : 0.82);
bar.style.transform = 'scaleX(' + Math.max(p, parseFloat(bar.dataset.p || 0)).toFixed(3) + ')';
bar.dataset.p = p;
if (boot.isConnected) requestAnimationFrame(frame);
}
function finish() {
if (done) return;
var el = performance.now() - T0;
if (el < MIN) { setTimeout(finish, MIN - el); return; }
done = true;
bar.style.transform = 'scaleX(1)';
try { sessionStorage.setItem('jz-boot', '1'); } catch (e) {}
setTimeout(function () {
boot.classList.add('leave'); root.classList.remove('booting'); root.classList.add('booted');
setTimeout(function () { boot.remove(); }, 700);
}, 160);
}
function onReady() { ready = true; finish(); }
if (document.readyState === 'complete') onReady(); else addEventListener('load', onReady, { once: true });
setTimeout(function () { ready = true; finish(); }, MAX);
/* 点一下就跳过 */
boot.addEventListener('click', function () { ready = true; T0 -= MIN; finish(); });
})();