summaryrefslogtreecommitdiff
path: root/assets/js/common.js
diff options
context:
space:
mode:
Diffstat (limited to 'assets/js/common.js')
-rw-r--r--assets/js/common.js22
1 files changed, 22 insertions, 0 deletions
diff --git a/assets/js/common.js b/assets/js/common.js
new file mode 100644
index 0000000..4668316
--- /dev/null
+++ b/assets/js/common.js
@@ -0,0 +1,22 @@
+let style = document.createElement("style");
+
+if (window.MistAndroid) {
+ style.innerHTML =
+ `:root {
+ --android-navigation-bar: ${window.MistAndroid.getNavigationBarHeight()}px;
+ --android-status-bar: ${window.MistAndroid.getStatusBarHeight()}px;
+ }`;
+} else {
+ style.innerHTML =
+ `:root {
+ --android-navigation-bar: 0px;
+ --android-status-bar: 0px;
+ }`;
+}
+
+document.head.append(style);
+
+if (navigator.userAgent.includes("MistNative/darwin") || navigator.userAgent.includes("MistNative/win32")) {
+ document.getElementById("native-css").disabled = false;
+ document.body.classList.remove("crossplatform");
+} \ No newline at end of file