fixed issue where text timer would show up regardless of settings.

This commit is contained in:
Noah 2020-07-12 19:24:55 -07:00
parent 3179c8836b
commit 6df7d8e088
10 changed files with 164 additions and 162 deletions

View file

@ -7,7 +7,7 @@
<title>Monkey Type</title>
<link rel="stylesheet" href="css/fa.css">
<link rel="stylesheet" href="css/balloon.css">
<link rel="stylesheet" href="css/style.css?v=33">
<link rel="stylesheet" href="css/style.css">
<link rel="stylesheet" href="themes/serika_dark.css" id="currentTheme">
<link id="favicon" rel="shortcut icon" href="fav.png">
<link rel="shortcut icon" href="fav.png">
@ -889,9 +889,9 @@
<h1>timer opacity</h1>
<div class="text">Change the opacity of the timer number/bar and live wpm number.</div>
<div class="buttons">
<div class="button" opacity=".25" tabindex="0" onclick="this.blur();">.25</div>
<div class="button" opacity=".5" tabindex="0" onclick="this.blur();">.5</div>
<div class="button" opacity=".75" tabindex="0" onclick="this.blur();">.75</div>
<div class="button" opacity="0.25" tabindex="0" onclick="this.blur();">0.25</div>
<div class="button" opacity="0.5" tabindex="0" onclick="this.blur();">0.5</div>
<div class="button" opacity="0.75" tabindex="0" onclick="this.blur();">0.75</div>
<div class="button" opacity="1" tabindex="0" onclick="this.blur();">1</div>
</div>
</div>

View file

@ -163,8 +163,8 @@ function getReleasesFromGitHub() {
<div class="release">
<div class="title">${release.name}</div>
<div class="date">${moment(release.published_at).format(
"DD MMM YYYY"
)}</div>
"DD MMM YYYY"
)}</div>
<div class="body">${release.body.replace(/\r\n/g, "<br>")}</div>
</div>
`);
@ -667,9 +667,12 @@ function changeTimerColor(color) {
}
function changeTimerOpacity(opacity) {
if(opacity){
$("#timerNumber").css("opacity", opacity);
if (opacity) {
$("#liveWpm").css("opacity", opacity);
if (config.timerStyle == "text") {
$("#timerNumber").css("opacity", opacity);
return
}
}
}
@ -899,12 +902,12 @@ function calculateStats() {
chars.incorrectChars +
chars.extraChars) *
(60 / testSeconds)) /
5
5
);
let acc = roundTo2(
(accuracyStats.correct /
(accuracyStats.correct + accuracyStats.incorrect)) *
100
100
);
return {
wpm: isNaN(wpm) ? 0 : wpm,
@ -1060,7 +1063,7 @@ function showResult(difficultyFailed = false) {
activeTags.push(tag.id);
}
});
} catch (e) {}
} catch (e) { }
let completedEvent = {
wpm: stats.wpm,
@ -1380,7 +1383,7 @@ function showResult(difficultyFailed = false) {
tagsText += "<br>" + tag.name;
}
});
} catch (e) {}
} catch (e) { }
if (tagsText == "") {
$("#result .stats .tags").addClass("hidden");
@ -1725,15 +1728,8 @@ function updateLiveWpm(wpm) {
function showLiveWpm() {
if (!config.showLiveWpm) return;
if (!testActive) return;
let op = 0.25;
if (
$("#liveWpm").hasClass("timerSub") ||
$("#liveWpm").hasClass("timerText") ||
$("#liveWpm").hasClass("timerMain")
) {
op = 1;
}
$("#liveWpm").css("opacity", op);
$("#liveWpm").css("opacity", config.timerOpacity);
$("#timerNumber").css("opacity", config.timerOpacity);
}
function hideLiveWpm() {
@ -2004,7 +2000,7 @@ function updateTestModesNotice() {
)}</div>`
);
}
} catch (e) {}
} catch (e) { }
if (anim) {
$(".pageTest #testModesNotice")

View file

@ -194,9 +194,9 @@ function setActiveTimerColorButton() {
function setActiveTimerOpacityButton() {
$(`.pageSettings .section.timerOpacity .buttons .button`).removeClass("active");
$(
`.pageSettings .section.timerOpacity .buttons .button[opacity=` +
`.pageSettings .section.timerOpacity .buttons .button[opacity="` +
config.timerOpacity +
`]`
`"]`
).addClass("active");
}

View file

@ -37,7 +37,7 @@ let defaultConfig = {
colorfulMode: true,
randomTheme: false,
timerColor: "black",
timerOpacity: .25,
timerOpacity: "0.25",
};
let cookieConfig = null;
@ -320,8 +320,8 @@ function setTimerOpacity(opacity, nosave) {
if (opacity == null || opacity == undefined) {
opacity = .25;
}
config.timerOpacity = opacity;
changeTimerOpacity(opacity);
config.timerOpacity = opacity;
if (!nosave) saveConfigToCookie();
}

View file

@ -1,30 +1,32 @@
:root {
--bg-color: #101820;
--main-color: #eedaea;
--caret-color: #eedaea;
--sub-color: #cf6bdd;
--text-color: #eedaea;
--error-color: #ff5253;
--error-extra-color: #e3002b;
--colorful-error-color: #ff5253;
--colorful-error-extra-color: #e3002b;
--bg-color: #101820;
--main-color: #eedaea;
--caret-color: #eedaea;
--sub-color: #cf6bdd;
--text-color: #eedaea;
--error-color: #ff5253;
--error-extra-color: #e3002b;
--colorful-error-color: #ff5253;
--colorful-error-extra-color: #e3002b;
}
#menu .icon-button:nth-child(1) {
color: #e4002b;
}
#menu .icon-button:nth-child(2) {
color: #c53562;
}
#menu .icon-button:nth-child(3) {
color: #95549e;
}
#menu .icon-button:nth-child(4) {
color: #6744a1;
}
#menu .icon-button:nth-child(5),
#menu .icon-button:nth-child(6) {
color: #393c73;
}
#menu .icon-button:nth-child(1){
color: #e4002b;
}
#menu .icon-button:nth-child(2){
color: #c53562;
}
#menu .icon-button:nth-child(3){
color: #95549e;
}
#menu .icon-button:nth-child(4){
color: #6744a1;
}
#menu .icon-button:nth-child(5), #menu .icon-button:nth-child(6){
color: #393c73;
}

