mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-09-12 09:37:29 +08:00
change font size type
This commit is contained in:
parent
e0e4ddf325
commit
fc6f0e78a4
4 changed files with 8 additions and 8 deletions
|
@ -31,7 +31,7 @@ const CONFIG_SCHEMA = joi.object({
|
|||
mode: joi.string().valid("time", "words", "quote", "zen", "custom"),
|
||||
quoteLength: joi.array().items(joi.number()),
|
||||
language: joi.string(),
|
||||
fontSize: joi.string().valid("1", "125", "15", "2", "3", "4"),
|
||||
fontSize: joi.string().valid("1", "1.25", "1.5", "2", "3", "4"),
|
||||
freedomMode: joi.boolean(),
|
||||
difficulty: joi.string().valid("normal", "expert", "master"),
|
||||
blindMode: joi.boolean(),
|
||||
|
|
|
@ -49,7 +49,7 @@ const defaultConfig: MonkeyTypes.Config = {
|
|||
mode: "time",
|
||||
quoteLength: [1],
|
||||
language: "english",
|
||||
fontSize: "15",
|
||||
fontSize: "1.5",
|
||||
freedomMode: false,
|
||||
resultFilters: null,
|
||||
difficulty: "normal",
|
||||
|
@ -1514,7 +1514,7 @@ export function setFontSize(
|
|||
fontSize: MonkeyTypes.FontSize,
|
||||
nosave?: boolean
|
||||
): void {
|
||||
if (!isConfigValueValid(fontSize, [["1", "125", "15", "2", "3", "4"]]))
|
||||
if (!isConfigValueValid(fontSize, [["1", "1.25", "1.5", "2", "3", "4"]]))
|
||||
return invalid("font size", fontSize);
|
||||
|
||||
if (fontSize == null || fontSize == undefined) {
|
||||
|
@ -1542,11 +1542,11 @@ export function setFontSize(
|
|||
$("#miniTimerAndLiveWpm").removeClass("size35");
|
||||
$("#miniTimerAndLiveWpm").removeClass("size4");
|
||||
|
||||
if (fontSize == "125") {
|
||||
if (fontSize == "1.25") {
|
||||
$("#words").addClass("size125");
|
||||
$("#caret, #paceCaret").addClass("size125");
|
||||
$("#miniTimerAndLiveWpm").addClass("size125");
|
||||
} else if (fontSize == "15") {
|
||||
} else if (fontSize == "1.5") {
|
||||
$("#words").addClass("size15");
|
||||
$("#caret, #paceCaret").addClass("size15");
|
||||
$("#miniTimerAndLiveWpm").addClass("size15");
|
||||
|
|
|
@ -2192,7 +2192,7 @@ const commandsFontSize: MonkeyTypes.CommandsGroup = {
|
|||
display: "1.25x",
|
||||
configValue: 125,
|
||||
exec: (): void => {
|
||||
UpdateConfig.setFontSize("125");
|
||||
UpdateConfig.setFontSize("1.25");
|
||||
TestLogic.restart();
|
||||
},
|
||||
},
|
||||
|
@ -2201,7 +2201,7 @@ const commandsFontSize: MonkeyTypes.CommandsGroup = {
|
|||
display: "1.5x",
|
||||
configValue: 15,
|
||||
exec: (): void => {
|
||||
UpdateConfig.setFontSize("15");
|
||||
UpdateConfig.setFontSize("1.5");
|
||||
TestLogic.restart();
|
||||
},
|
||||
},
|
||||
|
|
2
frontend/src/scripts/types/types.d.ts
vendored
2
frontend/src/scripts/types/types.d.ts
vendored
|
@ -25,7 +25,7 @@ declare namespace MonkeyTypes {
|
|||
|
||||
type QuoteLengthArray = QuoteLength[];
|
||||
|
||||
type FontSize = "1" | "125" | "15" | "2" | "3" | "4";
|
||||
type FontSize = "1" | "1.25" | "1.5" | "2" | "3" | "4";
|
||||
|
||||
type CaretStyle =
|
||||
| "off"
|
||||
|
|
Loading…
Add table
Reference in a new issue