Skip to content

Commit ebd2579

Browse files
authored
Add files via upload
1 parent 00e692d commit ebd2579

File tree

4 files changed

+93
-5
lines changed

4 files changed

+93
-5
lines changed

chat.css

Lines changed: 49 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,22 @@
1+
/*
2+
//OWNER : IG SOLUTIONS
3+
//AUTHOR : PIYUSH GARG
4+
//START : MAY-2020
5+
*/
6+
17
*{
28
box-sizing:border-box;
39
}
410

11+
body {
12+
margin:0px;
13+
}
14+
515
#title {
616
text-align:center;
717
color:red;
818
background-color:yellow;
19+
margin:0px;
920
}
1021

1122
#demo {
@@ -36,6 +47,12 @@ font-size:15px;
3647
font-size:15px;
3748
}
3849

50+
/*
51+
//OWNER : IG SOLUTIONS
52+
//AUTHOR : PIYUSH GARG
53+
//START : MAY-2020
54+
*/
55+
3956
.mesg {
4057
text-align:left;
4158
max-width:45%;
@@ -47,6 +64,16 @@ font-size:15px;
4764
background-color: #ADD8E6;
4865
color:black;
4966
overflow:hidden;
67+
float:left;
68+
}
69+
70+
.mesg-tr {
71+
width: 0;
72+
height: 0;
73+
margin-left:auto;
74+
border-left: 14px solid transparent;
75+
border-top: 7px solid #90ee90;
76+
float:left;
5077
}
5178

5279
.sent {
@@ -58,13 +85,34 @@ font-size:15px;
5885
padding-top:1px;
5986
padding-bottom:1px;
6087
margin-left:auto;
61-
margin-right:5px;
88+
margin-right:0px;
6289
background-color:#90ee90;
6390
color:black;
6491
overflow:hidden;
92+
float:right;
93+
}
94+
95+
.sent-tr {
96+
width: 0;
97+
height: 0;
98+
margin-left:auto;
99+
border-right: 14px solid transparent;
100+
border-top: 7px solid #90ee90;
101+
float:right;
65102
}
66103

67104
.brdcst {
68105
text-align:center;
69106
}
70107

108+
.clearfix::after {
109+
content: "";
110+
clear: both;
111+
display: table;
112+
}
113+
114+
/*
115+
//OWNER : IG SOLUTIONS
116+
//AUTHOR : PIYUSH GARG
117+
//START : MAY-2020
118+
*/

ico.ico

51.4 KB
Binary file not shown.

start.js

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
/*
2+
//OWNER : IG SOLUTIONS
3+
//AUTHOR : PIYUSH GARG
4+
//START : MAY-2020
5+
*/
6+
17
var p = document.getElementById("demo");
28
var socket;
39
var u_name;
@@ -94,7 +100,7 @@ function connect()
94100
};
95101
var time= new Date(msg.date);
96102
var timeStr = time.toLocaleTimeString();
97-
p.innerHTML += '<div class="sent"><b>You ('+timeStr+') : </b><br>' + ms + '</div><br>';
103+
p.innerHTML += '<div class="clearfix"><div class="sent-tr"></div><div class="sent"><b>You ('+timeStr+') : </b><br>' + ms + '</div></div><br>';
98104
socket.send(JSON.stringify(msg));
99105
mf.value="";
100106
document.getElementById("demo").scrollTop = document.getElementById("demo").scrollHeight;
@@ -143,11 +149,17 @@ function connect()
143149
}
144150
else if(msg.type=="message")
145151
{
146-
p.innerHTML += '<div class="mesg"><b>'+msg.name+ ' (' + timeStr + ') : </b><br>' + msg.text + '</div><br>';
152+
p.innerHTML += '<div class="clearfix"><div class="mesg-tr"></div><div class="mesg"><b>'+msg.name+ ' (' + timeStr + ') : </b><br>' + msg.text + '</div></div><br>';
147153
}
148154
document.getElementById("demo").scrollTop = document.getElementById("demo").scrollHeight;
149155
};
150156

157+
/*
158+
//OWNER : IG SOLUTIONS
159+
//AUTHOR : PIYUSH GARG
160+
//START : MAY-2020
161+
*/
162+
151163
document.getElementById("cancel").onclick=function() {
152164
var msg={
153165
type:"disconn",
@@ -191,4 +203,10 @@ function connect()
191203

192204
function do_nothing()
193205
{
194-
}
206+
}
207+
208+
/*
209+
//OWNER : IG SOLUTIONS
210+
//AUTHOR : PIYUSH GARG
211+
//START : MAY-2020
212+
*/

test.html

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,20 @@
1+
<!---
2+
//OWNER : IG SOLUTIONS
3+
//AUTHOR : PIYUSH GARG
4+
//START : MAY-2020
5+
-->
16
<!DOCTYPE html>
27
<html>
38
<head>
9+
<!---
10+
//OWNER : IG SOLUTIONS
11+
//AUTHOR : PIYUSH GARG
12+
//START : MAY-2020
13+
-->
414
<meta name="viewport" content="width=device-width, initial-scale=1.0">
515
<title>TEST</title>
616
<link rel="stylesheet" href="chat.css">
17+
<link rel="icon" href="ico.ico">
718
</head>
819
<body>
920
<h1 id="title">CHAT-APPLICATION</h1><br>
@@ -19,7 +30,18 @@ <h1 id="title">CHAT-APPLICATION</h1><br>
1930
<input type="submit" id="send" disabled value="SEND MESSAGE"><br>
2031
<script src="start.js"></script>
2132
</form>
33+
<!---
34+
//OWNER : IG SOLUTIONS
35+
//AUTHOR : PIYUSH GARG
36+
//START : MAY-2020
37+
-->
2238
</div>
2339
<p><b>Note:- </b><br>Do not refresh the page once connected. It will disconnect you. However you can reconnect to same channel. But chat history will be lost.<br>Do not enter any personal/sensitive information here because the websocket is hosted at 3rd party socket server API.<br>No Chat history is saved. You can just copy-paste the chat or save the screenshot.</p>
40+
<footer><p style="text-align:center;">Created and Managed By IG Solutions<br>Powered By WEBSOCKETS.IN<br>All rights reserved.</p>
2441
</body>
25-
</html>
42+
</html>
43+
<!---
44+
//OWNER : IG SOLUTIONS
45+
//AUTHOR : PIYUSH GARG
46+
//START : MAY-2020
47+
-->

0 commit comments

Comments
 (0)