diff --git a/app/assets/images/favicon.ico b/app/assets/images/favicon.ico new file mode 100644 index 0000000..1fcd3c7 Binary files /dev/null and b/app/assets/images/favicon.ico differ diff --git a/app/assets/javascripts/signaling-server.js b/app/assets/javascripts/signaling-server.js index 25db06a..e8a88c0 100644 --- a/app/assets/javascripts/signaling-server.js +++ b/app/assets/javascripts/signaling-server.js @@ -16,10 +16,12 @@ let pcPeers = {}; // peer connection let localstream; window.onload = () => { - currentUser = document.getElementById("current-user").innerHTML; - console.log(currentUser) - localVideo = document.getElementById("local-video"); - remoteVideoContainer = document.getElementById("remote-video-container"); + // if (document.getElementById("current-user")) { + currentUser = document.getElementById("current-user").innerHTML; + console.log(currentUser) + localVideo = document.getElementById("local-video"); + remoteVideoContainer = document.getElementById("remote-video-container"); + // } }; // Ice Credentials @@ -35,8 +37,10 @@ document.onreadystatechange = async () => { }) localstream = stream; - localVideo.srcObject = stream - localVideo.muted = true + // if (localVideo) { + localVideo.srcObject = stream + localVideo.muted = true + // } } catch (e) { console.error(e); } } }; @@ -67,7 +71,11 @@ document.onreadystatechange = async () => { // } // }); // }; -const chatroomId = document.getElementById('chatroom-hook').dataset["chatroomId"] + +// if (document.getElementById('chatroom-hook')) { + const chatroomId = document.getElementById('chatroom-hook').dataset["chatroomId"] + +// } const handleJoinSession = async () => { App['chatroom' + chatroomId] = await App.cable.subscriptions.create({ diff --git a/app/assets/stylesheets/pages/_contacts.scss b/app/assets/stylesheets/pages/_contacts.scss index b4c303f..a897fcf 100644 --- a/app/assets/stylesheets/pages/_contacts.scss +++ b/app/assets/stylesheets/pages/_contacts.scss @@ -131,3 +131,31 @@ a:hover { justify-content: center; align-items: center; } + + + + + +.contact { + color: white; +} + +.contacts { + height: 570px; + overflow: scroll; +} + + + + + + + + + + + + + + + diff --git a/app/javascript/components/modal.js b/app/javascript/components/modal.js new file mode 100644 index 0000000..25eb307 --- /dev/null +++ b/app/javascript/components/modal.js @@ -0,0 +1,11 @@ + +const triggerModalEvent = () => { + const btn = document.getElementById("modalTrigger"); + const modal = document.getElementById("myModal"); + + btn.addEventListener('click', function(event) { + $('#myModal').modal('show'); + }); +} + +export { triggerModalEvent } diff --git a/app/javascript/packs/application.js b/app/javascript/packs/application.js index b4593fd..8a54864 100644 --- a/app/javascript/packs/application.js +++ b/app/javascript/packs/application.js @@ -1,4 +1,9 @@ import "bootstrap"; -import { profilePageAnimation } from '../users/lesson'; -profilePageAnimation(); +import { triggerModalEvent } from "../components/modal.js"; + +triggerModalEvent(); + +// import { profilePageAnimation } from '../users/lesson'; + +// profilePageAnimation(); diff --git a/app/javascript/packs/modal.js b/app/javascript/packs/modal.js deleted file mode 100644 index e9249f1..0000000 --- a/app/javascript/packs/modal.js +++ /dev/null @@ -1,8 +0,0 @@ -import "bootstrap"; - -const btn = document.getElementById("modalTrigger"); -const modal = document.getElementById("myModal"); - -btn.addEventListener('click', function(event) { - $('#myModal').modal('show'); -}); diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 7118264..99d6833 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -3,6 +3,7 @@
+ <%= favicon_link_tag 'favicon.ico' %>