feat: h5 desktop shell with sidebar and dark mode
- tokens.css/app.css: Miuix dual-color tokens + HyperOS 4 soft-glass rail - bridge.js/router.js: Promise bridge wrapper + 5-page router with top clock - index.html: sidebar + 5 page containers - native wallpaper transparency: Theme.Hearth (showWallpaper + transparent window) + WebView transparent background
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
// 桌面路由:侧边栏 5 页 + 页面切换 + 顶部时间
|
||||
// Launcher router: 5 sidebar pages + page switching + top clock
|
||||
const PAGES = [
|
||||
{ id: 'home', label: '首页', icon: '🏠' },
|
||||
{ id: 'immersive', label: '沉浸首页', icon: '🚗' },
|
||||
{ id: 'webapplist', label: 'H5 应用', icon: '🌐' },
|
||||
{ id: 'applist', label: '安卓 APP', icon: '📱' },
|
||||
{ id: 'settings', label: '设置', icon: '⚙️' },
|
||||
];
|
||||
|
||||
const router = {
|
||||
current: 'home',
|
||||
navigate(id) {
|
||||
this.current = id;
|
||||
document.querySelectorAll('[data-page]').forEach(el =>
|
||||
el.classList.toggle('active', el.dataset.page === id));
|
||||
// 非首页时侧边栏顶部显示小时间
|
||||
// Show the small clock at the sidebar top when not on home
|
||||
const clock = document.getElementById('rail-clock');
|
||||
if (clock) clock.style.display = (id === 'home') ? 'none' : 'block';
|
||||
if (id === 'home') window.updateHomeCards && window.updateHomeCards();
|
||||
if (id === 'applist') window.loadAppList && window.loadAppList();
|
||||
if (id === 'webapplist') window.loadWebAppList && window.loadWebAppList();
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user