diff options
author | amelia <[email protected]> | 2022-04-04 12:53:57 -0500 |
---|---|---|
committer | amelia <[email protected]> | 2022-04-04 12:53:57 -0500 |
commit | f1608327efd9bfce4021d7b2a992d57c7cafa970 (patch) | |
tree | 270a92b33f268e5a14d6c63cf8b050fcb7598064 /index.html | |
parent | 152a2474b07de301d3fae3bfcd5bdcdd7468b8d8 (diff) |
Add files via upload
Diffstat (limited to 'index.html')
-rw-r--r-- | index.html | 32 |
1 files changed, 28 insertions, 4 deletions
@@ -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) { |