aboutsummaryrefslogtreecommitdiff
path: root/index.html
diff options
context:
space:
mode:
authoramelia <[email protected]>2022-06-17 22:35:50 -0500
committeramelia <[email protected]>2022-06-17 22:35:50 -0500
commit25c18c481666857a3123e08db0bdc541b6cb88b8 (patch)
treefd38ca5eb812c45795b5ace601b68d761a463e60 /index.html
parent1371f48a83bc45bc3c3bbe47ebd12ef4a9b835f9 (diff)
added localhost support
Diffstat (limited to 'index.html')
-rw-r--r--index.html26
1 files changed, 21 insertions, 5 deletions
diff --git a/index.html b/index.html
index 9b965b6..542879d 100644
--- a/index.html
+++ b/index.html
@@ -19,6 +19,9 @@ transform:scale(0.7);
<script>
+ //set background to dark grey
+ var BgColor = '#222222';
+ document.body.style.backgroundColor = BgColor;
let ranks = {
1:"poor",
100:"painter",
@@ -195,6 +198,17 @@ transform:scale(0.7);
}
+ function toInv(index) {
+ var inv = getCookie('inv');
+ inv = JSON.parse(inv)
+ var store = getCookie('storage');
+ store = JSON.parse(store)
+ inv.push(store[index])
+ store.splice(index, 1)
+ createCookie('storage', JSON.stringify(store));
+ createCookie('inv', JSON.stringify(inv));
+ updateInv()
+ }
function updateInv() {
var inve = document.getElementById("inv");
var store = document.getElementById("storage");
@@ -206,6 +220,7 @@ transform:scale(0.7);
var balance = document.getElementById("balance");
balance.innerHTML = getCookie("bank") + " <font size=1.5>(" + getRank() + ")</font>"
let i = ""
+
for (let item of inv) {
@@ -226,10 +241,10 @@ transform:scale(0.7);
if(item != null){
let t = '{color:' + String(item.color) + ', rarity:' + String(item.rarity) + ', value: ' + String(item.value) + '}'
if(item.s){
- s += ("<div ondrop=\"drop(event," + inv.indexOf(item) + ", 'store')\" ondragstart=\"drag(event, 'store')\" ondragover=\"allowDrop(event)\" draggable=\"true\" class='shiny' onmouseout='this.innerHTML = \"" + t + "\"'onmouseover='this.innerHTML=\"drag into inv to sell/combine \"' id='" + storage.indexOf(item) + "'>" + t + " //shiny!</div>")
+ s += ("<div ondrop=\"drop(event," + inv.indexOf(item) + ", 'store')\" ondragstart=\"drag(event, 'store')\" ondragover=\"allowDrop(event)\" draggable=\"true\" class='shiny' onmouseout='this.innerHTML = \"" + t + "\"'onmouseover='this.innerHTML=\"click to move to inv \"' id='" + storage.indexOf(item) + "'>" + t + " //shiny!</div>")
} else {
- s += ("<div ondrop=\"drop(event," + inv.indexOf(item) + ", 'store')\" ondragstart=\"drag(event, 'store')\" ondragover=\"allowDrop(event)\" draggable=\"true\" onmouseout='this.innerHTML = \"" + t + "\"'onmouseover='this.innerHTML=\"drag into inv to sell/combine \"' id='" + storage.indexOf(item) + "'style='color:" + item.color + ";'>" + t + "</div>")
+ s += ("<div ondrop=\"drop(event," + inv.indexOf(item) + ", 'store')\" ondragstart=\"drag(event, 'store')\" ondragover=\"allowDrop(event)\" draggable=\"true\" onmouseout='this.innerHTML = \"" + t + "\"'onmouseover='this.innerHTML=\"click to move to inv \"' onclick='toInv(" + storage.indexOf(item) + ");' id='" + storage.indexOf(item) + "'style='color:" + item.color + ";'>" + t + "</div>")
}
}
}
@@ -237,7 +252,7 @@ transform:scale(0.7);
}
function clear() {
- createCookie('inv', JSON.stringify([]));
+ createCookie('inv', JSON.stringify([]))
createCookie('storage', JSON.stringify([]));
createCookie('bank', 15);
}
@@ -339,9 +354,9 @@ transform:scale(0.7);
.then(data => {
var intervalID = window.setInterval(myCallback, 500);
-
function myCallback() {
updateInv()
+
x = document.getElementsByClassName("shiny")
for(let i of x){
inner = i.innerHTML.split("")
@@ -359,6 +374,7 @@ transform:scale(0.7);
}
document.write("<title>Antheia</title>")
+
function setFavicons(favImg){
let headTitle = document.querySelector('head');
let setFavicon = document.createElement('link');
@@ -430,7 +446,7 @@ setFavicons('https://raw.githubusercontent.com/squiresgrant/Antheia/main/icon.ic
}
-
+ document.body.style.backgroundColor = BgColor;
return (0)
}).then((open) => {
var number = 5; //just for an example