aboutsummaryrefslogtreecommitdiff
path: root/webAO/dom/switchAspectRatio.ts
blob: 79d4110663644e0ceab0b3b66130451da1010548 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/**
 * Triggered by the change aspect ratio checkbox
 */
export async function switchAspectRatio() {
    const background = document.getElementById("client_gamewindow")!;
    const offsetCheck = <HTMLInputElement>(
        document.getElementById("client_hdviewport_offset")
    );
    if (
        (<HTMLInputElement>document.getElementById("client_hdviewport")).checked
    ) {
        background.style.paddingBottom = "56.25%";
        offsetCheck.disabled = false;
    } else {
        background.style.paddingBottom = "75%";
        offsetCheck.disabled = true;
    }
}
window.switchAspectRatio = switchAspectRatio;