Skip to content

Commit

Permalink
Reduce cringe
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielDavis05 committed Oct 2, 2023
1 parent ebff572 commit b6a112b
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 64 deletions.
55 changes: 30 additions & 25 deletions leaderboard/shop/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
<link rel="stylesheet" href="/style/theme.css">
<link rel="stylesheet" href="/style/navbar.css">
<link rel="stylesheet" href="/style/leaderboard.css">

<!-- Load in page specific CSS -->
<link rel="stylesheet" href="/style/store.css">

<!--Scripts re-used across stogacs.club -->
<script src="/scripts/utils.js"></script>
<script src="/scripts/navbar.js"></script>
Expand Down Expand Up @@ -46,35 +46,40 @@
<div style="font-size: 150%; position:absolute; top:100px; padding-bottom: 90px;">
<p id="error-display" class="error-text center-text"></p>
</div>
<div class="pure-u-md-1-24">

<div id="side-cards" style="position: absolute; top: 0px;">
<div class="side-card pure-g">
<div class="card-content center-text">
<div>
<b id="title" class="center-text">Discover the Shekel<span style="color: var(--garnet);">Shop</span></b>
</div>
<img style="padding:30px;" id="${item.id}">
<div>
<p id="description" class="center-text">Purchase power-ups for yourself or the club as a whole. Check back regularly as the shop changes frequently!</p>
<div class="pure-g main">
<div class="pure-u-md-1-24">

<div id="side-cards" style="position: absolute; top: 0px;">
<div class="side-card pure-g">
<div class="card-content center-text">
<div>
<b id="title" class="center-text">Discover the Shekel<span style="color: var(--garnet);">Shop</span></b>
</div>
<img style="padding:30px;" id="${item.id}">
<div>
<p id="description" class="center-text">Purchase power-ups for yourself or the club as a whole. Check
back regularly as the shop changes frequently!</p>
</div>
</div>
</div>
</div>
</div>

</div>
<div class="pure-u-md-18-24 center-form" style="max-width: 1300px;">

<div id="shop-cards">

<noscript>
<p class="center-text error-text" style="font-size: 180%;">JavaScript is <b>required</b> to view this page.<p>
</noscript>

</div>
<div class="pure-u-md-1-24">
<!-- formatting div POST-->
<div style="max-width: 1300px;">

<div id="shop-cards">

<noscript>
<p class="center-text error-text" style="font-size: 180%;">JavaScript is <b>required</b> to view this page.
<p>
</noscript>

</div>
<div class="pure-u-md-1-24">
<!-- formatting div POST-->
</div>
</div>
</div>
</section>
<script async defer src="/scripts/main.js"></script>
</body>
20 changes: 10 additions & 10 deletions scripts/leaderboard/store.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
document.addEventListener("DOMContentLoaded", async function () {
await verifyUser().then(userInfo => {
if (userInfo != null) {
if (userInfo.name == null) {
window.location.href = "/leaderboard/onboarding/claim.html";
}
} else {
window.location.href = "/401";
}
});
// await verifyUser().then(userInfo => {
// if (userInfo != null) {
// if (userInfo.name == null) {
// window.location.href = "/leaderboard/onboarding/claim.html";
// }
// } else {
// window.location.href = "/401";
// }
// });

try {
const response = await fetch("https://shekels.mrsharick.com/shop/items", {
Expand Down Expand Up @@ -103,7 +103,7 @@ document.addEventListener("click", function (event) {
});

function buyProduct(id) {
fetch("https://shekels.mrsharick.com/shop/buy" + "discordAuth=" + getCookie("discordAuth"), {
fetch("https://shekels.mrsharick.com/shop/purchase?" + "discordAuth=" + getCookie("discordAuth"), {
method: "POST",
headers: {
"Content-Type": "application/json",
Expand Down
46 changes: 17 additions & 29 deletions style/store.css
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
:root {
--card-background: #121212;
--buy-button: #75ba75;
overflow-x: scroll;
}

.main {
display: flex;
flex-direction: row;
align-items: center;
flex-basis: calc(57.6%);
margin-top: 120px;

}


#shop-cards, #side-cards {
text-align: center;
margin-top: 120px;
Expand Down Expand Up @@ -34,6 +43,7 @@


.side-card {
margin-left: -250px;
display: flex;
flex-direction: row;
justify-content: center;
Expand Down Expand Up @@ -128,37 +138,15 @@
width: auto;
}

@media screen and (max-width: 768px) {
#side-cards {
display: none;
}
}

@media screen and (max-width: 1074px) {
@media screen and (max-width: 1150px) {
.side-card {
margin-left: -70px;
margin-left: -175px;
}
}

@media screen and (min-width: 1200px) {
.side-card {
margin-left: -120px;
min-width: 150px;
}
}

@media screen and (min-width: 1500px) {
.side-card {
margin-left: -120px;
min-width: 200px;
}
}

@media screen and (min-width: 1600px) {
.side-card {
margin-left: -190px;
min-width: 300px;
@media screen and (max-width: 768px) {
#side-cards {
display: none;
}
}


}

0 comments on commit b6a112b

Please sign in to comment.