diff --git a/layouts/default.vue b/layouts/default.vue index f0f9b6d0b..9cbb179fa 100644 --- a/layouts/default.vue +++ b/layouts/default.vue @@ -157,7 +157,6 @@ --> - diff --git a/pages/mods.vue b/pages/mods.vue index 607e1383d..e4282d5fd 100644 --- a/pages/mods.vue +++ b/pages/mods.vue @@ -117,7 +117,10 @@

Categories

-

+

Technology

-

+

Adventure

-

+

Magic

-

+

Utility

-

+

Decoration

-

+

Library

-

+

Cursed

-

+

Worldgen

-

+

Storage

-

+

Food

-

+

Equipment

-

+

Loaders

-

Forge

-

Fabric

+

+ Forge +

+

+ Fabric +

+

Platforms

+

+ Modrinth +

+

+ Curseforge +

Versions

WIP

@@ -343,7 +369,7 @@ export default { data() { return { query: '', - filters: [], + facets: [], results: [], pages: [], currentPage: 1, @@ -373,16 +399,16 @@ export default { await this.onSearchChange(this.currentPage) } }, - async toggleFilter(elementName) { + async toggleFacet(elementName) { const element = document.getElementById(elementName) - const index = this.filters.indexOf(element.id) + const index = this.facets.indexOf(element.id) if (index !== -1) { element.classList.remove('filter-active') - this.filters.splice(index, 1) + this.facets.splice(index, 1) } else { element.classList.add('filter-active') - this.filters.push(element.id) + this.facets.push(element.id) } await this.onSearchChange(1) @@ -407,14 +433,8 @@ export default { params.push(`query=${this.query.replace(/ /g, '+')}`) } - if (this.filters.length > 0) { - const facets = [] - - for (const facet of this.filters) { - facets.push(['categories:' + facet]) - } - - params.push(`facets=${JSON.stringify(facets)}`) + if (this.facets.length > 0) { + params.push(`facets=${JSON.stringify([this.facets])}`) } if (newPageNumber !== 1) {