From b5b2e75c2febc4523778d4c7f53429870d02af96 Mon Sep 17 00:00:00 2001 From: amelia Date: Wed, 6 Apr 2022 23:46:09 -0500 Subject: Add files via upload --- index.html | 38 ++++++++++++++++++++++++-------------- 1 file changed, 24 insertions(+), 14 deletions(-) (limited to 'index.html') diff --git a/index.html b/index.html index 658dc61..fcc59bd 100644 --- a/index.html +++ b/index.html @@ -1,4 +1,4 @@ - +make sure @@ -111,13 +111,20 @@ transform:scale(0.7); createCookie('storage', JSON.stringify(storage)) } - function drop(ev, index) { + function drop(ev, index, fromstorage) { ev.preventDefault(); - + fromstorage=!fromstorage var data = ev.dataTransfer.getData("text"); var inv = getCookie('inv'); inv = JSON.parse(inv) - + var store = getCookie('storage'); + store = JSON.parse(store) + if(fromstorage){ + inv.push(store[data]) + store.splice(data,1) + createCookie('storage', JSON.stringify(store)) + createCookie('inv', JSON.stringify(inv)) + } else { let r = averageColor(hexToRgb(inv[data].color).r, hexToRgb(inv[index].color).r) let g = averageColor(hexToRgb(inv[data].color).g, hexToRgb(inv[index].color).g) let b = averageColor(hexToRgb(inv[data].color).b, hexToRgb(inv[index].color).b) @@ -168,6 +175,7 @@ transform:scale(0.7); createCookie('inv', JSON.stringify(inv)); //} + } } @@ -185,7 +193,7 @@ transform:scale(0.7); function updateInv() { var inve = document.getElementById("inv"); var store = document.getElementById("storage"); - console.log(store.innerHTML) + //console.log(store.innerHTML) var inv = getCookie('inv'); inv = JSON.parse(inv) var storage = getCookie('storage'); @@ -204,10 +212,10 @@ transform:scale(0.7); if(!item.storage){ let t = '{color:' + String(item.color) + ', rarity:' + String(item.rarity) + ', value: ' + String(item.value) + '}' if(item.s){ - i += ("
" + t + " //shiny!
") + i += ("
" + t + " //shiny!
") } else { - i += ("
" + t + "
") + i += ("
" + t + "
") } } else { @@ -216,17 +224,18 @@ transform:scale(0.7); inve.innerHTML = i let s = "storage:[
" + for (let item of storage) { - - + + if(item != null){ let t = '{color:' + String(item.color) + ', rarity:' + String(item.rarity) + ', value: ' + String(item.value) + '}' if(item.s){ - s += ("
" + t + " //shiny!
") + s += ("
" + t + " //shiny!
") } else { - s += ("
" + t + "
") + s += ("
" + t + "
") + } } - } store.innerHTML = s @@ -375,7 +384,7 @@ setFavicons('https://raw.githubusercontent.com/squiresgrant/Antheia/main/icon.ic var inv = getCookie('storage'); inv = JSON.parse(inv) document.write("
") - document.write("inv:{ //https://github.com/squiresgrant v1.2+1 \<3
") + document.write("inv:{ //https://github.com/squiresgrant v1.3+10 \<3 "+ "dXd1IQ==".fontsize(1) +"
") document.write("items:[
") document.write("
") @@ -477,7 +486,8 @@ ________________________________________________________.;;;;'
_______________________________________________________.;;;;'
______________________________________________________;;;;;'
_____________________________________________________,;;;;' //art by susie oviatt (find it here)
- +
+stuck on this page? make sure you have cookies and javascript enabled, dont know how to? goodluck (lol) \ No newline at end of file -- cgit v1.2.3