Skip to content

Commit d791d23

Browse files
committed
fix 404 error pages
1 parent 63334f7 commit d791d23

File tree

2 files changed

+14
-9
lines changed

2 files changed

+14
-9
lines changed

src/routes/+error.svelte

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<script>
22
import { page } from '$app/state';
3+
import { base } from '$app/paths';
34
import { emojis } from '$lib/components/emojis.js';
45
</script>
56

@@ -11,16 +12,15 @@
1112
<div id="notfound">
1213
<div class="notfound">
1314
<div class="notfound-404">
14-
<h1>Oops!</h1>
15-
{emojis[page.status] ?? emojis[500]}
16-
<h2>ERROR {page.status}: {page.error.message}</h2>
15+
<h1>Oops! <span>{emojis[page.status] ?? emojis[500]}</span></h1>
16+
<h2 class="my-4">ERROR {page.status}: {page.error.message}</h2>
1717
</div>
1818
<p>
1919
Uh-oh! It seems the page you're looking for has either been removed, relocated, or may not
2020
exist at all. Before you venture further, double-check the URL in your browser. If all seems
2121
well, consider navigating back to our homepage to explore anew. Thanks for your understanding!
2222
</p>
23-
<a href="/">Go To Homepage</a>
23+
<a href="{base}/">Go To Homepage</a>
2424
</div>
2525
</div>
2626

@@ -47,11 +47,11 @@
4747
font-size: 1rem;
4848
text-decoration: none;
4949
text-transform: uppercase;
50-
background: #333;
50+
background: #fefefe;
5151
display: inline-block;
5252
padding: 1rem 2rem;
5353
border-radius: 1rem;
54-
color: #fff;
54+
color: #333;
5555
font-weight: 700;
5656
box-shadow: 0 4px 15px -5px #333;
5757
}

static/404.html

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414

1515
body {
1616
font-family: sans-serif;
17+
background-color: #333;
18+
color: #fefefe
1719
}
1820

1921
#notfound {
@@ -42,22 +44,25 @@
4244
font-size: 1rem;
4345
text-decoration: none;
4446
text-transform: uppercase;
45-
background: #333;
47+
background: #fefefe;
4648
display: inline-block;
4749
padding: 1rem 2rem;
4850
border-radius: 1rem;
49-
color: #fff;
51+
color: #333;
5052
font-weight: 700;
5153
box-shadow: 0 4px 15px -5px #333;
5254
}
5355
</style>
56+
<script>
57+
58+
</script>
5459
</head>
5560

5661
<body>
5762
<div id="notfound">
5863
<div class="notfound">
5964
<div class="notfound-404">
60-
<h1>Oops!</h1>
65+
<h1>Oops! 🤔</h1>
6166
</div>
6267
<h2>404 - Page not found</h2>
6368
<p>

0 commit comments

Comments
 (0)