testing ags

This commit is contained in:
cnst
2024-07-15 14:39:56 +02:00
parent 91e09c461b
commit 2f32e46601
55 changed files with 2218 additions and 22 deletions

View File

@@ -0,0 +1,30 @@
import { Audio, Icons } from "../imports.js";
export const audioIcon = () => {
if (Audio.speaker?.stream.isMuted) return Icons.volume.muted;
const vol = Audio.speaker?.volume * 100;
const icon = [
[101, "overamplified"],
[67, "high"],
[34, "medium"],
[1, "low"],
[0, "muted"],
].find(([threshold]) => threshold <= vol)[1];
return Icons.volume[icon];
};
export const micIcon = () => {
if (Audio.microphone?.stream.isMuted) return Icons.microphone.muted;
const vol = Audio.microphone?.volume * 100;
const icon = [
[67, "high"],
[34, "medium"],
[1, "low"],
[0, "muted"],
].find(([threshold]) => threshold <= vol)[1];
return Icons.microphone[icon];
};