From d99a619e26f38c729d74d8dc585e8ce13236ffb7 Mon Sep 17 00:00:00 2001 From: Caleb Date: Thu, 8 Sep 2022 00:51:31 -0400 Subject: Removed all window functions from client --- webAO/dom/switchAspectRatio.ts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 webAO/dom/switchAspectRatio.ts (limited to 'webAO/dom/switchAspectRatio.ts') diff --git a/webAO/dom/switchAspectRatio.ts b/webAO/dom/switchAspectRatio.ts new file mode 100644 index 0000000..79d4110 --- /dev/null +++ b/webAO/dom/switchAspectRatio.ts @@ -0,0 +1,19 @@ +/** + * Triggered by the change aspect ratio checkbox + */ +export async function switchAspectRatio() { + const background = document.getElementById("client_gamewindow")!; + const offsetCheck = ( + document.getElementById("client_hdviewport_offset") + ); + if ( + (document.getElementById("client_hdviewport")).checked + ) { + background.style.paddingBottom = "56.25%"; + offsetCheck.disabled = false; + } else { + background.style.paddingBottom = "75%"; + offsetCheck.disabled = true; + } +} +window.switchAspectRatio = switchAspectRatio; \ No newline at end of file -- cgit