Skip to content

Commit c3c5710

Browse files
committed
feat: Implement error page with responsive design and styling adjustments
1 parent e42ae8f commit c3c5710

File tree

6 files changed

+125
-15
lines changed

6 files changed

+125
-15
lines changed

apps/client/assets/scss/app.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
.light-mode {
2020
.app-main {
21-
color: colors.$black_950;
21+
color: colors.$black_900;
2222
background-color: colors.$white_50;
2323
}
2424
}

apps/client/assets/scss/components/contributors.scss

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,11 @@
4747

4848
.light-mode {
4949
.contributors-item-more {
50-
color: colors.$black_50;
51-
background-color: colors.$black_600;
50+
color: colors.$white_50;
51+
background-color: colors.$black_500;
5252

5353
&:hover {
54-
background-color: colors.$black_900;
54+
background-color: colors.$black_700;
5555
}
5656
}
5757
}

apps/client/assets/scss/error.scss

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
@use '~/assets/scss/utils/_colors.scss';
2+
3+
.error-main {
4+
display: flex;
5+
flex-direction: column;
6+
align-items: center;
7+
justify-content: center;
8+
min-width: 100%;
9+
min-height: 100vh;
10+
}
11+
12+
.error-main-image {
13+
position: fixed;
14+
right: 0;
15+
bottom: 0;
16+
height: 100vh;
17+
min-height: 25rem;
18+
opacity: 0.5;
19+
transform: translate(5%, 35%);
20+
z-index: 1;
21+
}
22+
23+
.error-main-content {
24+
display: flex;
25+
flex-direction: column;
26+
align-items: center;
27+
justify-content: center;
28+
z-index: 2;
29+
padding: 0 1rem;
30+
31+
& > h1 {
32+
font-size: 8rem;
33+
font-weight: 700;
34+
line-height: 7rem;
35+
}
36+
37+
& > h2 {
38+
font-size: 2rem;
39+
font-weight: 400;
40+
}
41+
42+
& > p {
43+
font-size: 1rem;
44+
font-weight: 400;
45+
max-width: 25rem;
46+
margin-top: 1rem;
47+
text-align: center;
48+
}
49+
}
50+
51+
.light-mode {
52+
.error-main-content {
53+
& > h1 {
54+
color: colors.$primary_400;
55+
}
56+
}
57+
58+
.error-main {
59+
color: colors.$black_700;
60+
background-color: colors.$white_50;
61+
}
62+
}
63+
64+
.dark-mode {
65+
.error-main-content {
66+
& > h1 {
67+
color: colors.$primary_300;
68+
}
69+
}
70+
71+
.error-main {
72+
color: colors.$white_100;
73+
background-color: colors.$black_900;
74+
}
75+
}

apps/client/assets/scss/pages/about.scss

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,3 @@
4040
font-weight: 400;
4141
white-space: pre-wrap;
4242
}
43-
44-
.light-mode {
45-
.about-logo {
46-
filter: drop-shadow(1px 2px 0px #00000048);
47-
}
48-
}

apps/client/assets/scss/pages/index.scss

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,10 @@
4949
font-weight: 500;
5050
border: none;
5151
border-radius: 0.5rem;
52-
transition: background-color 0.3s, transform 0.3s, color 0.3s;
52+
transition:
53+
background-color 0.3s,
54+
transform 0.3s,
55+
color 0.3s;
5356
transform: translateY(0);
5457

5558
&:hover {
@@ -67,10 +70,6 @@
6770
}
6871

6972
.light-mode {
70-
.home-logo {
71-
filter: drop-shadow(1px 2px 0px #00000048);
72-
}
73-
7473
.home-title {
7574
& > span {
7675
background: linear-gradient(to right, colors.$primary_300, colors.$primary_400);

apps/client/error.vue

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<script lang="ts" setup>
2+
import type { NuxtError } from '#app';
3+
4+
const props = defineProps({
5+
error: Object as () => NuxtError
6+
});
7+
8+
const handleClear = () => clearError({ redirect: '/' });
9+
</script>
10+
11+
<style lang="scss">
12+
@use '~/assets/scss/global.scss';
13+
</style>
14+
15+
<style lang="scss" scoped>
16+
@use '~/assets/scss/error.scss';
17+
</style>
18+
19+
<template>
20+
<div class="error-main" role="main">
21+
<div class="error-main-content">
22+
<h1>{{ props.error?.statusCode }}</h1>
23+
24+
<template v-if="props.error?.statusCode === 404">
25+
<h2>Page not found</h2>
26+
27+
<p>Sorry, the page you are looking for does not exist or has been moved.</p>
28+
</template>
29+
<template v-else>
30+
<h2>Oops! An error occurred.</h2>
31+
32+
<p>Sorry, an error has occurred on the server.</p>
33+
</template>
34+
35+
<Button @click="handleClear" theme="primary" class="mt-8">
36+
<Icon name="material-symbols:arrow-back-rounded" /> Go back
37+
</Button>
38+
</div>
39+
40+
<NuxtImg src="images/zyro-color.webp" class="error-main-image" :draggable="false" />
41+
</div>
42+
</template>

0 commit comments

Comments
 (0)