Add files via upload
This commit is contained in:
parent
729e62694d
commit
dd718f821d
32
index.html
32
index.html
|
@ -16,7 +16,16 @@
|
|||
|
||||
|
||||
<script>
|
||||
|
||||
let ranks = {
|
||||
1:"poor",
|
||||
100:"painter",
|
||||
500:"carpet weaver",
|
||||
1000:"graffiti artist",
|
||||
5000:"caricature artist",
|
||||
10000:"ascii artist"
|
||||
}
|
||||
|
||||
|
||||
function createCookie(name, value, days) {
|
||||
var expires;
|
||||
if (days) {
|
||||
|
@ -47,6 +56,21 @@
|
|||
}
|
||||
return "";
|
||||
}
|
||||
function getRank(){
|
||||
bank = getCookie('bank')
|
||||
for(let k in ranks){
|
||||
//console.log(k)
|
||||
//console.log(bank)
|
||||
if(parseInt(bank)>parseInt(k)){
|
||||
|
||||
|
||||
} else {
|
||||
return(ranks[k])
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
console.log(getRank())
|
||||
function rgbToHex(r, g, b) {
|
||||
return "#" + ((1 << 24) + (r << 16) + (g << 8) + b).toString(16).slice(1);
|
||||
}
|
||||
|
@ -144,7 +168,7 @@
|
|||
var inv = getCookie('inv');
|
||||
inv = JSON.parse(inv)
|
||||
var balance = document.getElementById("balance");
|
||||
balance.innerHTML = getCookie("bank")
|
||||
balance.innerHTML = getCookie("bank") + " <font size=1.5>(" + getRank() + ")</font>"
|
||||
let i = ""
|
||||
/*
|
||||
for(let item of inv){
|
||||
|
@ -251,7 +275,7 @@
|
|||
var inv = getCookie('inv');
|
||||
inv = JSON.parse(inv)
|
||||
document.write("<div style='position:absolute;right:5%;'>")
|
||||
document.write("inv:{ //<a style='color:#696969;' href = \"https://github.com/squiresgrant\">https://github.com/squiresgrant</a> <a style='color:pink;' href=\"https://github.com/squiresgrant/colors\">v1.2+1</a><a style='color=purple;'>\<3</a></br>")
|
||||
document.write("inv:{ //<a style='color:#696969;' href = \"https://github.com/squiresgrant\">https://github.com/squiresgrant</a> <a style='color:pink;' href=\"https://github.com/squiresgrant/colors\">v1.2+1</a><a style='color=purple;'> \<3</a></br>")
|
||||
document.write("items:[</br>")
|
||||
document.write("<div id='inv'>")
|
||||
for (let item of inv) {
|
||||
|
@ -274,7 +298,7 @@
|
|||
}
|
||||
document.write("</div>")
|
||||
document.write("],</br>")
|
||||
document.write("bank:<div id='balance'>" + bank + "</br></div>")
|
||||
document.write("bank:<div id='balance'>" + bank + " <font size=1.5> (" + getRank() + ")</font></br></div>")
|
||||
document.write("}")
|
||||
document.write("</div>")
|
||||
for (let crate of data.crates) {
|
||||
|
|
Loading…
Reference in New Issue