From e783f9e4885a45b37ba6b76b75c819ad7db863a7 Mon Sep 17 00:00:00 2001 From: ian ramzy Date: Sat, 28 Mar 2020 13:43:08 -0400 Subject: [PATCH] screen share btn waits to update, remove outline, fade out logo --- public/css/chat.css | 4 ++++ public/js/chat.js | 22 ++++++++++++---------- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/public/css/chat.css b/public/css/chat.css index abfa6e2..2c6e347 100644 --- a/public/css/chat.css +++ b/public/css/chat.css @@ -164,6 +164,10 @@ button { padding: 10px; } +button:focus { + outline: none; +} + button:hover { color: white; border-radius: 100px; diff --git a/public/js/chat.js b/public/js/chat.js index 0d62f47..e789332 100644 --- a/public/js/chat.js +++ b/public/js/chat.js @@ -63,7 +63,7 @@ var VideoChat = { }).then(stream => { VideoChat.onMediaStream(stream); $('#local-video-text').text("Drag Me"); - setTimeout(() => $('#local-video-text').hide(), 5000); + setTimeout(() => $('#local-video-text').fadeOut(), 5000); }).catch(error => { logIt(error); logIt('Failed to get local webcam video, check webcam privacy settings'); @@ -341,12 +341,13 @@ function pauseVideo() { } -//Show and hide buttons automatically +// Fade out / show UI on mouse move var timedelay = 1; function delayCheck() { if (timedelay === 5) { $('.multi-button').fadeOut(); + $('#header').fadeOut(); timedelay = 1; } timedelay = timedelay + 1; @@ -354,6 +355,7 @@ function delayCheck() { $(document).mousemove(function () { $('.multi-button').fadeIn(); + $('#header').fadeIn(); timedelay = 1; clearInterval(_delay); _delay = setInterval(delayCheck, 500); @@ -399,25 +401,25 @@ function swap() { const swapIcon = document.getElementById("swap-icon"); const swapText = document.getElementById("swap-text"); if (mode === "camera") { - mode = "screen"; - swapIcon.classList.remove("fa-desktop"); - swapIcon.classList.add("fa-camera"); - swapText.innerText = "Share Webcam"; navigator.mediaDevices.getDisplayMedia({ video: true, audio: true }).then(function (stream) { + mode = "screen"; + swapIcon.classList.remove("fa-desktop"); + swapIcon.classList.add("fa-camera"); + swapText.innerText = "Share Webcam"; switchStreamHelper(stream); }); } else { - mode = "camera"; - swapIcon.classList.remove("fa-camera"); - swapIcon.classList.add("fa-desktop"); - swapText.innerText = "Share Screen"; navigator.mediaDevices.getUserMedia({ video: true, audio: true }).then(function (stream) { + mode = "camera"; + swapIcon.classList.remove("fa-camera"); + swapIcon.classList.add("fa-desktop"); + swapText.innerText = "Share Screen"; switchStreamHelper(stream); }); }