File tree Expand file tree Collapse file tree 4 files changed +93
-5
lines changed Expand file tree Collapse file tree 4 files changed +93
-5
lines changed Original file line number Diff line number Diff line change
1
+ /*
2
+ //OWNER : IG SOLUTIONS
3
+ //AUTHOR : PIYUSH GARG
4
+ //START : MAY-2020
5
+ */
6
+
1
7
* {
2
8
box-sizing : border-box;
3
9
}
4
10
11
+ body {
12
+ margin : 0px ;
13
+ }
14
+
5
15
# title {
6
16
text-align : center;
7
17
color : red;
8
18
background-color : yellow;
19
+ margin : 0px ;
9
20
}
10
21
11
22
# demo {
@@ -36,6 +47,12 @@ font-size:15px;
36
47
font-size : 15px ;
37
48
}
38
49
50
+ /*
51
+ //OWNER : IG SOLUTIONS
52
+ //AUTHOR : PIYUSH GARG
53
+ //START : MAY-2020
54
+ */
55
+
39
56
.mesg {
40
57
text-align : left;
41
58
max-width : 45% ;
@@ -47,6 +64,16 @@ font-size:15px;
47
64
background-color : # ADD8E6 ;
48
65
color : black;
49
66
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;
50
77
}
51
78
52
79
.sent {
@@ -58,13 +85,34 @@ font-size:15px;
58
85
padding-top : 1px ;
59
86
padding-bottom : 1px ;
60
87
margin-left : auto;
61
- margin-right : 5 px ;
88
+ margin-right : 0 px ;
62
89
background-color : # 90ee90 ;
63
90
color : black;
64
91
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;
65
102
}
66
103
67
104
.brdcst {
68
105
text-align : center;
69
106
}
70
107
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
+ */
Original file line number Diff line number Diff line change
1
+ /*
2
+ //OWNER : IG SOLUTIONS
3
+ //AUTHOR : PIYUSH GARG
4
+ //START : MAY-2020
5
+ */
6
+
1
7
var p = document . getElementById ( "demo" ) ;
2
8
var socket ;
3
9
var u_name ;
@@ -94,7 +100,7 @@ function connect()
94
100
} ;
95
101
var time = new Date ( msg . date ) ;
96
102
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>' ;
98
104
socket . send ( JSON . stringify ( msg ) ) ;
99
105
mf . value = "" ;
100
106
document . getElementById ( "demo" ) . scrollTop = document . getElementById ( "demo" ) . scrollHeight ;
@@ -143,11 +149,17 @@ function connect()
143
149
}
144
150
else if ( msg . type == "message" )
145
151
{
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>' ;
147
153
}
148
154
document . getElementById ( "demo" ) . scrollTop = document . getElementById ( "demo" ) . scrollHeight ;
149
155
} ;
150
156
157
+ /*
158
+ //OWNER : IG SOLUTIONS
159
+ //AUTHOR : PIYUSH GARG
160
+ //START : MAY-2020
161
+ */
162
+
151
163
document . getElementById ( "cancel" ) . onclick = function ( ) {
152
164
var msg = {
153
165
type :"disconn" ,
@@ -191,4 +203,10 @@ function connect()
191
203
192
204
function do_nothing ( )
193
205
{
194
- }
206
+ }
207
+
208
+ /*
209
+ //OWNER : IG SOLUTIONS
210
+ //AUTHOR : PIYUSH GARG
211
+ //START : MAY-2020
212
+ */
Original file line number Diff line number Diff line change
1
+ <!---
2
+ //OWNER : IG SOLUTIONS
3
+ //AUTHOR : PIYUSH GARG
4
+ //START : MAY-2020
5
+ -->
1
6
<!DOCTYPE html>
2
7
< html >
3
8
< head >
9
+ <!---
10
+ //OWNER : IG SOLUTIONS
11
+ //AUTHOR : PIYUSH GARG
12
+ //START : MAY-2020
13
+ -->
4
14
< meta name ="viewport " content ="width=device-width, initial-scale=1.0 ">
5
15
< title > TEST</ title >
6
16
< link rel ="stylesheet " href ="chat.css ">
17
+ < link rel ="icon " href ="ico.ico ">
7
18
</ head >
8
19
< body >
9
20
< h1 id ="title "> CHAT-APPLICATION</ h1 > < br >
@@ -19,7 +30,18 @@ <h1 id="title">CHAT-APPLICATION</h1><br>
19
30
< input type ="submit " id ="send " disabled value ="SEND MESSAGE "> < br >
20
31
< script src ="start.js "> </ script >
21
32
</ form >
33
+ <!---
34
+ //OWNER : IG SOLUTIONS
35
+ //AUTHOR : PIYUSH GARG
36
+ //START : MAY-2020
37
+ -->
22
38
</ div >
23
39
< 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 >
24
41
</ body >
25
- </ html >
42
+ </ html >
43
+ <!---
44
+ //OWNER : IG SOLUTIONS
45
+ //AUTHOR : PIYUSH GARG
46
+ //START : MAY-2020
47
+ -->
You can’t perform that action at this time.
0 commit comments