Skip to content

Commit

Permalink
Fixed bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
lChap701 committed Oct 1, 2021
1 parent 16558bd commit d65a245
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
11 changes: 9 additions & 2 deletions public/js/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,18 @@ const message = document.querySelector("input[name='message']");
const invite = document.querySelector("button#invite");
const video = document.querySelector("button#video");
const audio = document.querySelector("button#audio");
const msgContainer = document.querySelector("#message-container");
const messages = document.querySelector("#messages");
const remoteVideo = document.querySelector("#remoteVideo");
let myVideoStream;
let newUser;

window.addEventListener("resize", () => {
if (window.innerWidth > 1190) {
msgContainer.removeAttribute("style");
}
});

/* Attempts to send a message when the 'send' button is clicked */
document.querySelector("button#send").addEventListener("click", () => {
if (message.value.trim().length !== 0) {
Expand All @@ -43,12 +50,12 @@ invite.addEventListener("click", () => {

/* Displays chat for smaller devices */
document.querySelector("button#chat").addEventListener("click", () => {
document.querySelector("#message-container").style.display = "flex";
msgContainer.style.display = "flex";
});

/* Hides chat for smaller devices */
document.querySelector("button#back").addEventListener("click", () => {
document.querySelector("#message-container").style.display = "none";
msgContainer.style.display = "none";
});

/* Disables or enables access to camera */
Expand Down
2 changes: 1 addition & 1 deletion public/js/script.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit d65a245

Please sign in to comment.