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
5 changes: 3 additions & 2 deletions .github/workflows/pretty-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,9 @@ jobs:
with:
version: ${{ env.PNPM_VERSION }}

- name: Install prettier
run: pnpm add -g prettier@3.6.2
- name: Install Prettier deps only
run: pnpm install -D -w prettier @prettier/plugin-oxc


- name: Get changed files
id: get-changed-files
Expand Down
9 changes: 1 addition & 8 deletions .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,5 @@
"htmlWhitespaceSensitivity": "ignore",
"trailingComma": "all",
"endOfLine": "lf",
"overrides": [
{
"files": ["*.ts"],
"options": {
"parser": "typescript"
}
}
]
"plugins": ["@prettier/plugin-oxc"]
}
3 changes: 1 addition & 2 deletions backend/__tests__/vitest.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ interface ThrowMatcher {
declare module "vitest" {
interface Assertion<T = any> extends RestRequestMatcher<T>, ThrowMatcher {}
interface AsymmetricMatchersContaining
extends RestRequestMatcher,
ThrowMatcher {}
extends RestRequestMatcher, ThrowMatcher {}
}

interface MatcherResult {
Expand Down
24 changes: 12 additions & 12 deletions frontend/src/html/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ <h1 class="text">
id="startTestButton"
class="textButton view-start"
href="/"
onclick="this.blur();"
onclick="this.blur()"
router-link
title="start test"
>
Expand All @@ -70,7 +70,7 @@ <h1 class="text">
<a
class="textButton view-leaderboards"
href="/leaderboards"
onclick="this.blur();"
onclick="this.blur()"
router-link
title="leaderboards"
>
Expand All @@ -81,7 +81,7 @@ <h1 class="text">
<a
class="textButton view-about"
href="/about"
onclick="this.blur();"
onclick="this.blur()"
router-link
title="about"
>
Expand All @@ -103,7 +103,7 @@ <h1 class="text">
<a
class="textButton view-settings"
href="/settings"
onclick="this.blur();"
onclick="this.blur()"
router-link
title="settings"
>
Expand All @@ -112,7 +112,7 @@ <h1 class="text">
</div>
</a>
<div></div>
<button class="text showAlerts" onclick="this.blur();">
<button class="text showAlerts" onclick="this.blur()">
<div class="icon">
<i class="fas fa-fw fa-bell"></i>
</div>
Expand All @@ -121,7 +121,7 @@ <h1 class="text">
<a
class="textButton view-login"
href="/login"
onclick="this.blur();"
onclick="this.blur()"
router-link
>
<i class="far fa-fw fa-user"></i>
Expand All @@ -130,7 +130,7 @@ <h1 class="text">
<a
class="textButton view-account"
href="/account"
onclick="this.blur();"
onclick="this.blur()"
router-link
>
<div class="spinner">
Expand All @@ -154,14 +154,14 @@ <h1 class="text">
<div class="menu">
<div class="spacer"></div>
<div class="items">
<a href="/account" class="button" onclick="this.blur();" router-link>
<a href="/account" class="button" onclick="this.blur()" router-link>
<i class="fas fa-fw fa-chart-line"></i>
User stats
</a>
<a
href="/friends"
class="button goToFriends"
onclick="this.blur();"
onclick="this.blur()"
router-link
>
<i class="fas fa-fw fa-user-friends"></i>
Expand All @@ -171,7 +171,7 @@ <h1 class="text">
<a
href="/404"
class="button goToProfile"
onclick="this.blur();"
onclick="this.blur()"
router-link
>
<i class="fas fa-fw fa-globe-americas"></i>
Expand All @@ -180,13 +180,13 @@ <h1 class="text">
<a
href="/account-settings"
class="button"
onclick="this.blur();"
onclick="this.blur()"
router-link
>
<i class="fas fa-fw fa-cog"></i>
Account settings
</a>
<button class="signOut" onclick="this.blur();">
<button class="signOut" onclick="this.blur()">
<i class="fas fa-fw fa-sign-out-alt"></i>
Sign out
</button>
Expand Down
5 changes: 4 additions & 1 deletion frontend/src/html/pages/settings.html
Original file line number Diff line number Diff line change
Expand Up @@ -856,13 +856,16 @@
</button>
</div>
<div class="text">
Change the style of the timer/word count during a test.
Change the style of the timer/word count during a test. "Flash" styles
will briefly show the timer in timed modes every 15 seconds.
</div>
<div class="buttons">
<button data-config-value="off">off</button>
<button data-config-value="bar">bar</button>
<button data-config-value="text">text</button>
<button data-config-value="mini">mini</button>
<button data-config-value="flash text">flash text</button>
<button data-config-value="flash mini">flash mini</button>
</div>
</div>
<div class="section" data-config-name="liveSpeedStyle">
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/privacy-policy.html
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ <h1 id="Advertisements">Advertisements</h1>
especially for delivering ads to iOS and MacOS browsers. Users can opt
out of the Common ID tracking cookie by clicking
<a
onclick="window.setCookie('_pubcid_optout', '1', 1825);"
onclick="window.setCookie('_pubcid_optout', '1', 1825)"
href="#opt-out"
>
here
Expand Down
6 changes: 6 additions & 0 deletions frontend/src/styles/settings.scss
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,12 @@
}
}

