Skip to content

Commit

Permalink
impr(dev options): add button to test xp bar
Browse files Browse the repository at this point in the history
!nuf
  • Loading branch information
Miodec committed Sep 26, 2024
1 parent 840c0c2 commit 3393e27
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions frontend/src/html/popups.html
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
<button class="toggleMediaQueryDebug">toggle media query debug</button>
<button class="showTestNotifications">show test notifications</button>
<button class="showRealWordsInput">show real words input</button>
<button class="xpBarTest">xp bar test</button>
</div>
</dialog>

Expand Down
15 changes: 15 additions & 0 deletions frontend/src/ts/modals/dev-options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import * as Notifications from "../elements/notifications";
import { setMediaQueryDebugLevel } from "../ui";
import { signIn } from "../controllers/account-controller";
import * as Loader from "../elements/loader";
import { update } from "../elements/xp-bar";

let mediaQueryDebugLevel = 0;

Expand Down Expand Up @@ -68,6 +69,20 @@ async function setup(modalEl: HTMLElement): Promise<void> {
);
void modal.hide();
});
modalEl.querySelector(".xpBarTest")?.addEventListener("click", () => {
setTimeout(() => {
void update(1000000, 20800, {
base: 100,
fullAccuracy: 200,
accPenalty: 300,
quote: 400,
punctuation: 500,
streak: 10_000,
configMultiplier: 2,
});
}, 500);
void modal.hide();
});
}

const modal = new AnimatedModal({
Expand Down

0 comments on commit 3393e27

Please sign in to comment.