-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdata.html
More file actions
87 lines (83 loc) · 1.98 KB
/
Copy pathdata.html
File metadata and controls
87 lines (83 loc) · 1.98 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
<!DOCTYPE html>
<html>
<head>
<title>Rubyyy</title>
<style>
html, body {
background-image: linear-gradient(0deg, #510000, #3e0000);
height: 100%;
overflow: hidden;
display: flex;
flex-direction: row;
flex-wrap: wrap;
justify-content: center;
align-content: flex-start;
align-items: center;
}
div#chat_data {
width: 300px;
height: 350px;
position: fixed;
margin-top: 9%;
top: 0;
right: 69px;
background: linear-gradient(#4b0000,#ba2929);
border: 1px solid white;
border-radius: 10px;
}
li {
list-style: none;
text-align: left;
margin-bottom: 23px;
}
div#data {
color: white;
text-align: center;
}
</style>
</head>
<body>
<div id="chat_data" style="display:none">
<div id="data">
<h1 id="Name">N/A</h1>
<ul>
<li id="ID"></li>
<li id="background"></li>
<li id="language"></li>
<li id="radio"></li>
<li id="buttons"></li>
</ul>
</div>
</div>
<script type="text/javascript">
window.addEventListener("DOMContentLoaded", init);
function init() {
let chat_data = document.querySelector('#chat_data');
let hasChat = getParams('chatname');
if (hasChat) {
fetch('https://api.illuxat.com/room/' + hasChat).then((e) => {
return e.json();
}).then((e) => {
if (e.code == 200) {
let data = e.data;
for (let i in e.data) {
let selector = document.querySelector('#' + i);
if (selector) {
if (i == 'background' && !e.data['background']) {
e.data['background'] = 'No background';
}
selector.innerHTML = e.data[i];
}
}
chat_data.style.display = '';
}
})
}
}
function getParams(g) {
let search = decodeURIComponent(window.location.search).match(new RegExp('[?&]' + g + '=([^&]+)'));
return search[1] || null;
}
</script>
</body>
</html>