Shaderpack support (#798)

* Shader support PR

* Make search page work

* Fix env showing

* Make moderation look reasonable

* Fix search for shaders
This commit is contained in:
Geometrically 2022-12-20 13:47:41 -07:00 committed by GitHub
parent 6f58e9e7bb
commit 97ecb0a5d6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
14 changed files with 73 additions and 10 deletions

View File

@ -249,7 +249,7 @@ body {
--size-mobile-navbar-height-expanded: 9.25rem;
}
@media screen and (min-width: 517px) {
@media screen and (min-width: 625px) {
--size-mobile-navbar-height-expanded: 7rem;
}
}

View File

@ -121,6 +121,8 @@ export default {
return 'unsupported'
case 'resourcepack':
return 'required'
case 'shader':
return 'required'
default:
return 'unknown'
}
@ -131,6 +133,8 @@ export default {
return 'required'
case 'resourcepack':
return 'unsupported'
case 'shader':
return 'unsupported'
default:
return 'unknown'
}

View File

@ -57,7 +57,7 @@
</span>
<span
v-else-if="
type !== 'resourcepack' &&
!['resourcepack', 'shader'].includes(type) &&
!(projectTypeDisplay === 'plugin' && search)
"
class="environment"

View File

@ -33,7 +33,11 @@
href: '/plugins',
},
{
label: 'Resource Packs',
label: 'Shaders',
href: '/shaders',
},
{
label: 'Resourcepacks',
href: '/resourcepacks',
},
{
@ -197,14 +201,21 @@
>
<span>Plugins</span>
</NuxtLink>
<NuxtLink
:tabindex="isBrowseMenuOpen ? 0 : -1"
to="/shaders"
class="tab iconified-button"
@click.native="isBrowseMenuOpen = false"
>
<span>Shaders</span>
</NuxtLink>
<NuxtLink
:tabindex="isBrowseMenuOpen ? 0 : -1"
to="/resourcepacks"
class="tab iconified-button"
@click.native="isBrowseMenuOpen = false"
>
<span>Resource Packs</span>
<span>Resourcepacks</span>
</NuxtLink>
<NuxtLink
:tabindex="isBrowseMenuOpen ? 0 : -1"

View File

@ -165,6 +165,11 @@ export default {
component: resolve(__dirname, 'pages/search/resourcepacks.vue'),
name: 'resourcepacks',
},
{
path: '/shaders',
component: resolve(__dirname, 'pages/search/shaders.vue'),
name: 'shaders',
},
],
})

View File

@ -501,7 +501,8 @@
<div
v-if="
project.project_type !== 'resourcepack' &&
project.project_type !== 'plugin'
project.project_type !== 'plugin' &&
project.project_type !== 'shader'
"
class="info"
>
@ -513,7 +514,8 @@
<div
v-if="
project.project_type !== 'resourcepack' &&
project.project_type !== 'plugin'
project.project_type !== 'plugin' &&
project.project_type !== 'shader'
"
class="info"
>

View File

@ -224,7 +224,10 @@
</button>
</section>
<section
v-if="project.project_type !== 'resourcepack'"
v-if="
project.project_type !== 'resourcepack' &&
project.project_type !== 'shader'
"
class="card game-sides"
>
<div class="columns">
@ -864,6 +867,9 @@ export default {
this.newProject.client_side = this.clientSideType.toLowerCase()
this.newProject.server_side = this.serverSideType.toLowerCase()
this.newProject.client_side = this.clientSideType.toLowerCase()
this.newProject.server_side = this.serverSideType.toLowerCase()
this.$emit('update:project', this.newProject)
this.isEditing = false

View File

@ -70,7 +70,7 @@
</aside>
</div>
<div class="normal-page__content">
<div class="project-list display-mode--gallery">
<div class="project-list display-mode--list">
<ProjectCard
v-for="project in $route.query.type !== undefined
? projects.filter((x) => x.project_type === $route.query.type)

View File

@ -53,6 +53,16 @@
return (
a.name.replace(/\D/g, '') - b.name.replace(/\D/g, '')
)
} else if (header === 'performance impact') {
const x = [
'potato',
'low',
'medium',
'high',
'screenshot',
]
return x.indexOf(a.name) - x.indexOf(b.name)
}
return 0
})"
@ -147,7 +157,9 @@
/>
</section>
<section
v-if="!['resourcepack', 'plugin'].includes(projectType.id)"
v-if="
!['resourcepack', 'plugin', 'shader'].includes(projectType.id)
"
aria-label="Environment filters"
>
<h3 class="sidebar-menu-heading">Environments</h3>

11
pages/search/shaders.vue Normal file
View File

@ -0,0 +1,11 @@
<template>
<div></div>
</template>
<script>
export default {
name: 'Shaders',
}
</script>
<style lang="scss" scoped></style>

View File

@ -160,6 +160,7 @@ export default {
plugin: 'list',
resourcepack: 'gallery',
modpack: 'list',
shader: 'gallery',
user: 'list',
},
}

View File

@ -240,7 +240,12 @@ export const formatCategory = (name) => {
return '512x or higher'
} else if (name === 'kitchen-sink') {
return 'Kitchen Sink'
} else if (name === 'path-tracing') {
return 'Path Tracing'
} else if (name === 'pbr') {
return 'PBR'
}
return capitalizeString(name)
}

View File

@ -18,6 +18,7 @@ export const defaults = {
plugin: 'list',
resourcepack: 'gallery',
modpack: 'list',
shader: 'gallery',
user: 'list',
},
}

View File

@ -27,6 +27,11 @@ export const state = () => ({
id: 'modpack',
display: 'modpack',
},
{
actual: 'shader',
id: 'shader',
display: 'shader',
},
],
loaderData: {
pluginLoaders: ['bukkit', 'spigot', 'paper', 'purpur', 'sponge'],