Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions frontend/src/ts/commandline/commandline-metadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -493,10 +493,6 @@ export const commandlineConfigMetadata: CommandlineConfigMetadataObject = {
},

//appearence
timerStyle: {
subgroup: { options: "fromSchema" },
alias: "timer",
},
liveSpeedStyle: {
subgroup: {
options: "fromSchema",
Expand All @@ -515,14 +511,21 @@ export const commandlineConfigMetadata: CommandlineConfigMetadataObject = {
},
alias: "wpm",
},
timerStyle: {
display: "Live progress style...",
subgroup: { options: "fromSchema" },
alias: "timer",
},
timerColor: {
display: "Live progress color...",
alias: "timer speed wpm burst acc",
subgroup: {
options: "fromSchema",
alias: () => "timer",
},
},
timerOpacity: {
display: "Live progress opacity...",
alias: "timer speed wpm burst acc",
subgroup: {
options: "fromSchema",
Expand Down
6 changes: 5 additions & 1 deletion frontend/src/ts/commandline/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,12 @@ function _buildCommandForConfigKey<
configMeta: configMeta as unknown as ConfigMetadata<
keyof ConfigSchemas.Config
>,
schema,
schema:
"secondKey" in inputProps
? ConfigSchemas.ConfigSchema.shape[inputProps.secondKey]
: schema,
});

if (result === undefined) {
return inputCommand;
}
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/ts/constants/fonts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export type FontConfig = {

export const Fonts: Record<KnownFontName, FontConfig> = {
Roboto_Mono: {
fileName: "Roboto-Regular.woff2",
fileName: "RobotoMono-Regular.woff2",
},
Noto_Naskh_Arabic: {
fileName: "NotoNaskhArabic-Regular.woff2",
Expand All @@ -38,7 +38,7 @@ export const Fonts: Record<KnownFontName, FontConfig> = {
fileName: "JetBrainsMono-Regular.woff2",
},
Roboto: {
fileName: "RobotoMono-Regular.woff2",
fileName: "Roboto-Regular.woff2",
},
Montserrat: {
fileName: "Montserrat-Regular.woff2",
Expand Down
28 changes: 28 additions & 0 deletions frontend/src/ts/test/test-logic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1149,6 +1149,34 @@ export async function finish(difficultyFailed = false): Promise<void> {
completedEvent.keyDuration = "toolong";
}

if (
completedEvent.wpm === 0 &&
!difficultyFailed &&
completedEvent.testDuration >= 5
) {
const roundedTime = Math.round(completedEvent.testDuration);

const messages = [
`Congratulations. You just wasted ${roundedTime} seconds of your life by typing nothing. Be proud of yourself.`,
`Bravo! You've managed to waste ${roundedTime} seconds and accomplish exactly zero. A true productivity icon.`,
`That was ${roundedTime} seconds of absolutely legendary idleness. History will remember this moment.`,
`Wow, ${roundedTime} seconds of typing... nothing. Bold. Mysterious. Completely useless.`,
`Thank you for those ${roundedTime} seconds of utter nothingness. The keyboard needed the break.`,
`A breathtaking display of inactivity. ${roundedTime} seconds of absolutely nothing. Powerful.`,
`You just gave ${roundedTime} seconds of your life to the void. And the void says thanks.`,
`Stunning. ${roundedTime} seconds of intense... whatever that wasn't. Keep it up, champ.`,
`Is it performance art? A protest? Or just ${roundedTime} seconds of glorious nothing? We may never know.`,
`You typed nothing for ${roundedTime} seconds. And in that moment, you became legend.`,
];

Result.showConfetti();
Notifications.add(Arrays.randomElementFromArray(messages), 0, {
customTitle: "Nice",
duration: 15,
important: true,
});
}

if (dontSave) {
void AnalyticsController.log("testCompletedInvalid");
return;
Expand Down
Loading