Skip to content

Commit

Permalink
chore: add plushie banner
Browse files Browse the repository at this point in the history
  • Loading branch information
Miodec committed Mar 1, 2024
1 parent d4ec11f commit 03311d8
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 19 deletions.
40 changes: 21 additions & 19 deletions frontend/src/ts/ready.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,34 +46,36 @@ $(document).ready(() => {
if (Config.quickRestart !== "off") {
$("#restartTestButton").addClass("hidden");
}
const merchBannerClosed =
window.localStorage.getItem("merchbannerclosed") === "true";
if (!merchBannerClosed) {
Notifications.addBanner(
`Check out our merchandise, available at <a target="_blank" rel="noopener" href="https://monkeytype.store/">monkeytype.store</a>`,
1,
"./images/merch2.png",
false,
() => {
window.localStorage.setItem("merchbannerclosed", "true");
},
true
);
}

// if (!window.localStorage.getItem("merchbannerclosed2")) {
// const merchBannerClosed =
// window.localStorage.getItem("merchbannerclosed") === "true";
// if (!merchBannerClosed) {
// Notifications.addBanner(
// `Three new merch designs, available at <a target="_blank" href="https://www.monkeytype.store/unisex-men-s-t-shirts/">monkeytype.store</a>`,
// `Check out our merchandise, available at <a target="_blank" rel="noopener" href="https://monkeytype.store/">monkeytype.store</a>`,
// 1,
// "images/cutoutbanner.png",
// "./images/merch2.png",
// false,
// () => {
// window.localStorage.setItem("merchbannerclosed2", "true");
// window.localStorage.setItem("merchbannerclosed", "true");
// },
// true
// );
// }

const plushieBannerClosed =
window.localStorage.getItem("plushieBannerClosed") === "true";
if (!plushieBannerClosed) {
Notifications.addBanner(
`George Plushie - available now for a limited time! <a target="_blank" rel="noopener" href="https://www.monkeytype.store/listing/george-plushie/">monkeytype.store</a>`,
1,
"./images/plushiebanner.png",
false,
() => {
window.localStorage.setItem("plushieBannerClosed", "true");
},
true
);
}

setTimeout(() => {
FunboxList.get(Config.funbox).forEach((it) =>
it.functions?.applyGlobalCSS?.()
Expand Down
Binary file added frontend/static/images/plushiebanner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 03311d8

Please sign in to comment.