Fix mobile screen funkiness by smashing it with a big hammer Fixes #2879

2b10954002147fdd684d066a61140781eaa68fa9

Cohee <18619528+Cohee1207@users.noreply.github.com>

2 files changed, +18 -9Showing whitespace changes
public/css/mobile-styles.css+8 -9
@@ -103,7 +103,6 @@
103 touch-action: none;103 touch-action: none;
104 overflow: hidden;104 overflow: hidden;
105 position: fixed;105 position: fixed;
106
107 }106 }
108107
109 .world_entry_form_control {108 .world_entry_form_control {
@@ -112,7 +111,7 @@
112111
113 .drawer-content {112 .drawer-content {
114 min-width: unset;113 min-width: unset;
115 width: 100%;114 width: 100dvw;
116 max-height: calc(100vh - 45px);115 max-height: calc(100vh - 45px);
117 max-height: calc(100dvh - 45px);116 max-height: calc(100dvh - 45px);
118 position: fixed;117 position: fixed;
@@ -159,9 +158,9 @@
159 #sheld,158 #sheld,
160 #character_popup,159 #character_popup,
161 .drawer-content {160 .drawer-content {
162 width: 100% !important;161 width: 100dvw !important;
163 margin: 0 auto;162 margin: 0 auto;
164 max-width: 100%;163 max-width: 100dvw;
165 left: 0 !important;164 left: 0 !important;
166 resize: none !important;165 resize: none !important;
167 top: var(--topBarBlockSize);166 top: var(--topBarBlockSize);
@@ -233,9 +232,9 @@
233 /* 100vh are fallback units for browsers that don't support dvh */232 /* 100vh are fallback units for browsers that don't support dvh */
234 height: calc(100vh - 45px);233 height: calc(100vh - 45px);
235 height: calc(100dvh - 45px);234 height: calc(100dvh - 45px);
236 min-width: 100% !important;235 min-width: 100dvw !important;
237 width: 100% !important;236 width: 100dvw !important;
238 max-width: 100% !important;237 max-width: 100dvw !important;
239 overflow-y: hidden;238 overflow-y: hidden;
240 border-left: 1px solid var(--SmartThemeBorderColor);239 border-left: 1px solid var(--SmartThemeBorderColor);
241 border-right: 1px solid var(--SmartThemeBorderColor);240 border-right: 1px solid var(--SmartThemeBorderColor);
@@ -481,10 +480,10 @@
481 margin: 0 auto;480 margin: 0 auto;
482 height: calc(100vh - 70px);481 height: calc(100vh - 70px);
483 height: calc(100dvh - 70px);482 height: calc(100dvh - 70px);
484 width: calc(100% - 5px);483 width: calc(100dvw - 5px);
485 max-height: calc(100vh - 70px);484 max-height: calc(100vh - 70px);
486 max-height: calc(100dvh - 70px);485 max-height: calc(100dvh - 70px);
487 max-width: calc(100% - 5px);486 max-width: calc(100dvw - 5px);
488487
489 }488 }
490489
public/scripts/RossAscends-mods.js+10 -0
@@ -737,6 +737,16 @@ export function initRossMods() {
737 RA_autoconnect();737 RA_autoconnect();
738 }738 }
739739
740 if (isMobile()) {
741 const fixFunkyPositioning = () => {
742 console.debug('[Mobile] Device viewport change detected.');
743 document.documentElement.style.position = 'fixed';
744 requestAnimationFrame(() => document.documentElement.style.position = '');
745 };
746 window.addEventListener('resize', fixFunkyPositioning);
747 window.addEventListener('orientationchange', fixFunkyPositioning);
748 }
749
740 $('#main_api').change(function () {750 $('#main_api').change(function () {
741 var PrevAPI = main_api;751 var PrevAPI = main_api;
742 setTimeout(() => RA_autoconnect(PrevAPI), 100);752 setTimeout(() => RA_autoconnect(PrevAPI), 100);