diff --git a/chatto/src/main/resources/static/css/chat.css b/chatto/src/main/resources/static/css/chat.css index e29194f..50c704b 100644 --- a/chatto/src/main/resources/static/css/chat.css +++ b/chatto/src/main/resources/static/css/chat.css @@ -7,6 +7,18 @@ html { background: linear-gradient(to right, #91EAE4, #86A8E7, #7F7FD5); } +.user-box:hover { + background-color: rgba(0, 0, 0, 0.1); +} + +.active:hover { + background-color: rgba(0, 0, 0, 0.4); +} + +.no-user-selected-h2 { + color: rgba(255, 255, 255, 0.4); +} + .chat { margin-top: auto; margin-bottom: auto; diff --git a/chatto/src/main/resources/static/js/chat.js b/chatto/src/main/resources/static/js/chat.js index 971e0c7..d6cdaec 100644 --- a/chatto/src/main/resources/static/js/chat.js +++ b/chatto/src/main/resources/static/js/chat.js @@ -57,8 +57,16 @@ for (let i = 0; i < userBoxes.length; i++) { let current = document.getElementsByClassName('user-box active'); if (current.length > 0) { current[0].className = current[0].className.replace(" active", ""); + } // Add the active class to the current/clicked button + else if (current.length == 0) { + document.getElementById('no-user-selected').hidden = true; + document.getElementById('chat-card').hidden = false; + } + let words = this.innerText.split("\n"); + // console.log(words); + document.getElementById('user-name-span').innerText = 'Chat with ' + words[1]; this.className += " active"; }) } diff --git a/chatto/src/main/resources/templates/chat.html b/chatto/src/main/resources/templates/chat.html index 71dce53..a6cb09e 100644 --- a/chatto/src/main/resources/templates/chat.html +++ b/chatto/src/main/resources/templates/chat.html @@ -44,7 +44,7 @@
-
+
@@ -91,7 +91,16 @@
-
+
+
+
+
+

Please select a user

+
+
+
+
+