A browser source overlay for winter vibes for your Live Streams or Videos
1document.onclick = hideMenu;
2document.oncontextmenu = rightClick;
3
4function hideMenu() {
5 document.getElementById("contextMenu").style.display = "none"
6}
7
8function rightClick(e) {
9 e.preventDefault();
10
11 if (document.getElementById(
12 "contextMenu").style.display == "block")
13 hideMenu();
14 else {
15 let menu = document
16 .getElementById("contextMenu")
17
18 menu.style.display = 'block';
19 menu.style.left = e.pageX + "px";
20 menu.style.top = e.pageY + "px";
21 }
22}
23
24/**
25 * @param {string} modalId
26 * @param {boolean} isShowing
27 */
28function toggleModal(modalId, isShowing) {
29 const modal = document.getElementById(modalId);
30 if (isShowing) {
31 console.log(modalId, isShowing);
32 modal.style.display = isShowing ? 'block' : 'none';
33 }
34}
35
36export { toggleModal };