diff --git a/frontend/src/ts/controllers/challenge-controller.ts b/frontend/src/ts/controllers/challenge-controller.ts index 8544cfc2b354..e36f23882040 100644 --- a/frontend/src/ts/controllers/challenge-controller.ts +++ b/frontend/src/ts/controllers/challenge-controller.ts @@ -341,7 +341,7 @@ export async function setup(challengeName: string): Promise { nosave: true, }); } - } else if (challenge.type === "special") { + } else if (challenge.type === "other") { if (challenge.name === "semimak") { // so can you make a link that sets up 120s, 10k, punct, stop on word, and semimak as the layout? setConfig("mode", "time", { @@ -368,6 +368,23 @@ export async function setup(challengeName: string): Promise { setConfig("keymapMode", "static", { nosave: true, }); + } else if (challenge.name === "wingdings") { + // Ten Words of Pain: 10-word Master mode test using the Wingdings custom font, no keymap + setConfig("mode", "words", { + nosave: true, + }); + setConfig("words", 10, { + nosave: true, + }); + setConfig("difficulty", "master", { + nosave: true, + }); + setConfig("fontFamily", "Wingdings", { + nosave: true, + }); + setConfig("keymapMode", "off", { + nosave: true, + }); } } notitext = challenge.message; @@ -405,6 +422,7 @@ configEvent.subscribe(({ key }) => { "keymapMode", "keymapLayout", "layout", + "fontFamily", ].includes(key) ) { clearActive(); diff --git a/frontend/src/ts/controllers/url-handler.tsx b/frontend/src/ts/controllers/url-handler.tsx index af7057d63e33..a2a97f3116db 100644 --- a/frontend/src/ts/controllers/url-handler.tsx +++ b/frontend/src/ts/controllers/url-handler.tsx @@ -317,12 +317,18 @@ export async function loadChallengeFromUrl( ).toLowerCase(); if (getValue === "") return; - const result = await ChallengeController.setup(getValue); - if (result) { - restartTest({ - nosave: true, + ChallengeController.setup(getValue) + .then((result) => { + if (result) { + restartTest({ + nosave: true, + }); + } + }) + .catch((e: unknown) => { + showErrorNotification("Failed to load challenge"); + console.error(e); }); - } } authEvent.subscribe(async (event) => { diff --git a/frontend/static/challenges/_list.json b/frontend/static/challenges/_list.json index 69d487158ea0..15d430abeb95 100644 --- a/frontend/static/challenges/_list.json +++ b/frontend/static/challenges/_list.json @@ -722,5 +722,20 @@ "display": "Feet warrior", "type": "customTime", "parameters": [3600] + }, + { + "name": "wingdings", + "display": "Ten Words of Pain", + "type": "other", + "parameters": [], + "message": "Complete a 10-word Master mode test using the Wingdings custom font. No keymap allowed. Minimum 60 WPM and 100% accuracy required.", + "requirements": { + "wpm": { + "min": 60 + }, + "acc": { + "min": 100 + } + } } ] diff --git a/packages/schemas/src/challenges.ts b/packages/schemas/src/challenges.ts index a8b30853f80e..8f4611ed74f1 100644 --- a/packages/schemas/src/challenges.ts +++ b/packages/schemas/src/challenges.ts @@ -17,6 +17,7 @@ export const ChallengeSchema = z "script", "accuracy", "funbox", + "other", ]), message: z.string().optional(), parameters: z.array(