From 9fcfbd7e254c252676ad6d796ad718e0b42a25d1 Mon Sep 17 00:00:00 2001 From: amelia Date: Mon, 4 Apr 2022 08:19:14 -0500 Subject: Add files via upload --- index.html | 32 ++++++++++++++++++++++++++++---- 1 file changed, 28 insertions(+), 4 deletions(-) (limited to 'index.html') diff --git a/index.html b/index.html index 9f23fde..70e34c2 100644 --- a/index.html +++ b/index.html @@ -92,8 +92,31 @@ let hex = (rgbToHex(r, g, b)) hex = hex.split(".")[0] console.log(hex) - let v = Math.floor(((255*3)-(r+g+b))/5) - let ne = {"color": hex, "rarity": "crafted", "value": v} + //let v = Math.floor(((255*3)-(r+g+b))/5) + let v = 0; + let hexadecimal = {"0":0,"1":1,"2":2,"3":3,"4":4,"5":5,"6":6,"7":7,"8":8,"9":9,"a":10,"A":10,"b":11,"B":11,"c":12,"C":12,"d":13,"D":13,"e":14,"E":14,"f":15,"F":15} + for(let letter of hex.split("#")[1].split("")){ + v+= hexadecimal[letter] + } + let craft = "" + if(v==90){ + craft+="pure" + } else if (v>=80){ + craft+="pure-ish" + } else if(v >=70){ + craft+="bright" + } else if(v >= 60){ + craft+="bright-ish" + } else if(v>= 50){ + craft+="normal-ish" + } else if(v>=40){ + craft+="normal" + } else if(v>=20){ + craft+="dirty-ish" + } else { + craft+="dirty" + } + let ne = {"color": hex, "rarity": craft + "\(crafted)\", "value": v} //if(data!=index && inv[data].color != inv[data].color){ var inv = getCookie('inv'); @@ -175,6 +198,7 @@ return response.json(); }) .then(data => { + var bank = getCookie('bank'); var inv = getCookie('inv'); var arr = JSON.parse(inv); @@ -227,7 +251,7 @@ var inv = getCookie('inv'); inv = JSON.parse(inv) document.write("
") - document.write("inv:{ //https://github.com/squiresgrant v1.1+2\<3
") + document.write("inv:{ //https://github.com/squiresgrant v1.2+1\<3
") document.write("items:[
") document.write("
") for (let item of inv) { @@ -272,7 +296,7 @@ - document.write("
") + document.write("
") // document.write("") //document.write("

" + d.crates[0].price + "

") -- cgit v1.2.3