summaryrefslogtreecommitdiff
path: root/assets/js/common.js
blob: 4668316b2ff10a85ec0d0383fb8695d7afd04a6a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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");
}