mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2024-11-11 09:34:35 +08:00
Merge branch 'master' of https://github.com/Miodec/monkey-type
This commit is contained in:
commit
bd114c38da
2 changed files with 50 additions and 39 deletions
|
@ -562,6 +562,46 @@ export function update() {
|
|||
}
|
||||
}
|
||||
|
||||
function toggleSettingsGroup(groupName) {
|
||||
$(`.pageSettings .settingsGroup.${groupName}`)
|
||||
.stop(true, true)
|
||||
.slideToggle(250)
|
||||
.toggleClass("slideup");
|
||||
if ($(`.pageSettings .settingsGroup.${groupName}`).hasClass("slideup")) {
|
||||
$(`.pageSettings .sectionGroupTitle[group=${groupName}] .fas`)
|
||||
.stop(true, true)
|
||||
.animate(
|
||||
{
|
||||
deg: -90,
|
||||
},
|
||||
{
|
||||
duration: 250,
|
||||
step: function (now) {
|
||||
$(this).css({
|
||||
transform: "rotate(" + now + "deg)",
|
||||
});
|
||||
},
|
||||
}
|
||||
);
|
||||
} else {
|
||||
$(`.pageSettings .sectionGroupTitle[group=${groupName}] .fas`)
|
||||
.stop(true, true)
|
||||
.animate(
|
||||
{
|
||||
deg: 0,
|
||||
},
|
||||
{
|
||||
duration: 250,
|
||||
step: function (now) {
|
||||
$(this).css({
|
||||
transform: "rotate(" + now + "deg)",
|
||||
});
|
||||
},
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
$(document).on(
|
||||
"focusout",
|
||||
".pageSettings .section.paceCaret input.customPaceCaretSpeed",
|
||||
|
@ -763,44 +803,7 @@ $("#exportSettingsButton").click((e) => {
|
|||
});
|
||||
|
||||
$(".pageSettings .sectionGroupTitle").click((e) => {
|
||||
let group = $(e.currentTarget).attr("group");
|
||||
$(`.pageSettings .settingsGroup.${group}`)
|
||||
.stop(true, true)
|
||||
.slideToggle(250)
|
||||
.toggleClass("slideup");
|
||||
if ($(`.pageSettings .settingsGroup.${group}`).hasClass("slideup")) {
|
||||
$(`.pageSettings .sectionGroupTitle[group=${group}] .fas`)
|
||||
.stop(true, true)
|
||||
.animate(
|
||||
{
|
||||
deg: -90,
|
||||
},
|
||||
{
|
||||
duration: 250,
|
||||
step: function (now) {
|
||||
$(this).css({
|
||||
transform: "rotate(" + now + "deg)",
|
||||
});
|
||||
},
|
||||
}
|
||||
);
|
||||
} else {
|
||||
$(`.pageSettings .sectionGroupTitle[group=${group}] .fas`)
|
||||
.stop(true, true)
|
||||
.animate(
|
||||
{
|
||||
deg: 0,
|
||||
},
|
||||
{
|
||||
duration: 250,
|
||||
step: function (now) {
|
||||
$(this).css({
|
||||
transform: "rotate(" + now + "deg)",
|
||||
});
|
||||
},
|
||||
}
|
||||
);
|
||||
}
|
||||
toggleSettingsGroup($(e.currentTarget).attr("group"));
|
||||
});
|
||||
|
||||
$(".pageSettings #resetPersonalBestsButton").on("click", (e) => {
|
||||
|
@ -854,3 +857,11 @@ $(".pageSettings .section.customLayoutfluid .inputAndSave .input").keypress(
|
|||
}
|
||||
}
|
||||
);
|
||||
|
||||
$(".quickNav .links a").on("click", (e) => {
|
||||
const settingsGroup = e.target.innerText;
|
||||
const isOpen = $(`.pageSettings .settingsGroup.${settingsGroup}`).hasClass(
|
||||
"slideup"
|
||||
);
|
||||
isOpen && toggleSettingsGroup(settingsGroup);
|
||||
});
|
||||
|
|
|
@ -233,7 +233,7 @@ export async function activate(funbox, mode) {
|
|||
return true;
|
||||
}
|
||||
export function setFunbox(funbox, mode) {
|
||||
if (TestLogic.active || TestUI.resultVisible) {
|
||||
if (TestLogic.active) {
|
||||
Notifications.add(
|
||||
"You can only change the funbox before starting a test.",
|
||||
0
|
||||
|
|
Loading…
Reference in a new issue