feat: glass effect toggle, media refresh timing fix, page transition perf
This commit is contained in:
@@ -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();
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user