This repository has been archived by the owner on Aug 31, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
65 lines (59 loc) · 2.93 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-rbsA2VBKQhggwzxH7pPCaAqO46MgnOM80zW1RWuH61DGLwZJEdK2Kadq2F9CUG65" crossorigin="anonymous">
<meta content="Realm Lurker" property="og:title" />
<meta content="Easily find public realms." property="og:description" />
<meta content="https://s4300.github.io/RealmLurker" property="og:url" />
<!-- <meta content="https://" property="og:image" /> -->
<meta content="#FF3600" data-react-helmet="true" name="theme-color" />
<title>Realm Lurker</title>
</head>
<body>
<div class="text-center">
<h1>Realm Lurker</h1>
<h2>Finds random public realms. <label id="realmAmount">???</label> realms saved.</h2>
<button id="findRealm" class="btn btn-secondary">Find Realm</button>
<hr />
<p>Realm Code: <label id="realmCode">Click "Find Realm"</label></p>
<a id="joinRealm" href="javascript:alert('Press the Find Realm button first!')" class="btn btn-success">Join Realm</a>
<hr />
<a href="https://github.com/s4300/RealmLurker" rel="noopener" target="_blank">View on GitHub</a>
<br />
<p>Want to contribute to the list, or site? Make a pull request on Github!<br />Also, I wouldn't mind if you starred it while you're there.</p>
</div>
</body>
</html>
<style>
html {
font-family: Arial, Helvetica, sans-serif;
};
hr {
margin-top: 1rem;
margin-bottom: 1rem;
border: 0;
border-top: 1px solid rgba(0, 0, 0, 0.1);
};
</style>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-kenU1KFdBIe4zVF0s0G1M5b4hcpxyD9F7jL+jjXkk+Q2h455rYXK/7HAuoJl+0I4" crossorigin="anonymous"></script>
<script>
let RealmAmountLabel = document.getElementById("realmAmount");
let RealmCodeLabel = document.getElementById("realmCode");
let FindRealmButton = document.getElementById("findRealm");
let JoinRealmButton = document.getElementById("joinRealm");
const RealmListUrl = "https://raw.githubusercontent.com/s4300/RealmLurker/main/realmcodes.json";
var RealmCodes = [];
fetch(RealmListUrl).then((response) => response.json())
.then((data) => {
RealmCodes = data["realms"];
RealmAmountLabel.textContent = RealmCodes.length;
});
FindRealmButton.addEventListener("click", () => {
var RandomRealm = RealmCodes[Math.floor(Math.random() * RealmCodes.length)];
if (RandomRealm == undefined) RandomRealm = "";
RealmCodeLabel.textContent = `${RandomRealm}`;
JoinRealmButton.setAttribute("href", `minecraft://acceptRealmInvite?inviteID=${RandomRealm}`);
});
</script>