mirror of
https://github.com/unanmed/HumanBreak.git
synced 2026-11-02 09:15:05 +08:00
feat: 适配APP横屏
This commit is contained in:
1 parent
518f5a5815
commit
471b3071f9
4 files changed
+23
-6
No files matched your search
@@ -385,12 +385,20 @@ export async function triggerFullscreen(full: boolean) {
|
||||
if (!Mota.Plugin.inited) return;
|
||||
const { maxGameScale } = Mota.Plugin.require('utils_g');
|
||||
if (!!document.fullscreenElement && !full) {
|
||||
if (window.jsinterface) {
|
||||
window.jsinterface.requestPortrait();
|
||||
return;
|
||||
}
|
||||
await document.exitFullscreen();
|
||||
requestAnimationFrame(() => {
|
||||
maxGameScale(1);
|
||||
});
|
||||
}
|
||||
if (full && !document.fullscreenElement) {
|
||||
if (window.jsinterface) {
|
||||
window.jsinterface.requestLandscape();
|
||||
return;
|
||||
}
|
||||
await document.body.requestFullscreen();
|
||||
requestAnimationFrame(() => {
|
||||
maxGameScale();
|
||||
|
||||
Reference in new issue
Block a user