aboutsummaryrefslogtreecommitdiff
path: root/webAO/dom/changeBlipVolume.ts
diff options
context:
space:
mode:
authorstonedDiscord <Tukz@gmx.de>2022-09-10 17:19:52 +0200
committerGitHub <noreply@github.com>2022-09-10 17:19:52 +0200
commit657d2944135a80cda846b14ddbccd055c5b45896 (patch)
tree32bffa6a2cb8cc3aca3a6e3fd36ac6847561da53 /webAO/dom/changeBlipVolume.ts
parentabba7630e13f7e5269c14c2c43b66b03559ddfe3 (diff)
parent108636666d474119892c4b3a2f3beadb767b006e (diff)
Merge pull request #174 from caleb-mabry/viewport-movement
Structured viewport a little differently
Diffstat (limited to 'webAO/dom/changeBlipVolume.ts')
-rw-r--r--webAO/dom/changeBlipVolume.ts15
1 files changed, 15 insertions, 0 deletions
diff --git a/webAO/dom/changeBlipVolume.ts b/webAO/dom/changeBlipVolume.ts
new file mode 100644
index 0000000..572f389
--- /dev/null
+++ b/webAO/dom/changeBlipVolume.ts
@@ -0,0 +1,15 @@
+import setCookie from "../utils/setCookie";
+import { client } from '../client'
+/**
+ * Triggered by the blip volume slider.
+ */
+export const changeBlipVolume = () => {
+ const blipVolume = (<HTMLInputElement>(
+ document.getElementById("client_bvolume")
+ )).value;
+ client.viewport.blipChannels.forEach(
+ (channel: HTMLAudioElement) => (channel.volume = Number(blipVolume))
+ );
+ setCookie("blipVolume", blipVolume);
+}
+window.changeBlipVolume = changeBlipVolume;