From aa58a733a726b481741eb895723f4914116e79b1 Mon Sep 17 00:00:00 2001 From: Spurk <89559431+Spurkus@users.noreply.github.com> Date: Mon, 9 Dec 2024 23:25:23 +1100 Subject: feat(funbox): add underscore_spaces funbox (@spurkus) (#6094) --- frontend/src/styles/test.scss | 7 +++++++ frontend/src/ts/pages/settings.ts | 3 +++ frontend/src/ts/test/funbox/funbox-functions.ts | 8 +++++++- frontend/src/ts/test/words-generator.ts | 10 +++++++--- packages/funbox/src/list.ts | 8 ++++++++ packages/funbox/src/types.ts | 1 + 6 files changed, 33 insertions(+), 4 deletions(-) diff --git a/frontend/src/styles/test.scss b/frontend/src/styles/test.scss index 8a437be05..2d06e5bb2 100644 --- a/frontend/src/styles/test.scss +++ b/frontend/src/styles/test.scss @@ -1338,6 +1338,13 @@ body.fb-nospace { } } +/* funbox underscore_spaces */ +body.fb-underscore-spaces { + #words .word { + margin: 0.5em 0; + } +} + /* funbox arrows */ body.fb-arrows { #words .word { diff --git a/frontend/src/ts/pages/settings.ts b/frontend/src/ts/pages/settings.ts index 5b7e507d6..2f1cf76b0 100644 --- a/frontend/src/ts/pages/settings.ts +++ b/frontend/src/ts/pages/settings.ts @@ -612,6 +612,9 @@ async function fillSettingsPage(): Promise { /_/g, " " )}`; + } else if (funbox.name === "underscore_spaces") { + // Display as "underscore_spaces". Does not replace underscores with spaces. + funboxElHTML += `
${funbox.name}
`; } else { funboxElHTML += `
= { frontendFunctions: ["alterText"], name: "instant_messaging", }, + underscore_spaces: { + description: "Underscores_are_better.", + canGetPb: false, + difficultyLevel: 0, + properties: ["ignoresLanguage", "ignoresLayout", "nospace"], + frontendFunctions: ["alterText"], + name: "underscore_spaces", + }, ALL_CAPS: { description: "WHY ARE WE SHOUTING?", canGetPb: false, diff --git a/packages/funbox/src/types.ts b/packages/funbox/src/types.ts index c410a911f..cd9e0c481 100644 --- a/packages/funbox/src/types.ts +++ b/packages/funbox/src/types.ts @@ -39,6 +39,7 @@ export type FunboxName = | "backwards" | "ddoouubblleedd" | "instant_messaging" + | "underscore_spaces" | "ALL_CAPS"; export type FunboxForcedConfig = Record; -- cgit v1.2.3