mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-09-13 10:05:20 +08:00
added ascii funbox
This commit is contained in:
parent
01eaba1b72
commit
5dd37dd677
3 changed files with 23 additions and 1 deletions
|
@ -47,6 +47,10 @@
|
|||
"name": "58008",
|
||||
"type": "script"
|
||||
},
|
||||
{
|
||||
"name": "ascii",
|
||||
"type": "script"
|
||||
},
|
||||
{
|
||||
"name": "specials",
|
||||
"type": "script"
|
||||
|
|
|
@ -333,3 +333,12 @@ function getSpecials() {
|
|||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
function getASCII() {
|
||||
let randLen = Math.floor(Math.random() * 10) + 1;
|
||||
let ret = "";
|
||||
for (let i = 0; i < randLen; i++) {
|
||||
ret += String.fromCharCode(33 + Math.floor(Math.random() * 94));
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
|
|
@ -403,6 +403,9 @@ function initWords() {
|
|||
} else if (activeFunBox === "specials") {
|
||||
setPunctuation(false);
|
||||
randomWord = getSpecials();
|
||||
} else if (activeFunBox === "ascii") {
|
||||
setPunctuation(false);
|
||||
randomWord = getASCII();
|
||||
}
|
||||
|
||||
if (config.punctuation && config.mode != "custom") {
|
||||
|
@ -605,6 +608,8 @@ function addWord() {
|
|||
randomWord = getNumbers();
|
||||
} else if (activeFunBox === "specials") {
|
||||
randomWord = getSpecials();
|
||||
} else if (activeFunBox === "ascii") {
|
||||
randomWord = getASCII();
|
||||
}
|
||||
|
||||
if (config.punctuation && config.mode != "custom") {
|
||||
|
@ -2398,7 +2403,11 @@ function changeMode(mode, nosave) {
|
|||
$("#top .config .customText").addClass("hidden");
|
||||
$("#top .config .punctuationMode").removeClass("hidden");
|
||||
} else if (config.mode == "custom") {
|
||||
if (activeFunBox === "58008" || activeFunBox === "gibberish") {
|
||||
if (
|
||||
activeFunBox === "58008" ||
|
||||
activeFunBox === "gibberish" ||
|
||||
activeFunBox === "ascii"
|
||||
) {
|
||||
activeFunBox = "none";
|
||||
updateTestModesNotice();
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue