From 54cac427a269854f365b1e7cc1899345e828a66e Mon Sep 17 00:00:00 2001 From: Michael Zhang Date: Sat, 27 Jul 2024 16:35:01 -0500 Subject: [PATCH] update readme --- README.md | 5 +++++ src/pages/beatmap.ts | 7 ++++++- src/pages/user.ts | 11 ++++------- 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index e050fc3..48cd6be 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,10 @@ # tweaks +## Features + +- Add difficulty names to the beatmap icons +- More coming soon... + ## Install No distribution packages yet, please follow the development guide to use for now! diff --git a/src/pages/beatmap.ts b/src/pages/beatmap.ts index ccb0454..19d4284 100644 --- a/src/pages/beatmap.ts +++ b/src/pages/beatmap.ts @@ -34,9 +34,13 @@ export async function beatmapPageHandler(m: RegExpMatchArray, path: OsuPath) { ]) beatmapMap.set(JSON.stringify([beatmap.id, beatmap.mode]), beatmap); - const beatmapPicker = await waitForElementToExist( + const beatmapPicker: HTMLDivElement = await waitForElementToExist( ".beatmapset-beatmap-picker", ); + + // I think this makes it more readable + beatmapPicker.style.backdropFilter = "blur(10px)"; + const beatmapPickerChildren: HTMLAnchorElement[] = Array.from( beatmapPicker.children, ); @@ -47,6 +51,7 @@ export async function beatmapPageHandler(m: RegExpMatchArray, path: OsuPath) { const correspondingBeatmap = beatmapMap.get( JSON.stringify([targetBeatmapId, modeString]), ); + if (!correspondingBeatmap) continue; // create the elements and add it to screen const icon = child.children[0]; diff --git a/src/pages/user.ts b/src/pages/user.ts index c8cb014..c4a60e7 100644 --- a/src/pages/user.ts +++ b/src/pages/user.ts @@ -1,8 +1,5 @@ -export async function userPageHandler(m, path) { - console.log("User page"); - let currentUser = await wait( - () => unsafeWindow.currentUser, - (c) => !!c, - ); - console.log(currentUser); +import type { OsuPath } from "../dom"; + +export async function userPageHandler(m: RegExpMatchArray, path: OsuPath) { + // Coming soon! }