Skip to content

Commit 1bf7f0b

Browse files
committed
Redo 404 page
1 parent 578a377 commit 1bf7f0b

File tree

2 files changed

+27
-29
lines changed

2 files changed

+27
-29
lines changed

src/_lib/components/LgvLink.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
import { ref, type Ref } from 'vue';
2222
2323
type LinkType = 'internal' | 'external';
24-
withDefaults(defineProps<{ linkType: LinkType; href?: string; icon?: string; iconWidth?: string }>(), {
24+
withDefaults(defineProps<{ linkType?: LinkType; href?: string; icon?: string; iconWidth?: string }>(), {
2525
icon: 'mingcute:question-line',
2626
iconWidth: '1.5rem',
2727
linkType: 'internal',

src/views/PageNotFoundView.vue

Lines changed: 26 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,46 @@
11
<template>
2-
<div id="container">
2+
<div id="pagenotfound-container">
33
<AppLogo />
44
<div class="text">
5-
<h1 v-if="msgVariant === 1" class="title">{{ $t('404.text_01') }}</h1>
6-
<h1 v-if="msgVariant === 2" class="title">
7-
<i>{{ $t('404.text_02') }}</i>
8-
</h1>
9-
<h1 v-if="msgVariant === 3" class="title">{{ $t('404.text_03') }}</h1>
10-
<h1 v-if="msgVariant === 4" class="title ultra">{{ $t('404.text_04') }}</h1>
11-
<p class="subtitle">{{ $t('404.subtext') }}</p>
12-
<a class="home-link" href="/">
13-
<iconify-icon icon="mingcute:book-2-line" height="1.5rem" />
5+
<h1 class="title" :class="{ ultra: msgVariant === 4 }">{{ loadMessage() }}</h1>
6+
<h2 class="subtitle">{{ $t('404.subtext') }}</h2>
7+
<LgvLink
8+
variant="button"
9+
icon="mingcute:book-2-line"
10+
href="/"
11+
>
1412
{{ $t('404.link') }}
15-
</a>
13+
</LgvLink>
1614
</div>
1715
</div>
1816
</template>
1917

2018
<script setup lang="ts">
21-
import AppLogo from '@components/global/elements/AppLogo.vue';
22-
import { useHead } from '@unhead/vue';
23-
import { onMounted, ref } from 'vue';
24-
import { useI18n } from 'vue-i18n';
19+
import LgvLink from '@/_lib/components/LgvLink.vue'
20+
import AppLogo from '@components/global/elements/AppLogo.vue'
21+
import { useHead } from '@unhead/vue'
22+
import { ref } from 'vue'
23+
import { useI18n } from 'vue-i18n'
2524
26-
const i18n = useI18n();
25+
const i18n = useI18n()
2726
useHead({
2827
title: i18n.t('404.$title') + ' · ' + i18n.t('main.$title'),
2928
meta: [
3029
{ name: 'robots', content: 'noindex' },
3130
{ name: 'description', content: 'Page not found' },
3231
],
33-
});
32+
})
3433
35-
const msgVariant = ref(0);
34+
const msgVariant = ref(0)
35+
function loadMessage(): string {
36+
msgVariant.value = Math.floor(Math.random() * 4) + 1
37+
return i18n.t(`404.text_${msgVariant.value.toString().padStart(2, '0')}`)
38+
}
3639
37-
onMounted(() => {
38-
msgVariant.value = Math.floor(Math.random() * 4) + 1;
39-
});
4040
</script>
4141

42-
<style scoped lang="scss">
43-
#container {
42+
<style lang="scss">
43+
#pagenotfound-container {
4444
flex: 1;
4545
background: var(--lg-panel);
4646
background-size: cover;
@@ -54,6 +54,7 @@ onMounted(() => {
5454
5555
#app-logo,
5656
#app-logo-uwu {
57+
max-width: unset;
5758
width: clamp(200px, 37.5vw, 300px);
5859
align-self: center;
5960
justify-self: center;
@@ -74,14 +75,11 @@ onMounted(() => {
7475
font-size: clamp(2rem, 5vw, 2.5rem);
7576
}
7677
.subtitle {
77-
text-align: center;
78-
font-size: 1rem;
78+
font-size: clamp(1rem, 2.5vw, 1.5rem);
79+
font-weight: 400;
7980
}
8081
.ultra {
8182
font-family: VCR OSD Mono;
8283
}
83-
.home-link {
84-
padding: 0.5rem;
85-
}
8684
}
8785
</style>

0 commit comments

Comments
 (0)