FumesAI
commited on
Commit
•
596a8a3
1
Parent(s):
debad34
Update index.html
Browse files- index.html +5 -12
index.html
CHANGED
@@ -63,7 +63,6 @@
|
|
63 |
line-height: 1.5;
|
64 |
margin-right: 0px;
|
65 |
}
|
66 |
-
|
67 |
#ic {
|
68 |
max-width: 90%;
|
69 |
margin: auto;
|
@@ -88,7 +87,6 @@
|
|
88 |
max-width: 95%;
|
89 |
}
|
90 |
}
|
91 |
-
|
92 |
</style>
|
93 |
|
94 |
|
@@ -121,7 +119,9 @@
|
|
121 |
var socket = io.connect('https://fumes-api.onrender.com');
|
122 |
var messages = document.getElementById('chat-messages');
|
123 |
let user = localStorage.getItem("userName")
|
124 |
-
|
|
|
|
|
125 |
|
126 |
user = prompt('Create Your Username')
|
127 |
if(user!=null && user!='' && user!=undefined){
|
@@ -130,6 +130,7 @@
|
|
130 |
break
|
131 |
}
|
132 |
}
|
|
|
133 |
console.log(user)
|
134 |
var userInput = document.getElementById('user-input');
|
135 |
socket.on('user_count', function(data) {
|
@@ -137,7 +138,6 @@
|
|
137 |
document.getElementById('userCount').innerText = `Online Users: ${onlineUsersCount}`
|
138 |
});
|
139 |
function sendMessage() {
|
140 |
-
|
141 |
var message = userInput.value;
|
142 |
if(message.length>1200){
|
143 |
alert('messsage lenght exceeds 1200 chracters!!')
|
@@ -175,8 +175,6 @@
|
|
175 |
|
176 |
messages.appendChild(newMessage);
|
177 |
});
|
178 |
-
|
179 |
-
|
180 |
|
181 |
socket.on('response', function(data) {
|
182 |
var currentMessage = messages.lastChild;
|
@@ -196,7 +194,6 @@ socket.on('response', function(data) {
|
|
196 |
|
197 |
messages.appendChild(currentMessage);
|
198 |
}
|
199 |
-
|
200 |
|
201 |
var responseText = document.createTextNode(data.response);
|
202 |
|
@@ -205,11 +202,7 @@ socket.on('response', function(data) {
|
|
205 |
|
206 |
}
|
207 |
});
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
</script>
|
213 |
</body>
|
214 |
|
215 |
-
</html>
|
|
|
63 |
line-height: 1.5;
|
64 |
margin-right: 0px;
|
65 |
}
|
|
|
66 |
#ic {
|
67 |
max-width: 90%;
|
68 |
margin: auto;
|
|
|
87 |
max-width: 95%;
|
88 |
}
|
89 |
}
|
|
|
90 |
</style>
|
91 |
|
92 |
|
|
|
119 |
var socket = io.connect('https://fumes-api.onrender.com');
|
120 |
var messages = document.getElementById('chat-messages');
|
121 |
let user = localStorage.getItem("userName")
|
122 |
+
console.log(user)
|
123 |
+
if(user==null){
|
124 |
+
while(true){
|
125 |
|
126 |
user = prompt('Create Your Username')
|
127 |
if(user!=null && user!='' && user!=undefined){
|
|
|
130 |
break
|
131 |
}
|
132 |
}
|
133 |
+
}
|
134 |
console.log(user)
|
135 |
var userInput = document.getElementById('user-input');
|
136 |
socket.on('user_count', function(data) {
|
|
|
138 |
document.getElementById('userCount').innerText = `Online Users: ${onlineUsersCount}`
|
139 |
});
|
140 |
function sendMessage() {
|
|
|
141 |
var message = userInput.value;
|
142 |
if(message.length>1200){
|
143 |
alert('messsage lenght exceeds 1200 chracters!!')
|
|
|
175 |
|
176 |
messages.appendChild(newMessage);
|
177 |
});
|
|
|
|
|
178 |
|
179 |
socket.on('response', function(data) {
|
180 |
var currentMessage = messages.lastChild;
|
|
|
194 |
|
195 |
messages.appendChild(currentMessage);
|
196 |
}
|
|
|
197 |
|
198 |
var responseText = document.createTextNode(data.response);
|
199 |
|
|
|
202 |
|
203 |
}
|
204 |
});
|
|
|
|
|
|
|
|
|
205 |
</script>
|
206 |
</body>
|
207 |
|
208 |
+
</html>
|