This repository has been archived by the owner on Feb 12, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
ChatRoom.html
99 lines (97 loc) · 2.59 KB
/
ChatRoom.html
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
<html>
<head>
<link rel="icon" href="Labs.png">
<title>LAB's Games and More</title>
<style>
html{
background-color: white
}
header p{
font-weight = bold;
border-radius: 15px;
border-style: solid;
color:black;
border: solid;
padding: 20px;
background-color: red;
}
header p a{
border-right-color: black;
color:black;
text-decoration: none;
font-weight:100;
font-family: sans-serif;
border-right:2px solid;
padding: 8px;
font-size: 20px
}
p a.selected{
color: gray;
border-right-color: black;
}
header {
background-color: #3bff00;
padding: 1%;
border: 2px solid;
border-radius: 10px;
}
body {
center
}
body article {
border: 2px solid;
background-color: #ea6c00;
padding-left: 8px;
padding-right: 8px;
padding-bottom: 16px;
border-radius: 10px;
}
body article h7{
text-indent ;
}
nav {
border: 2px solid;
background-color: #ea6c00;
padding-left: 8px;
padding-right: 8px;
padding-bottom: 16px;
border-radius: 10px;
}
</style>
<title>Made with Thimble</title>
</head>
<header>
<h2> <sup>LAB's</sup> Games and more </h2>
<p>
<a href= "Index.html">Home</a>
<a href="Gamepage.html">Games</a>
<a href="index-6.html">Game Dev</a>
<a href="other pages.html">Other Pages</a>
<a class="selected">Chat Room</a>
</p>
</header>
<center>
<nav>
<h2>Enter Chat and Press Enter</h2>
<div><input id=input placeholder=you-chat-here /></div>
<h4>Chat Output ↡</h4>
</center>
<div id=box></div>
<script src=https://cdn.pubnub.com/sdk/javascript/pubnub.4.0.11.min.js></script>
<script>(function(){
var pubnub = new PubNub({ publishKey : 'demo', subscribeKey : 'demo' });
function $(id) { return document.getElementById(id); }
var box = $('box'), input = $('input'), channel = '10chat-demo';
pubnub.addListener({
message: function(obj) {
box.innerHTML = (''+obj.message).replace( /[<>]/g, '' ) + '<br>' + box.innerHTML
}});
pubnub.subscribe({channels:[channel]});
input.addEventListener('keyup', function(e) {
if ((e.keyCode || e.charCode) === 13) {
pubnub.publish({channel : channel,message : input.value,x : (input.value='')});
}
});
})();</script>
</nav>
</html>