-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathchat.php
More file actions
103 lines (100 loc) · 3.44 KB
/
chat.php
File metadata and controls
103 lines (100 loc) · 3.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
<script>
// Create WebSocket connection.
const socket = new WebSocket('ws://crasysockets.herokuapp.com');
function penis() {
var message = document.getElementById("msg").value
socket.send(message)
document.getElementById("msg").value = "";
}
// Connection opened
socket.addEventListener('open', function (event) {
socket.send('Hello, I Was Friend User!');
});
// Listen for messages
socket.addEventListener('message', function (event) {
var node = document.createElement("p");
var textnode = document.createTextNode(event.data.toString());
node.appendChild(textnode);
document.getElementById("scat").appendChild(node);
var objDiv = document.getElementById("scat");
objDiv.scrollTop = objDiv.scrollHeight;
});
</script>
<script>
function color() {
var Coler = document.getElementById("bg").value
var tColer = document.getElementById("txt").value
var mario = document.getElementById("scat");
mario.style["background-color"] = Coler;
mario.style["background-image"] = "none";
mario.style.color = tColer;
}
function theme1() {
var Coler = "red";
var tColer = "yellow";
var mario = document.getElementById("scat");
mario.style["background-color"] = Coler;
mario.style["background-image"] = "none";
mario.style.color = tColer;
}
function theme2() {
var Coler = "mediumturquoise";
var tColer = "mistyrose";
var mario = document.getElementById("scat");
mario.style["background-color"] = Coler;
mario.style["background-image"] = "none";
mario.style.color = tColer;
}
function theme3() {
var Coler = "moccasin";
var tColer = "saddlebrown";
var mario = document.getElementById("scat");
mario.style["background-color"] = Coler;
mario.style["background-image"] = "none";
mario.style.color = tColer;
}
function theme4() {
var Coler = "black";
var tColer = "red";
var mario = document.getElementById("scat");
mario.style["background-color"] = Coler;
mario.style["background-image"] = "none";
mario.style.color = tColer;
}
function theme5() {
var Coler = "white";
var tColer = "black";
var mario = document.getElementById("scat");
mario.style["background-color"] = Coler;
mario.style["background-image"] = "none";
mario.style.color = tColer;
}
function theme6() {
var Coler = "white";
var tColer = "black";
var mario = document.getElementById("scat");
mario.style["background-color"] = Coler;
mario.style["background-image"] = 'url("https://i.imgur.com/ixCqIyK_d.png")';
mario.style.color = tColer;
}
</script>
<!-- Begin chat -->
<h1>Chat</h1>
<div id="scat" class="Bruhio">
</div>
<textarea id="msg">Hey</textarea>
<button onclick="penis()">Send</button>
<p>Coler<p>
<input type="color" id="bg" name="bg"
value="#008000">
<input type="color" id="txt" name="txt"
value="#000000">
<button onclick="color()">Change palette</button>
<p>Or choose a theme:</p>
<button onclick="theme1()">BruhDonld</button>
<button onclick="theme2()">Yeety Sea</button>
<button onclick="theme3()">Lukert</button>
<button onclick="theme4()">ExE :devil:</button>
<button onclick="theme5()">COLOR INVERTED :devil:</button>
<button onclick="theme6()">Diabeto</button>
<!-- End chat -->