-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
104 lines (91 loc) · 2.53 KB
/
index.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
100
101
102
103
104
<head>
<title>discore</title>
</head>
<div id="sidebar">
<img src="https://static.vecteezy.com/system/resources/previews/006/892/625/original/discord-logo-icon-editorial-free-vector.jpg" server="home" onclick="goToServer(this.getAttribute('server'))">
<hr width="70%">
<div id="custom servers">
<img src="https://thisis-images.scdn.co/37i9dQZF1DZ06evNZYJn61-large.jpg" server="random" onclick="goToServer(this.getAttribute('server'))">
</div>
<hr width="70%">
<img src="https://www.freeiconspng.com/thumbs/add-icon-png/add-1-icon--flatastic-1-iconset--custom-icon-design-0.png">
</div>
<div id="main">
Enter Chat and press enter
<div><input id=input placeholder="message" /></div>
Chat Output
<div id=box></div>
</div>
<script src=https://cdn.pubnub.com/sdk/javascript/pubnub.4.28.2.min.js></script>
<script> (function() {
params=new URL(window.location).searchParams
function $(id) {
return document.getElementById(id);
}
function sendMessage(text){
box=$('box')
box.innerHTML = ('' + text).replace(/[<>]/g, '') + '<br>' + box.innerHTML
}
var pubnub = new PubNub({
publishKey: 'pub-c-6fc0378e-25c7-437c-b1d0-85847d6354b4',
subscribeKey: 'sub-c-809b1b37-8c2c-4e7f-b776-105d498f14c8'
});
var box = $('box'),
input = $('input'),
channel = params.get('server')
pubnub.addListener({
message: function(obj) {
sendMessage(obj.message)
}
});
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 = '')
});
}
});
})();
url="file:///home/chronos/u-193b94573f18e9ccbe3a66bcd2ce34a91db2c0f3/MyFiles/Discore/index.html"
function goToServer(el){
window.location=url+"?server="+el
}
</script>
<style>
body{
font-family:arial;
}
:root{
--sidebar:#202225;
--channels:#2f3136;
}
#sidebar{
background-color:var(--sidebar);
width:72px;
height:100%;
position:fixed;
left:0;
top:0;
z-index:10;
}
#sidebar img{
width:60px;
height:60px;
border-radius:30px;
margin:6px;
transition:0.3s;
}
#sidebar img:hover{
border-radius:15px;
}
#main{
position:fixed;
left:75;
top:0;
}
</style>