Skip to content

Commit

Permalink
Finish for today
Browse files Browse the repository at this point in the history
  • Loading branch information
Parking-Master committed Nov 24, 2022
1 parent cf46cb1 commit 32f6d2d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
23 changes: 12 additions & 11 deletions store.html
Original file line number Diff line number Diff line change
Expand Up @@ -212,24 +212,24 @@ <h1 style="position:relative;width:50%;display:inline-flex;align-items:center;te
<br>
<br>
<div class="card" onclick="purchase(this)">
<img src="images/colors/black.png">
<img src="images/colors/orange.png">
<br>
<p class="title" data-item="ArmorColor.Orange">100 <img id="point" src="icons/point.png" style="display:inline-block;position:relative;width:7%"></p>
</div>
<div class="card" onclick="purchase(this)">
<img src="images/colors/orange.png">
<img src="images/colors/brown.png">
<br>
<p class="title" data-item="ArmorColor.Brown">100 <img id="point" src="icons/point.png" style="display:inline-block;position:relative;width:7%"></p>
</div>
<div class="card" onclick="purchase(this)">
<img src="images/colors/gray.png">
<img src="images/colors/white.png">
<br>
<p class="title" data-item="ArmorColor.Gray">100 <img id="point" src="icons/point.png" style="display:inline-block;position:relative;width:7%"></p>
<p class="title" data-item="ArmorColor.White">100 <img id="point" src="icons/point.png" style="display:inline-block;position:relative;width:7%"></p>
</div>
<div class="card" onclick="purchase(this)">
<img src="images/colors/white.png">
<img src="images/colors/gray.png">
<br>
<p class="title" data-item="ArmorColor.White">100 <img id="point" src="icons/point.png" style="display:inline-block;position:relative;width:7%"></p>
<p class="title" data-item="ArmorColor.Gray">100 <img id="point" src="icons/point.png" style="display:inline-block;position:relative;width:7%"></p>
</div>
<div class="card" onclick="purchase(this)">
<img src="images/colors/black.png">
Expand All @@ -245,20 +245,21 @@ <h1 style="position:relative;width:50%;display:inline-flex;align-items:center;te
if (Object.values(item.querySelector(".title").classList).indexOf("owned") > -1) {
return swal({
title: "Sell item",
text: "You already own this item. Do you want to sell it for 0 points?",
text: "You already own this item. Do you want to sell it for " + item.querySelector(".title").textContent + " points?",
buttons: ["Yes", "No"]
}).then(e => {
e = !e;
if (e) {
userMan.set("items", userMan.get("items").replace(item.querySelector(".title").dataset.item, ""), () => {});
userMan.set("items", userMan.get("items").replace(",,", ","), () => {});
setTimeout(() => location.reload(), 500);
setTimeout(() => userMan.set("items", userMan.get("items").replace(item.querySelector(".title").dataset.item, ""), () => {}), 500);
setTimeout(() => userMan.set("items", userMan.get("items").replace(",,", ","), () => {}), 1000);
setTimeout(() => userMan.set("points", (userMan.get("points") - 0) + (item.querySelector(".title").textContent.trim().replace("Free", "0") - 0), () => {}), 1500);
swal({ text: "Selling item in progress...", button: false }), setTimeout(() => location.reload(), 2000);
}
});
}
swal({
title: "Purchase item",
text: "Do you want to purchase this item for " + item.querySelector(".title").textContent.trim() + " points?",
text: "Do you want to purchase the item \"" + (item.querySelector(".title").dataset.item.split(".")[1].replace("_", " ") + " " + item.querySelector(".title").dataset.item.split(".")[0].replace("ArmorColor", "Armor Color")) + "\" for " + item.querySelector(".title").textContent.trim() + " points?",
buttons: ["Yes", "No"]
}).then(e => {
e = !e;
Expand Down
1 change: 1 addition & 0 deletions userman.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ userMan.logIn = function logIn(username, password, callback, err, additionalRows
});
}
userMan.logOut = function logOut(reload = true) {
Parse.User.logOut();
Object.keys(localStorage).forEach(x => x.startsWith("userman-") && localStorage.removeItem(x));
sessionStorage.clear();
reload && location.reload(true);
Expand Down

0 comments on commit 32f6d2d

Please sign in to comment.