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
4 changes: 2 additions & 2 deletions frontend/src/ts/elements/custom-background-filter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ export function apply(): void {
filter: filterCSS,
width: `calc(100% + ${filters.blur.value * 4}rem)`,
height: `calc(100% + ${filters.blur.value * 4}rem)`,
left: `-${filters.blur.value * 2}rem`,
top: `-${filters.blur.value * 2}rem`,
// left: `-${filters.blur.value * 2}rem`,
// top: `-${filters.blur.value * 2}rem`,
position: "absolute",
};
qs(".customBackground img")?.setStyle(css);
Expand Down
9 changes: 7 additions & 2 deletions frontend/src/ts/input/hotkeys/quickrestart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { getActivePage } from "../../states/core";
import { hotkeys, quickRestartHotkeyMap } from "../../states/hotkeys";
import { createHotkey } from "./utils";
import { getConfig } from "../../config/store";
import { isLongTest } from "../../states/test";
import { isLongTest, wordsHaveNewline, wordsHaveTab } from "../../states/test";

function quickRestart(e: KeyboardEvent): void {
if (isAnyPopupVisible()) {
Expand Down Expand Up @@ -37,5 +37,10 @@ createHotkey(
createHotkey(
() => quickRestartHotkeyMap[getConfig.quickRestart],
quickRestart,
() => ({ enabled: isLongTest() }),
() => ({
enabled:
isLongTest() &&
!(wordsHaveTab() && getConfig.quickRestart === "tab") &&
!(wordsHaveNewline() && getConfig.quickRestart === "enter"),
}),
);
18 changes: 15 additions & 3 deletions frontend/src/ts/states/hotkeys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,26 @@ createEffect(() => {

function updateHotkeys(): Hotkeys {
const isOnTestPage = getActivePage() === "test";

const quickRestartIsTab = getConfig.quickRestart === "tab";
const quickRestartIsEnter = getConfig.quickRestart === "enter";
// const quickRestartIsEsc = getConfig.quickRestart === "esc";

const commandlineIsTab = getConfig.quickRestart === "esc";
// const commandlineIsEsc = getConfig.quickRestart !== "esc";

return {
quickRestart: shiftHotkey(
quickRestartHotkeyMap[getConfig.quickRestart],
isOnTestPage && (wordsHaveTab() || isLongTest()),
isOnTestPage &&
((wordsHaveTab() && quickRestartIsTab) ||
((wordsHaveNewline() || getConfig.funbox.includes("58008")) &&
quickRestartIsEnter) ||
isLongTest()),
),
commandline: shiftHotkey(
getConfig.quickRestart === "esc" ? "Tab" : "Escape",
isOnTestPage && wordsHaveNewline(),
commandlineIsTab ? "Tab" : "Escape",
isOnTestPage && wordsHaveTab() && commandlineIsTab,
),
};
}
Expand Down
Loading