&[data-config-name="timerStyle"] {
.buttons {
grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr));
}
}

&.tags {
.tagsListAndButton {
grid-area: buttons;
Expand Down
56 changes: 56 additions & 0 deletions frontend/src/ts/test/timer-progress.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,22 @@ export function show(): void {
textEl.classList.remove("hidden");
},
});
} else if (Config.timerStyle === "flash mini") {
animate(miniEl, {
opacity: [0, 1],
duration: applyReducedMotion(125),
onBegin: () => {
miniEl.classList.remove("hidden");
},
});
} else if (Config.timerStyle === "flash text") {
animate(textEl, {
opacity: [0, 1],
duration: applyReducedMotion(125),
onBegin: () => {
textEl.classList.remove("hidden");
},
});
} else if (Config.mode === "zen" || Config.timerStyle === "mini") {
animate(miniEl, {
opacity: [0, 1],
Expand Down Expand Up @@ -124,6 +140,30 @@ export function update(): void {
if (textEl !== null) {
textEl.innerHTML = "<div>" + displayTime + "</div>";
}
} else if (Config.timerStyle === "flash mini") {
let displayTime = DateTime.secondsToString(maxtime - time);
if (maxtime === 0) {
displayTime = DateTime.secondsToString(time);
}
if (miniEl !== null) {
if ((maxtime - time) % 15 !== 0) {
miniEl.style.opacity = "0";
} else {
miniEl.style.opacity = "1";
}
miniEl.innerHTML = "<div>" + displayTime + "</div>";
}
} else if (Config.timerStyle === "flash text") {
let displayTime = DateTime.secondsToString(maxtime - time);
if (maxtime === 0) {
displayTime = DateTime.secondsToString(time);
}
if (textEl !== null) {
textEl.innerHTML =
"<div>" +
`${(maxtime - time) % 15 !== 0 ? "" : displayTime}` +
"</div>";
}
} else if (Config.timerStyle === "mini") {
let displayTime = DateTime.secondsToString(maxtime - time);
if (maxtime === 0) {
Expand Down Expand Up @@ -163,6 +203,18 @@ export function update(): void {
} else {
textEl.innerHTML = `<div>${getCurrentCount()}/${outof}</div>`;
}
} else if (Config.timerStyle === "flash mini") {
if (outof === 0) {
miniEl.innerHTML = `${TestInput.input.getHistory().length}`;
} else {
miniEl.innerHTML = `${getCurrentCount()}/${outof}`;
}
} else if (Config.timerStyle === "flash text") {
if (outof === 0) {
textEl.innerHTML = `<div>${TestInput.input.getHistory().length}</div>`;
} else {
textEl.innerHTML = `<div>${getCurrentCount()}/${outof}</div>`;
}
} else if (Config.timerStyle === "mini") {
if (outof === 0) {
miniEl.innerHTML = `${TestInput.input.getHistory().length}`;
Expand All @@ -173,6 +225,10 @@ export function update(): void {
} else if (Config.mode === "zen") {
if (Config.timerStyle === "text") {
textEl.innerHTML = `<div>${TestInput.input.getHistory().length}</div>`;
} else if (Config.timerStyle === "flash mini") {
miniEl.innerHTML = `${TestInput.input.getHistory().length}`;
} else if (Config.timerStyle === "flash text") {
textEl.innerHTML = `<div>${TestInput.input.getHistory().length}</div>`;
} else {
miniEl.innerHTML = `${TestInput.input.getHistory().length}`;
}
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
"@commitlint/cli": "17.7.1",
"@commitlint/config-conventional": "19.2.2",
"@monkeytype/release": "workspace:*",
"@prettier/plugin-oxc": "0.1.1",
"@vitest/coverage-v8": "4.0.8",
"conventional-changelog": "6.0.0",
"eslint": "8.57.1",
Expand All @@ -75,7 +76,7 @@
"lint-staged": "13.2.3",
"only-allow": "1.2.1",
"oxlint": "1.29.0",
"prettier": "3.6.2",
"prettier": "3.7.1",
"turbo": "2.5.6",
"vitest": "4.0.8"
},
Expand Down
9 changes: 8 additions & 1 deletion packages/schemas/src/configs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,14 @@ export type ConfidenceMode = z.infer<typeof ConfidenceModeSchema>;
export const IndicateTyposSchema = z.enum(["off", "below", "replace", "both"]);
export type IndicateTypos = z.infer<typeof IndicateTyposSchema>;

export const TimerStyleSchema = z.enum(["off", "bar", "text", "mini"]);
export const TimerStyleSchema = z.enum([
"off",
"bar",
"text",
"mini",
"flash text",
"flash mini",
]);
export type TimerStyle = z.infer<typeof TimerStyleSchema>;

export const LiveSpeedAccBurstStyleSchema = z.enum(["off", "text", "mini"]);
Expand Down
Loading
Loading