-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.js
68 lines (65 loc) · 1.9 KB
/
script.js
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
function openLink(url) {
window.open(url);
}
//Downloads the Latest Version of APK or Mod
function download() {
if (
/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(
navigator.userAgent
)
) {
// Downloads APK if on mobile
} else {
// Downloads mod if on computer
}
alert(
"There is currently no public version of DF Pocket Dev.\nPlease check back later!"
);
}
function randomBackground() {
//Picks a random node background, then sets the background image
var node =
"url('backgrounds/node" +
(Math.floor(Math.random() * Math.floor(4)) + 1) +
".png')";
document.body.style.backgroundImage = node;
}
function changePage(page) {
url = page + ".html";
location.href = url;
}
function aboutLoad() {
randomBackground();
profile("f33f0e36-31d9-47cb-a4a6-1d30e5816232", "Lead Developer").then(
function () {
profile("2ee931a2-3541-4f7b-95f2-7f15a039e119", "Developer").then(
function () {
profile("f4f31774-ec2d-4e1a-8aef-f2906509d927", "Developer").then(
function () {
profile(
"2ee60a1d-8913-4d8d-8022-72fa0738d0e1",
"Helped design logo and make stylistic decisions"
);
}
);
}
);
}
);
}
async function profile(uuid, bio) {
username = await getUsername(uuid);
var profile = `<div class="card"><p class="name">${username}<p><img class="profile" src="https://mc-heads.net/head/${uuid}"><p class="bio">${bio}<p></div>`;
document.querySelector(".cards").innerHTML += profile;
}
function getUsername(uuid) {
return fetch("https://mojang-api.vercel.app/v1/names?uuid=" + uuid)
.then((response) => response.json())
.then((json) => {
return json[json.length - 1].name;
});
}
function setBackground(node) {
var bg = "url('backgrounds/node" + node + ".png')";
document.body.style.backgroundImage = bg;
}