diff options
| author | sD <stoned@derpymail.org> | 2020-05-27 00:53:34 +0200 |
|---|---|---|
| committer | sD <stoned@derpymail.org> | 2020-05-27 00:53:34 +0200 |
| commit | 031142136fe86e23188e8f799517bad9b8719573 (patch) | |
| tree | 32ae1e9d14c14ecf338204b20e240b87f3e7ac58 /webAO/client.js | |
| parent | 45cfbb2063a9c8a1e2ef25fe636c8e00f392707d (diff) | |
let the user change the viewport size to 16:9
Diffstat (limited to 'webAO/client.js')
| -rw-r--r-- | webAO/client.js | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/webAO/client.js b/webAO/client.js index de269be..ebaa09e 100644 --- a/webAO/client.js +++ b/webAO/client.js @@ -2198,6 +2198,37 @@ export async function iniedit() { window.iniedit = iniedit; /** + * Triggered by the change aspect ratio checkbox + */ +export async function switchAspectRatio() { + const background = document.getElementById("client_background"); + 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; + +/** + * Triggered by the change aspect ratio checkbox + */ +export async function switchChatOffset() { + const container = document.getElementById("client_chatcontainer"); + if(document.getElementById("client_hdviewport_offset").checked) { + container.style.width = "80%"; + container.style.left = "10%"; + } else { + container.style.width = "100%"; + container.style.left = 0; + } +} +window.switchChatOffset = switchChatOffset; + +/** * Triggered when a character icon is clicked in the character selection menu. * @param {MouseEvent} event */ |
