feat: glass effect toggle, media refresh timing fix, page transition perf

This commit is contained in:
2026-08-16 18:42:04 +08:00
parent a65205b8d2
commit 6915c54832
9 changed files with 119 additions and 23 deletions
+11 -4
View File
@@ -29,9 +29,16 @@ const router = {
// always occupies space; only toggle visibility to avoid shifting icons)
const clock = document.getElementById('rail-clock');
if (clock) clock.style.visibility = (id === 'home') ? 'hidden' : 'visible';
if (id === 'home') window.updateHomeCards && window.updateHomeCards();
if (id === 'applist') window.loadAppList && window.loadAppList();
if (id === 'webapplist') window.loadWebAppList && window.loadWebAppList();
if (id === 'settings') window.loadSettings && window.loadSettings();
// 延迟内容加载到下一帧:让切换动画先流畅播放,避免加载重活(查应用/拉清单)
// 在动画帧内阻塞导致卡顿
// Defer content loading to the next frame: let the switch animation play
// smoothly first, avoiding jank from heavy loads (app query / manifest fetch)
// blocking within the animation frame
requestAnimationFrame(() => {
if (id === 'home') window.updateHomeCards && window.updateHomeCards();
if (id === 'applist') window.loadAppList && window.loadAppList();
if (id === 'webapplist') window.loadWebAppList && window.loadWebAppList();
if (id === 'settings') window.loadSettings && window.loadSettings();
});
}
};