You've already forked AstralRinth
forked from didirus/AstralRinth
Workaround ModLoader capitalization issue and make loaders list collapsible (#490)
This commit is contained in:
@@ -9,11 +9,12 @@
|
|||||||
class="checkbox"
|
class="checkbox"
|
||||||
role="checkbox"
|
role="checkbox"
|
||||||
:disabled="disabled"
|
:disabled="disabled"
|
||||||
:class="{ checked: value }"
|
:class="{ checked: value, collapsing: collapsingToggleStyle }"
|
||||||
:aria-label="description"
|
:aria-label="description"
|
||||||
:aria-checked="value"
|
:aria-checked="value"
|
||||||
>
|
>
|
||||||
<CheckIcon v-if="value" aria-hidden="true" />
|
<CheckIcon v-if="value && !collapsingToggleStyle" aria-hidden="true" />
|
||||||
|
<DropdownIcon v-else-if="collapsingToggleStyle" aria-hidden="true" />
|
||||||
</button>
|
</button>
|
||||||
<!-- aria-hidden is set so screenreaders only use the <button>'s aria-label -->
|
<!-- aria-hidden is set so screenreaders only use the <button>'s aria-label -->
|
||||||
<p v-if="label" aria-hidden="true">{{ label }}</p>
|
<p v-if="label" aria-hidden="true">{{ label }}</p>
|
||||||
@@ -23,11 +24,13 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import CheckIcon from '~/assets/images/utils/check.svg?inline'
|
import CheckIcon from '~/assets/images/utils/check.svg?inline'
|
||||||
|
import DropdownIcon from '~/assets/images/utils/dropdown.svg?inline'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'Checkbox',
|
name: 'Checkbox',
|
||||||
components: {
|
components: {
|
||||||
CheckIcon,
|
CheckIcon,
|
||||||
|
DropdownIcon,
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
label: {
|
label: {
|
||||||
@@ -47,6 +50,10 @@ export default {
|
|||||||
type: Function,
|
type: Function,
|
||||||
default: () => {},
|
default: () => {},
|
||||||
},
|
},
|
||||||
|
collapsingToggleStyle: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
toggle() {
|
toggle() {
|
||||||
@@ -89,6 +96,10 @@ export default {
|
|||||||
&:hover {
|
&:hover {
|
||||||
color: var(--color-heading);
|
color: var(--color-heading);
|
||||||
|
|
||||||
|
.checkbox.collapsing svg {
|
||||||
|
color: var(--color-heading);
|
||||||
|
}
|
||||||
|
|
||||||
button {
|
button {
|
||||||
background-color: var(--color-button-bg-hover);
|
background-color: var(--color-button-bg-hover);
|
||||||
|
|
||||||
@@ -97,9 +108,14 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&:active {
|
&:active {
|
||||||
color: var(--color-text-dark);
|
color: var(--color-text-dark);
|
||||||
|
|
||||||
|
.checkbox.collapsing svg {
|
||||||
|
color: var(--color-text-dark);
|
||||||
|
}
|
||||||
|
|
||||||
button {
|
button {
|
||||||
background-color: var(--color-button-bg-active);
|
background-color: var(--color-button-bg-active);
|
||||||
|
|
||||||
@@ -133,5 +149,22 @@ export default {
|
|||||||
width: 0.8rem;
|
width: 0.8rem;
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&.collapsing {
|
||||||
|
background-color: transparent !important;
|
||||||
|
|
||||||
|
svg {
|
||||||
|
color: inherit;
|
||||||
|
height: 1rem;
|
||||||
|
width: 1rem;
|
||||||
|
transition: transform 0.25s ease-in-out;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.checked {
|
||||||
|
svg {
|
||||||
|
transform: rotate(180deg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -3,7 +3,10 @@
|
|||||||
<span
|
<span
|
||||||
v-for="category in categoriesFiltered"
|
v-for="category in categoriesFiltered"
|
||||||
:key="category.name"
|
:key="category.name"
|
||||||
v-html="category.icon + category.name"
|
v-html="
|
||||||
|
category.icon +
|
||||||
|
(category.name === 'modloader' ? 'ModLoader' : category.name)
|
||||||
|
"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -67,16 +67,34 @@
|
|||||||
Loaders
|
Loaders
|
||||||
</h3>
|
</h3>
|
||||||
<SearchFilter
|
<SearchFilter
|
||||||
v-for="loader in $tag.loaders.filter((x) =>
|
v-for="loader in $tag.loaders.filter((x) => {
|
||||||
x.supported_project_types.includes(projectType)
|
if (
|
||||||
)"
|
!showAllLoaders &&
|
||||||
|
x.name !== 'forge' &&
|
||||||
|
x.name !== 'fabric' &&
|
||||||
|
x.name !== 'quilt'
|
||||||
|
) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
return x.supported_project_types.includes(projectType)
|
||||||
|
})"
|
||||||
:key="loader.name"
|
:key="loader.name"
|
||||||
:active-filters="orFacets"
|
:active-filters="orFacets"
|
||||||
:display-name="loader.name"
|
:display-name="
|
||||||
|
loader.name === 'modloader' ? 'ModLoader' : loader.name
|
||||||
|
"
|
||||||
:facet-name="`categories:${loader.name}`"
|
:facet-name="`categories:${loader.name}`"
|
||||||
:icon="loader.icon"
|
:icon="loader.icon"
|
||||||
@toggle="toggleOrFacet"
|
@toggle="toggleOrFacet"
|
||||||
/>
|
/>
|
||||||
|
<Checkbox
|
||||||
|
v-model="showAllLoaders"
|
||||||
|
:label="showAllLoaders ? 'Less' : 'More'"
|
||||||
|
description="Show all loaders"
|
||||||
|
style="margin-bottom: 0.5rem"
|
||||||
|
:border="false"
|
||||||
|
:collapsing-toggle-style="true"
|
||||||
|
/>
|
||||||
</section>
|
</section>
|
||||||
<section aria-label="Environment filters">
|
<section aria-label="Environment filters">
|
||||||
<h3 class="sidebar-menu-heading">Environments</h3>
|
<h3 class="sidebar-menu-heading">Environments</h3>
|
||||||
@@ -326,6 +344,7 @@ export default {
|
|||||||
maxResults: 20,
|
maxResults: 20,
|
||||||
|
|
||||||
sidebarMenuOpen: false,
|
sidebarMenuOpen: false,
|
||||||
|
showAllLoaders: false,
|
||||||
|
|
||||||
skipLink: '#search-results',
|
skipLink: '#search-results',
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user