Speed up top nav with turbo routing and external base CSS.

Remove view-transition lag, swap main content without full reload, prefetch pages, and tear down SSE timers on leave.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-06-26 20:47:22 +08:00
parent ddfe2a52aa
commit c79bb2ea4b
16 changed files with 865 additions and 548 deletions
+11 -2
View File
@@ -39,11 +39,20 @@
.catch(function () { /* ignore */ });
}
function stopPolling() {
if (timer) {
clearInterval(timer);
timer = null;
}
}
function startPolling() {
if (timer) clearInterval(timer);
stopPolling();
pollPrices();
timer = setInterval(pollPrices, 1000);
}
document.addEventListener('DOMContentLoaded', startPolling);
if (window.qihuoOnPageLoad) window.qihuoOnPageLoad(startPolling);
else document.addEventListener('DOMContentLoaded', startPolling);
if (window.qihuoOnPageLeave) window.qihuoOnPageLeave(stopPolling);
})();