diff --git a/app/static/app.js b/app/static/app.js index 80a3fcb..1895fa6 100644 --- a/app/static/app.js +++ b/app/static/app.js @@ -13,6 +13,7 @@ let filterPlatform = 0; const checkingIds = new Set(); let historyCache = {}; + let hasRendered = false; // 首次渲染保留进入动画,自动刷新静默更新 const accountWindows = {}; // {accountId: 'all'|'1h'|'1d'|'1w'|'1mo'|'1yr'} const windowCache = {}; // {'aid:win': [...]} @@ -149,8 +150,9 @@ platforms = plat; historyCache = hist || {}; providersList = provs || []; - renderAccounts(); - if (!document.getElementById("view-platforms").classList.contains("hidden")) renderPlatforms(); + renderAccounts(!hasRendered); + if (!document.getElementById("view-platforms").classList.contains("hidden")) renderPlatforms(!hasRendered); + hasRendered = true; const d = new Date(); document.getElementById("refresh-time").textContent = d.toLocaleTimeString("zh-CN", { hour12: false }); @@ -174,7 +176,7 @@ return { cls: "pending", text: "待检查" }; } - function accountCard(a, idx) { + function accountCard(a, idx, animate = true) { const st = statusInfo(a); const plat = platforms.find((p) => p.id === a.platform_id) || {}; const b = brandStyle(plat.icon || ""); @@ -188,6 +190,7 @@ st.cls === "disabled" ? "disabled" : "", st.cls === "pending" ? "pending" : "", ].join(" ").trim(); + const animStyle = animate ? `animation-delay:${Math.min(idx, 12) * 40}ms` : "animation:none"; const win = accountWindows[a.id] || "all"; let hist; if (win === "all") { @@ -203,7 +206,7 @@ ? `` : ``; return ` -