added rAnDoMcAsE funbox mode

This commit is contained in:
Jack 2020-08-02 22:48:03 +01:00
parent e3a529058f
commit 8ae3717613
2 changed files with 24 additions and 1 deletions

View file

@ -21,5 +21,9 @@
{
"name": "choo_choo",
"type": "style"
},
{
"name": "rAnDoMcAsE",
"type": "script"
}
]

View file

@ -242,6 +242,7 @@ function activateFunbox(funbox, mode) {
}
activeFunBox = funbox;
}
updateTestModesNotice();
}
function toggleScriptFunbox(...params) {
@ -450,7 +451,19 @@ function initWords() {
if (config.punctuation && config.mode != "custom") {
randomWord = punctuateWord(previousWord, randomWord, i, wordsBound);
}
wordsList.push(randomWord);
if (activeFunBox === "rAnDoMcAsE") {
let randomcaseword = "";
for (let i = 0; i < randomWord.length; i++) {
if (i % 2 != 0) {
randomcaseword += randomWord[i].toUpperCase();
} else {
randomcaseword += randomWord[i];
}
}
wordsList.push(randomcaseword);
} else {
wordsList.push(randomWord);
}
}
} else if (config.mode == "custom") {
// let w = customText.split(" ");
@ -2575,6 +2588,12 @@ function updateTestModesNotice() {
);
}
if (activeFunBox !== "none") {
$(".pageTest #testModesNotice").append(
`<div><i class="fas fa-gamepad"></i>${activeFunBox}</div>`
);
}
if (config.confidenceMode === "on") {
$(".pageTest #testModesNotice").append(
`<div><i class="fas fa-backspace"></i>confidence</div>`