Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
Latest commit
68 lines (65 loc) · 1.9 KB
/
Copy pathscript.js
File metadata and controls
68 lines (65 loc) · 1.9 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
functionopenLink(url){
window.open(url);
}
//Downloads the Latest Version of APK or Mod
functiondownload(){
if(
/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|OperaMini/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!"
);
}
functionrandomBackground(){
//Picks a random node background, then sets the background image
varnode=
"url('backgrounds/node"+
(Math.floor(Math.random()*Math.floor(4))+1)+
".png')";
document.body.style.backgroundImage=node;
}
functionchangePage(page){
url=page+".html";
location.href=url;
}
functionaboutLoad(){
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"
);
}
);
}
);
}
);
}
asyncfunctionprofile(uuid,bio){
username=awaitgetUsername(uuid);
varprofile=`<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;
}
functiongetUsername(uuid){
returnfetch("https://mojang-api.vercel.app/v1/names?uuid="+uuid)
.then((response)=>response.json())
.then((json)=>{
returnjson[json.length-1].name;
});
}
functionsetBackground(node){
varbg="url('backgrounds/node"+node+".png')";
document.body.style.backgroundImage=bg;
}