View file

@ -1,30 +1,32 @@
:root {
--bg-color: #e1dacb;
--main-color: #7b7d7d;
--caret-color: #7b7d7d;
--sub-color: #b29c5e;
--text-color: #7b7d7d;
--error-color: #f28578;
--error-extra-color: #d56558;
--colorful-error-color: #f28578;
--colorful-error-extra-color: #d56558;
--bg-color: #e1dacb;
--main-color: #7b7d7d;
--caret-color: #7b7d7d;
--sub-color: #b29c5e;
--text-color: #7b7d7d;
--error-color: #f28578;
--error-extra-color: #d56558;
--colorful-error-color: #f28578;
--colorful-error-extra-color: #d56558;
}
#menu .icon-button:nth-child(1) {
color: #ff7e73;
}
#menu .icon-button:nth-child(2) {
color: #f5c370;
}
#menu .icon-button:nth-child(3) {
color: #08d9a3;
}
#menu .icon-button:nth-child(4) {
color: #0ca5e2;
}
#menu .icon-button:nth-child(5),
#menu .icon-button:nth-child(6) {
color: #875ac6;
}
#menu .icon-button:nth-child(1){
color: #ff7e73;
}
#menu .icon-button:nth-child(2){
color: #f5c370;
}
#menu .icon-button:nth-child(3){
color: #08d9a3;
}
#menu .icon-button:nth-child(4){
color: #0ca5e2;
}
#menu .icon-button:nth-child(5), #menu .icon-button:nth-child(6){
color: #875ac6;
}

View file

