diff --git a/frontend/src/styles/account.scss b/frontend/src/styles/account.scss index 5b9da93e9..73d6ddfc0 100644 --- a/frontend/src/styles/account.scss +++ b/frontend/src/styles/account.scss @@ -63,7 +63,7 @@ display: flex; justify-content: space-evenly; gap: 1rem; - .button { + button { width: 100%; } } diff --git a/frontend/src/ts/account/result-filters.ts b/frontend/src/ts/account/result-filters.ts index 642f6c29c..9f59463b5 100644 --- a/frontend/src/ts/account/result-filters.ts +++ b/frontend/src/ts/account/result-filters.ts @@ -344,11 +344,11 @@ export function updateActive(): void { let buttonEl; if (group === "date") { buttonEl = $( - `.pageAccount .group.topFilters .filterGroup[group="${group}"] .button[filter="${filter}"]` + `.pageAccount .group.topFilters .filterGroup[group="${group}"] button[filter="${filter}"]` ); } else { buttonEl = $( - `.pageAccount .group.filterButtons .filterGroup[group="${group}"] .button[filter="${filter}"]` + `.pageAccount .group.filterButtons .filterGroup[group="${group}"] button[filter="${filter}"]` ); } if (getFilter(group, filter)) { @@ -487,7 +487,7 @@ function toggle( $( ".pageAccount .filterButtons .buttonsAndTitle .buttons, .pageAccount .group.topFilters .buttonsAndTitle.testDate .buttons" -).on("click", ".button", (e) => { +).on("click", "button", (e) => { const group = $(e.target) .parents(".buttons") .attr("group") as keyof MonkeyTypes.ResultFilters; @@ -514,7 +514,7 @@ $( setAllFilters(group, false); } }); - } else if ($(e.target).hasClass("button")) { + } else if ($(e.target).is("button")) { if (e.shiftKey) { setAllFilters(group, false); filters[group][filter as keyof typeof filters[typeof group]] = @@ -528,7 +528,7 @@ $( save(); }); -$(".pageAccount .topFilters .button.allFilters").on("click", () => { +$(".pageAccount .topFilters button.allFilters").on("click", () => { // user is changing the filters -> current filter is no longer a filter preset deSelectFilterPreset(); @@ -548,7 +548,7 @@ $(".pageAccount .topFilters .button.allFilters").on("click", () => { save(); }); -$(".pageAccount .topFilters .button.currentConfigFilter").on("click", () => { +$(".pageAccount .topFilters button.currentConfigFilter").on("click", () => { // user is changing the filters -> current filter is no longer a filter preset deSelectFilterPreset(); @@ -633,9 +633,9 @@ $(".pageAccount .topFilters .button.currentConfigFilter").on("click", () => { save(); }); -$(".pageAccount .topFilters .button.toggleAdvancedFilters").on("click", () => { +$(".pageAccount .topFilters button.toggleAdvancedFilters").on("click", () => { $(".pageAccount .filterButtons").slideToggle(250); - $(".pageAccount .topFilters .button.toggleAdvancedFilters").toggleClass( + $(".pageAccount .topFilters button.toggleAdvancedFilters").toggleClass( "active" ); }); @@ -652,10 +652,10 @@ export async function appendButtons(): Promise { if (languageList) { let html = ""; for (const language of languageList) { - html += `
${language.replace( + html += `
`; + )}`; } const el = document.querySelector( ".pageAccount .content .filterButtons .buttonsAndTitle.languages .buttons" @@ -674,15 +674,16 @@ export async function appendButtons(): Promise { if (funboxList) { let html = ""; for (const funbox of funboxList) { - html += `
${funbox.name.replace(/_/g, " ")}
`; + html += ``; } const el = document.querySelector( ".pageAccount .content .filterButtons .buttonsAndTitle.funbox .buttons" ); if (el) { - el.innerHTML = `
none
` + html; + el.innerHTML = `` + html; } } @@ -692,9 +693,9 @@ export async function appendButtons(): Promise { $(".pageAccount .content .filterButtons .buttonsAndTitle.tags").removeClass( "hidden" ); - let html = `
no tag
`; + let html = ``; for (const tag of snapshot?.tags ?? []) { - html += `
${tag.display}
`; + html += ``; } const el = document.querySelector( ".pageAccount .content .filterButtons .buttonsAndTitle.tags .buttons" @@ -723,7 +724,7 @@ export function removeButtons(): void { ).empty(); } -$(".pageAccount .topFilters .button.createFilterPresetBtn").on("click", () => { +$(".pageAccount .topFilters button.createFilterPresetBtn").on("click", () => { startCreateFilterPreset(); }); diff --git a/frontend/src/ts/pages/account.ts b/frontend/src/ts/pages/account.ts index bd775cd7c..fef5964fc 100644 --- a/frontend/src/ts/pages/account.ts +++ b/frontend/src/ts/pages/account.ts @@ -1257,7 +1257,7 @@ $(".pageAccount .group.history").on("click", ".history-date-header", () => { // Resets sorting to by date' when applying filers (normal or advanced) $(".pageAccount .group.history").on( "click", - ".buttonsAndTitle .buttons .button", + ".buttonsAndTitle .buttons button", () => { // We want to 'force' descending sort: sortAndRefreshHistory("timestamp", ".history-date-header", true); @@ -1266,7 +1266,7 @@ $(".pageAccount .group.history").on( $(".pageAccount .group.topFilters, .pageAccount .filterButtons").on( "click", - ".button", + "button", () => { setTimeout(() => { update(); diff --git a/frontend/static/html/pages/account.html b/frontend/static/html/pages/account.html index ef9289182..38d614f48 100644 --- a/frontend/static/html/pages/account.html +++ b/frontend/static/html/pages/account.html @@ -343,10 +343,10 @@
filters
-
all
-
current settings
-
advanced
-
save as preset
+ + + +
-
last day
-
last week
-
last month
-
last 3 months
-
all time
+ + + + +
@@ -367,75 +367,75 @@
advanced filters
-
clear filters
+
difficulty
-
normal
-
expert
-
master
+ + +
personal best
-
no
-
yes
+ +
mode
-
words
-
time
-
quote
-
zen
-
custom
+ + + + +
quote length
-
short
-
medium
-
long
-
thicc
+ + + +
words
-
10
-
25
-
50
-
100
-
custom
+ + + + +
time
-
15
-
30
-
60
-
120
-
custom
+ + + + +
punctuation
-
on
-
off
+ +
numbers
-
on
-
off
+ +