feat(HEL-72): 手机端底部五入口导航栏改版
Co-authored-by: multica-agent <github@multica.ai>
This commit is contained in:
@@ -32,8 +32,29 @@
|
||||
|
||||
global.MobileTheme = { readTheme: readTheme, applyTheme: applyTheme, toggle: toggle };
|
||||
|
||||
function syncKeyboardInset() {
|
||||
const app = document.getElementById("m-app");
|
||||
const visual = global.visualViewport;
|
||||
if (!visual) {
|
||||
app.style.setProperty("--m-keyboard-inset", "0px");
|
||||
return;
|
||||
}
|
||||
const inset = Math.max(0, global.innerHeight - visual.height - visual.offsetTop);
|
||||
app.style.setProperty("--m-keyboard-inset", inset + "px");
|
||||
}
|
||||
|
||||
function bindViewport() {
|
||||
const visual = global.visualViewport;
|
||||
if (visual) {
|
||||
visual.addEventListener("resize", syncKeyboardInset);
|
||||
visual.addEventListener("scroll", syncKeyboardInset);
|
||||
}
|
||||
syncKeyboardInset();
|
||||
}
|
||||
|
||||
async function boot() {
|
||||
applyTheme(readTheme());
|
||||
bindViewport();
|
||||
let session = { authenticated: false };
|
||||
try {
|
||||
session = await global.MobileSession.me();
|
||||
@@ -44,7 +65,7 @@
|
||||
if (!session.authenticated) {
|
||||
if (!/^#\/?auth/.test(hash)) global.location.replace("#/auth");
|
||||
} else if (/^#\/?auth/.test(hash)) {
|
||||
global.location.replace("#/home");
|
||||
global.location.replace("#/hub/market");
|
||||
}
|
||||
global.MobileRouter.init();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user