-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgams.qpe
15 lines (15 loc) · 4.93 KB
/
gams.qpe
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
{
"js": "// JavaScript\r\nvar ipinput = document.querySelector(\"#ipinput\");\r\nvar save = document.querySelector(\"#save\");\r\n\r\nvar selIp = \"localhost\";\r\nipinput.addEventListener('input', (e)=>{\r\n selIp = e.target.value;\r\n \r\n document.querySelector('.selip').innerText = selIp;\r\n})\r\n\r\nvar latestData = null;\r\n\r\nfunction saveLatestData(data) {\r\n const a = document.createElement('a'); a.href = URL.createObjectURL(new Blob([JSON.stringify(data)], { type: 'application/json' })); a.download = 'data.json'; a.click();\r\n}\r\n\r\nsave.addEventListener('click', ()=>{\r\n if(latestData) {\r\n saveLatestData(latestData);\r\n }\r\n})\r\n\r\nconst reload = ()=>{\r\n var ip = document.querySelector('#ip');\r\n var port = document.querySelector('#port');\r\n var motd = document.querySelector('#motd');\r\n var playerOnline = document.querySelector('#playerOnline');\r\n var playerMax = document.querySelector('#playerMax');\r\n var version = document.querySelector('#version');\r\n var isOnline = document.querySelector('#isOnline');\r\n var software = document.querySelector('#software');\r\n\r\n var [ ping, query, srv ] = [document.querySelector('#ping'), document.querySelector('#query'), document.querySelector('#srv')]\r\n const icon = document.querySelector('.icon');\r\n\r\n fetch(\"https://api.mcsrvstat.us/3/\"+selIp)\r\n .then(x => x.json())\r\n .then(x => {\r\n latestData = x;\r\n ip.innerText = x.ip;\r\n port.innerText = x.port;\r\n motd.innerHTML = x.motd.html;\r\n playerOnline.innerText = x.players.online;\r\n playerMax.innerText = x.players.max;\r\n software.innerText = x.software;\r\n version.innerText = x.version;\r\n isOnline.innerText = x.online;\r\n ping.innerText = x.debug.ping;\r\n query.innerText = x.debug.query;\r\n srv.innerText = x.debug.srv;\r\n icon.src = x.icon;\r\n })\r\n}\r\n\r\ndocument.querySelector('#reload').onclick = reload;",
"css": "/* CSS */\nhtml, body {\n background: #111;\n color: white;\n font-family: Inter;\n}\np.slim {\n display: inline-flex;\n margin: 0;\n}\n.icon {\n width: 20px;\n height: 20px;\n}\n\n#port {\n color: rgb(173, 191, 230);\n}\n#ip {\n color: lightcoral;\n}\n#motd {\n background: #222;\n padding: 4px;\n font-family: Minecraft, Minecraftia, JetBrains Mono, Fira Code, Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;\n}\n#playerOnline, #playerMax {\n color: lightgreen;\n}\n#version {\n color: lightgoldenrodyellow;\n}\ncode {\n background-color: #222;\n padding: 4px;\n font-family: Fira Code, Jetbrains Mono, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;\n}\nbutton, input {\n padding: 6px 12px;\n background: #444;\n border: 1px solid #666;\n border-radius: 4px;\n color: white;\n}\nbutton:hover {\n color: #ccc;\n background: #414141;\n cursor: pointer;\n}\ninput:focus-within {\n outline: none;\n border: 1px solid #b1b1b1;\n}\n.selip {\n font-family: JetBrains Mono, Fira Code, monospace;\n}\n.wg {\n display: inline;\n width: 10px;\n height: 10px;\n}\ndiv.btns {\n display: flex;\n flex-direction: row;\n align-items: center;\n gap: 5px;\n}\nh1 i {\n font-size: 10px;\n}\nh1 {\n display: flex;\n align-items: center;\n gap: 5px;\n}\n.list {\n display: flex;\n flex-direction: column;\n gap: 5px;\n}\n.item {\n display: flex;\n flex-direction: row;\n gap: 5px;\n align-items: center;\n}",
"html": "<!--- HTML --->\n<h1>GaMS <i>gavinminecraftserver</i></h1>\n<img src=\"\" alt=\"\" class=\"icon\"> <div class=\"wg\"></div> <span class=\"selip\">localhost</span><br>\nIP: <p id=\"ip\" class=\"slim\">ip</p>:<p id=\"port\" class=\"slim\">port</p><br>\nMotd: <p id=\"motd\" class=\"slim\">MOTD</p><br>\nPlayers: <p id=\"playerOnline\" class=\"slim\"></p>/<p id=\"playerMax\" class=\"slim\"></p><br>\nVersion:<p id=\"version\" class=\"slim\"></p><br>\nOnline: <p id=\"isOnline\" class=\"slim\"></p><br>\nSoftware: <p id=\"software\" class=\"slim\"></p><br>\nDebug: <code>ping:<span id=\"ping\"></span>, query:<span id=\"query\"></span>, srv:<span id=\"srv\"></span></code>\n<br><br>\n<div class=\"btns\">\n <input type=\"text\" id=\"ipinput\" placeholder=\"IP Address (:Port)\">\n <button id=\"reload\"><i class=\"fa-solid fa-refresh\"></i></button>\n <button id=\"save\"><i class=\"fa-solid fa-download\"></i></button>\n</div>",
"settings": {
"cssImports": [
"https://rsms.me/inter/inter.css",
"https://fontlibrary.org//face/minecraftia",
"https://site-assets.fontawesome.com/releases/v6.5.0/css/all.css"
],
"jsImports": [],
"color": "#6955c6",
"borderWidth": 1
}
}