mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-11-17 22:29:52 +08:00
moved live wpm below keymap, catching any error while flashing keymap key
This commit is contained in:
parent
d9531181f7
commit
e3a529058f
3 changed files with 44 additions and 37 deletions
|
|
@ -739,6 +739,10 @@ a:hover {
|
|||
|
||||
#liveWpm {
|
||||
top: 6rem;
|
||||
|
||||
&.lower {
|
||||
top: 15rem;
|
||||
}
|
||||
}
|
||||
|
||||
#centerContent {
|
||||
|
|
|
|||
|
|
@ -1062,41 +1062,43 @@ function flashPressedKeymapKey(key, correct) {
|
|||
key = `#Key${key.toUpperCase()}`;
|
||||
}
|
||||
|
||||
if (correct) {
|
||||
$(key)
|
||||
.stop(true, true)
|
||||
.css({
|
||||
color: themeColors.bg,
|
||||
backgroundColor: themeColors.main,
|
||||
borderColor: themeColors.main,
|
||||
})
|
||||
.animate(
|
||||
{
|
||||
color: themeColors.sub,
|
||||
backgroundColor: themeColors.bg,
|
||||
borderColor: themeColors.sub,
|
||||
},
|
||||
500,
|
||||
"easeOutExpo"
|
||||
);
|
||||
} else {
|
||||
$(key)
|
||||
.stop(true, true)
|
||||
.css({
|
||||
color: themeColors.bg,
|
||||
backgroundColor: themeColors.error,
|
||||
borderColor: themeColors.error,
|
||||
})
|
||||
.animate(
|
||||
{
|
||||
color: themeColors.sub,
|
||||
backgroundColor: themeColors.bg,
|
||||
borderColor: themeColors.sub,
|
||||
},
|
||||
500,
|
||||
"easeOutExpo"
|
||||
);
|
||||
}
|
||||
try {
|
||||
if (correct) {
|
||||
$(key)
|
||||
.stop(true, true)
|
||||
.css({
|
||||
color: themeColors.bg,
|
||||
backgroundColor: themeColors.main,
|
||||
borderColor: themeColors.main,
|
||||
})
|
||||
.animate(
|
||||
{
|
||||
color: themeColors.sub,
|
||||
backgroundColor: themeColors.bg,
|
||||
borderColor: themeColors.sub,
|
||||
},
|
||||
500,
|
||||
"easeOutExpo"
|
||||
);
|
||||
} else {
|
||||
$(key)
|
||||
.stop(true, true)
|
||||
.css({
|
||||
color: themeColors.bg,
|
||||
backgroundColor: themeColors.error,
|
||||
borderColor: themeColors.error,
|
||||
})
|
||||
.animate(
|
||||
{
|
||||
color: themeColors.sub,
|
||||
backgroundColor: themeColors.bg,
|
||||
borderColor: themeColors.sub,
|
||||
},
|
||||
500,
|
||||
"easeOutExpo"
|
||||
);
|
||||
}
|
||||
} catch (e) {}
|
||||
}
|
||||
|
||||
function updateHighlightedKeymapKey() {
|
||||
|
|
|
|||
|
|
@ -740,9 +740,10 @@ function changeKeymapMode(mode, nosave) {
|
|||
mode = "off";
|
||||
}
|
||||
if (mode === "off") {
|
||||
hideKeymap();
|
||||
// hideKeymap();
|
||||
$("#liveWpm").removeClass("lower");
|
||||
} else {
|
||||
showKeymap();
|
||||
$("#liveWpm").addClass("lower");
|
||||
}
|
||||
if (mode === "react") {
|
||||
$(".active-key").removeClass("active-key");
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue