-
Notifications
You must be signed in to change notification settings - Fork 0
/
achievements.js
58 lines (52 loc) · 1.6 KB
/
achievements.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
let achList = ["credits", "imposter", "evil", "discord"];
let achAchieved = 0;
window.onload = function()
{
for(var i = 0; i < achList.length; i++)
{
let gotAch = getCookie(achList[i]);
if(gotAch == "yes")
{
let prevText = document.getElementById(achList[i]).innerHTML;
document.getElementById(achList[i]).innerHTML = prevText + gotAch;
achAchieved++;
}
if(gotAch == "")
{
let prevText = document.getElementById(achList[i]).innerHTML;
document.getElementById(achList[i]).innerHTML = prevText + "no";
}
}
let prevText = document.getElementById("percentage").innerHTML;
document.getElementById("percentage").innerHTML = prevText + `${achAchieved / achList.length * 100}% (${achAchieved}/${achList.length})`;
}
function getCookie(cname) {
let name = cname + "=";
let decodedCookie = decodeURIComponent(document.cookie);
let ca = decodedCookie.split(';');
for(let i = 0; i <ca.length; i++) {
let c = ca[i];
while (c.charAt(0) == ' ') {
c = c.substring(1);
}
if (c.indexOf(name) == 0) {
return c.substring(name.length, c.length);
}
}
return "";
}
function clearAchievements()
{
for(var i = 0; i < achList.length; i++)
{
let gotAch = getCookie(achList[i]);
document.cookie = `${achList[i]}=; expires=Tue, 7 Aug 2007 12:00:00 UTC; path=/achievements.html`;
location.reload();
}
}
function getAchievement(password, achName)
{
if(password == "LMAOAMONGUSSUS")
{
}
}