Bump Nuxt + Minor Fixes (#1065)

* Bump Nuxt + Minor Fixes

* Run lint
This commit is contained in:
Geometrically
2023-03-27 09:20:25 -07:00
committed by GitHub
parent 25bd61558b
commit 7214b71c29
13 changed files with 1395 additions and 1582 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.8 KiB

BIN
assets/images/external/multimc.webp vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@@ -95,8 +95,8 @@ html {
--shadow-card: rgba(50, 50, 100, 0.1) 0px 2px 4px 0px; --shadow-card: rgba(50, 50, 100, 0.1) 0px 2px 4px 0px;
--landing-maze-bg: url('https://cdn.modrinth.com/landing/landing-light.png'); --landing-maze-bg: url('https://cdn.modrinth.com/landing-new/landing-light.webp');
--landing-maze-gradient-bg: url('https://cdn.modrinth.com/landing/landing-lower-light.png'); --landing-maze-gradient-bg: url('https://cdn.modrinth.com/landing-new/landing-lower-light.webp');
--landing-maze-outer-bg: linear-gradient(180deg, #f0f0f0 0%, #ffffff 100%); --landing-maze-outer-bg: linear-gradient(180deg, #f0f0f0 0%, #ffffff 100%);
--landing-color-heading: #000; --landing-color-heading: #000;
@@ -221,9 +221,9 @@ html {
--shadow-card: rgba(0, 0, 0, 0.25) 0px 2px 4px 0px; --shadow-card: rgba(0, 0, 0, 0.25) 0px 2px 4px 0px;
--landing-maze-bg: url('https://cdn.modrinth.com/landing/landing.png'); --landing-maze-bg: url('https://cdn.modrinth.com/landing-new/landing.webp');
--landing-maze-gradient-bg: linear-gradient(0deg, #31375f 0%, rgba(8, 14, 55, 0) 100%), --landing-maze-gradient-bg: linear-gradient(0deg, #31375f 0%, rgba(8, 14, 55, 0) 100%),
url('https://cdn.modrinth.com/landing/landing-lower.png'); url('https://cdn.modrinth.com/landing-new/landing-lower.webp');
--landing-maze-outer-bg: linear-gradient(180deg, #06060d 0%, #000000 100%); --landing-maze-outer-bg: linear-gradient(180deg, #06060d 0%, #000000 100%);
--landing-color-heading: #fff; --landing-color-heading: #fff;

View File

@@ -58,9 +58,9 @@ export const inferVersionInfo = async function (rawFile, project, gameVersions)
const inferFunctions = { const inferFunctions = {
// Forge 1.13+ // Forge 1.13+
'META-INF/mods.toml': async (file, zip) => { 'META-INF/mods.toml': async (file, zip) => {
const metadata = TOML.parse(file) const metadata = TOML.parse(file, { joiner: '\n' })
// TODO: Parse minecraft version ranges, handle if version is set to value from manifest // TODO: Parse minecraft version ranges
if (metadata.mods && metadata.mods.length > 0) { if (metadata.mods && metadata.mods.length > 0) {
let versionNum = metadata.mods[0].version let versionNum = metadata.mods[0].version

View File

@@ -431,9 +431,7 @@ export default defineNuxtComponent({
}, },
}) })
.then(() => {}) .then(() => {})
.catch((e) => { .catch(() => {})
console.error('An error occurred while registering the visit: ', e)
})
}) })
}, },
toggleMobileMenu() { toggleMobileMenu() {

View File

@@ -17,7 +17,7 @@
"eslint": "^8.33.0", "eslint": "^8.33.0",
"eslint-config-prettier": "^8.6.0", "eslint-config-prettier": "^8.6.0",
"eslint-plugin-vue": "^9.9.0", "eslint-plugin-vue": "^9.9.0",
"nuxt": "^3.2.3", "nuxt": "^3.3.2",
"prettier": "^2.8.3", "prettier": "^2.8.3",
"sass": "^1.58.0", "sass": "^1.58.0",
"typescript": "^4.9.5", "typescript": "^4.9.5",

View File

@@ -196,7 +196,7 @@
{{ project.description }} {{ project.description }}
</p> </p>
<Categories <Categories
:categories="project.categories" :categories="project.categories.concat(project.additional_categories)"
:type="project.actualProjectType" :type="project.actualProjectType"
class="categories" class="categories"
> >

View File

@@ -199,13 +199,13 @@
<div class="launcher-view"> <div class="launcher-view">
<img <img
v-if="$colorMode.value === 'light'" v-if="$colorMode.value === 'light'"
src="https://cdn.modrinth.com/landing/launcher-light.png" src="https://cdn.modrinth.com/landing-new/launcher-light.webp"
alt="launcher graphic" alt="launcher graphic"
class="minecraft-screen" class="minecraft-screen"
/> />
<img <img
v-else v-else
src="https://cdn.modrinth.com/landing/launcher.png" src="https://cdn.modrinth.com/landing-new/launcher.webp"
alt="launcher graphic" alt="launcher graphic"
class="minecraft-screen" class="minecraft-screen"
/> />
@@ -224,7 +224,12 @@
class="graphic gradient-border" class="graphic gradient-border"
title="MultiMC" title="MultiMC"
> >
<img src="~/assets/images/external/multimc.png" alt="multimc launcher logo" /> <img
src="~/assets/images/external/multimc.webp"
alt="multimc launcher logo"
width="68"
height="68"
/>
</a> </a>
<a <a
rel="noopener" rel="noopener"
@@ -530,7 +535,7 @@ const [
{ data: searchProjects, refresh: updateSearchProjects }, { data: searchProjects, refresh: updateSearchProjects },
{ data: notifications }, { data: notifications },
] = await Promise.all([ ] = await Promise.all([
useAsyncData('projects', () => useBaseFetch('projects_random?count=70'), { useAsyncData('projects', () => useBaseFetch('projects_random?count=40'), {
transform: (result) => { transform: (result) => {
const val = Math.ceil(result.length / 3) const val = Math.ceil(result.length / 3)
@@ -651,7 +656,7 @@ const [
display: flex; display: flex;
min-width: 100%; min-width: 100%;
gap: var(--gap); gap: var(--gap);
animation: scroll 100s linear infinite; animation: scroll 40s linear infinite;
@media (prefers-reduced-motion) { @media (prefers-reduced-motion) {
animation-play-state: paused !important; animation-play-state: paused !important;
@@ -667,7 +672,7 @@ const [
} }
&.offset { &.offset {
animation: scroll-inverse 100s linear infinite; animation: scroll-inverse 40s linear infinite;
transform: translateX(-100%); transform: translateX(-100%);
@keyframes scroll-inverse { @keyframes scroll-inverse {
@@ -932,6 +937,7 @@ const [
.minecraft-screen { .minecraft-screen {
width: 100%; width: 100%;
border-radius: 0.5rem; border-radius: 0.5rem;
aspect-ratio: 530 / 303;
} }
.launcher-graphics { .launcher-graphics {

View File

@@ -193,7 +193,7 @@ export default defineNuxtComponent({
) )
return { return {
projects: shallowRef(projects), projects: shallowRef(projects.sort((a, b) => data.$dayjs(a.queued) - data.$dayjs(b.queued))),
reports: ref(newReports), reports: ref(newReports),
} }
}, },

View File

@@ -1,24 +1,23 @@
export default defineNuxtPlugin((nuxtApp) => { export default defineNuxtPlugin((nuxtApp) => {
const themeStore = useTheme() const themeStore = useTheme()
// TODO: Temporarily removed as it was causing hydration issues nuxtApp.hook('app:mounted', () => {
// nuxtApp.hook('app:mounted', () => { if (process.client && themeStore.value.preference === 'system') {
// if (process.client && themeStore.value.preference === 'system') { const colorSchemeQueryList = window.matchMedia('(prefers-color-scheme: light)')
// const colorSchemeQueryList = window.matchMedia('(prefers-color-scheme: light)')
// const setColorScheme = (e) => {
// const setColorScheme = (e) => { if (themeStore.value.preference === 'system') {
// if (themeStore.value.preference === 'system') { if (e.matches) {
// if (e.matches) { updateTheme('light')
// updateTheme('light') } else {
// } else { updateTheme('dark')
// updateTheme('dark') }
// } }
// } }
// }
// setColorScheme(colorSchemeQueryList)
// setColorScheme(colorSchemeQueryList) colorSchemeQueryList.addEventListener('change', setColorScheme)
// colorSchemeQueryList.addEventListener('change', setColorScheme) }
// } })
// })
nuxtApp.provide('colorMode', themeStore.value) nuxtApp.provide('colorMode', themeStore.value)
}) })

View File

@@ -1,8 +1,4 @@
import dayjs from 'dayjs' import dayjs from 'dayjs'
import relativeTime from 'dayjs/plugin/relativeTime'
// eslint-disable-next-line import/no-named-as-default-member
dayjs.extend(relativeTime)
export default defineNuxtPlugin(() => { export default defineNuxtPlugin(() => {
return { return {

View File

@@ -52,6 +52,20 @@ export default defineNuxtPlugin((nuxtApp) => {
} }
version.primaryFile = version.files.find((file) => file.primary) ?? version.files[0] version.primaryFile = version.files.find((file) => file.primary) ?? version.files[0]
if (!version.primaryFile) {
version.primaryFile = {
hashes: {
sha1: '',
sha512: '',
},
url: '#',
filename: 'unknown',
primary: false,
size: 0,
file_type: null,
}
}
version.author = authorMembers[version.author_id] version.author = authorMembers[version.author_id]
if (!version.author) { if (!version.author) {
version.author = members.find((x) => x.user.id === version.author_id) version.author = members.find((x) => x.user.id === version.author_id)

2882
yarn.lock

File diff suppressed because it is too large Load Diff