relay_added

This commit is contained in:
Ваше Имя
2025-02-19 12:31:56 +05:00
parent aa98d03667
commit cb1a76d4c1
144 changed files with 229 additions and 9 deletions

View File

@ -16,7 +16,13 @@
<body>
<div class="chat">
<div class="msg-board">
<h1>Доска объявлений для GAME SERVER ЧАТ | minecraft vanila |</h1>
<h1>Доска объявлений для GAME SERVER ЧАТ | GENERAL |</h1>
<div style="text-align: center; display: flex;justify-content: space-between;margin-inline: 4vw;">
<dl></dl>
<dl class="relays">
</dl>
</div>
</div>
<div id="chat-box" class="chat-box">
<div id="offline"><span class="big">Server is offline.</span><br />Sorry for that.</div>
@ -38,6 +44,31 @@
<script type="text/javascript" src="static/scripts/emic.js"></script>
<script type="text/javascript" src="static/scripts/chat.js"></script>
<script type="text/javascript">
fetch('vars.json')
.then(response => {
return response.json();
})
.then(json => {
document.querySelector(".msg-board").querySelector("h1").innerText = json["title"];
document.querySelector(".msg-board").querySelector("div").querySelectorAll("dl")[0].innerHTML = json["msgs"];
//console.log(this.users);
})
fetch('/relays.json')
.then(response => {
return response.json();
})
.then(json => {
let tags = "";
Object.keys(json).forEach(element => {
tags += "<dt><a href='"+json[element]["url"]+"'>"+json[element]["name"]+"</a></dt>";
});
document.querySelector(".msg-board").querySelector("div").querySelectorAll("dl")[1].innerHTML = "<dt>другие чаты</dt>"+tags;
//console.log(this.users);
})
// optionally set own server where the client connects to
const socket = io(location.protocol + '//' + location.host, {
path: location.pathname.replace(/\/$/, '') + '/socket.io/'