aboutsummaryrefslogtreecommitdiff
path: root/index.html
diff options
context:
space:
mode:
Diffstat (limited to 'index.html')
-rw-r--r--index.html32
1 files changed, 28 insertions, 4 deletions
diff --git a/index.html b/index.html
index 70e34c2..b10de5a 100644
--- a/index.html
+++ b/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) {