@ -1,32 +1,33 @@
:root {
--bg-color: #2E1A47;
--main-color: #f7f2ea;
--caret-color: #f7f2ea;
--sub-color: #c18fff;
--text-color: #f7f2ea;
--error-color: #F8BED6;
--error-extra-color: #F04E98;
--colorful-error-color: #F8BED6;
--colorful-error-extra-color: #F04E98;
}
#menu .icon-button:nth-child(1){
color: #F04E98;
}
#menu .icon-button:nth-child(2){
color: #F8BED6;
}
#menu .icon-button:nth-child(3){
color: #F6EB61;
}
#menu .icon-button:nth-child(4){
color: #A4DBE8;
}
#menu .icon-button:nth-child(5), #menu .icon-button:nth-child(6){
color: #a266ed;
}
--bg-color: #2E1A47;
--main-color: #f7f2ea;
--caret-color: #f7f2ea;
--sub-color: #c18fff;
--text-color: #f7f2ea;
--error-color: #F8BED6;
--error-extra-color: #F04E98;
--colorful-error-color: #F8BED6;
--colorful-error-extra-color: #F04E98;
}
#menu .icon-button:nth-child(1) {
color: #F04E98;
}
#menu .icon-button:nth-child(2) {
color: #F8BED6;
}
#menu .icon-button:nth-child(3) {
color: #F6EB61;
}
#menu .icon-button:nth-child(4) {
color: #A4DBE8;
}
#menu .icon-button:nth-child(5),
#menu .icon-button:nth-child(6) {
color: #a266ed;
}

View file

@ -254,7 +254,7 @@
"textColor": "#4fcdb9"
},
{
"name": "future funk",
"name": "future_funk",
"bgColor": "#2E1A47",
"textColor": "f7f2ea"
},
@ -278,4 +278,4 @@
"bgColor": "#07737a",
"textColor": "#88dbdf"
}
]
]

View file

@ -1,37 +1,36 @@
:root {
--bg-color: #ffffff;
--main-color: #212b43;
--caret-color: #212b43;
--sub-color: #62cfe6;
--text-color: #212b43;
--error-color: #f19dac;
--error-extra-color: #e58c9d;
--colorful-error-color: #f19dac;
--colorful-error-extra-color: #e58c9d;
}
#menu .icon-button:nth-child(1){
color: #f19dac;
}
#menu .icon-button:nth-child(2){
color: #f6f4a0;
}
#menu .icon-button:nth-child(3){
color: #73e4d0;
}
#menu .icon-button:nth-child(4){
color: #61cfe6;
}
#menu .icon-button:nth-child(5){
color: #ba96db;
}
#menu .icon-button:nth-child(6){
color: #ba96db;
}
--bg-color: #ffffff;
--main-color: #212b43;
--caret-color: #212b43;
--sub-color: #62cfe6;
--text-color: #212b43;
--error-color: #f19dac;
--error-extra-color: #e58c9d;
--colorful-error-color: #f19dac;
--colorful-error-extra-color: #e58c9d;
}
#menu .icon-button:nth-child(1) {
color: #f19dac;
}
#menu .icon-button:nth-child(2) {
color: #f6f4a0;
}
#menu .icon-button:nth-child(3) {
color: #73e4d0;
}
#menu .icon-button:nth-child(4) {
color: #61cfe6;
}
#menu .icon-button:nth-child(5) {
color: #ba96db;
}
#menu .icon-button:nth-child(6) {
color: #ba96db;
}

View file

@ -9,22 +9,24 @@
--colorful-error-color: #ff585d;
--colorful-error-extra-color: #c04455;
}
#menu .icon-button:nth-child(1){
color: #88dbdf;
}
#menu .icon-button:nth-child(2){
#menu .icon-button:nth-child(1) {
color: #88dbdf;
}
}
#menu .icon-button:nth-child(3){
#menu .icon-button:nth-child(2) {
color: #88dbdf;
}
}
#menu .icon-button:nth-child(4){
#menu .icon-button:nth-child(3) {
color: #88dbdf;
}
#menu .icon-button:nth-child(4) {
color: #ff585d;
}
}
#menu .icon-button:nth-child(5), #menu .icon-button:nth-child(6){
#menu .icon-button:nth-child(5),
#menu .icon-button:nth-child(6) {
color: #f3e03b;
}
}