Skip to content

Commit e827cbc

Browse files
committed
✨ Add 404 Page
Thanks @IanSSenne for pointing out it was missing!
1 parent 246258e commit e827cbc

File tree

3 files changed

+58
-11
lines changed

3 files changed

+58
-11
lines changed

src/lib/styles/kit-docs.css

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@
7575
--kd-color-body: 31 33 40;
7676
--kd-color-focus: 129 140 248;
7777

78+
--kd-color-subtle: rgb(106, 116, 132);
79+
7880
--kd-code-fence-bg: rgb(22 23 27);
7981
--kd-code-fence-fg: rgb(186 190 216);
8082
}

src/routes/+layout.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
import { createKitDocsLoader } from '@svelteness/kit-docs'
22

33
export const prerender = true
4+
export const ssr = false
45

56
export const load = createKitDocsLoader({
67
sidebar: {
78
'/': null,
89
'/docs': '/docs',
9-
"/404": "/docs"
10+
'/404': '/docs'
1011
}
1112
})

src/routes/404/+page.svelte

Lines changed: 54 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,49 @@
11
<script lang="ts">
2+
export const flavorQuotes = [
3+
`Uh oh!`,
4+
`Time to fire up the ol' debugger!`,
5+
`Your item displays are sad 🥺`,
6+
`Skill Issue.`,
7+
`Should'a seen that one comming...`,
8+
`Snaviewavie did an oopsie poopsie x3`,
9+
`We to a little trolling.`,
10+
`execute run execute run execute run execute run say This is fine.`,
11+
`This is why we can't have nice things. :(`,
12+
`Have you tried turning it off and on again?`,
13+
`What if I put my command block next to yours? Haha just kidding... Unless?`,
14+
`If at first you don't succeed, try, try again!`,
15+
// We do a little trolling in binary.
16+
`B:01010111 01100101 00100000 01100100 01101111 00100000 01100001 00100000 01101100 01101001 01110100 01110100 01101100 01100101 00100000 01110100 01110010 01101111 01101100 01101100 01101001 01101110 01100111`,
17+
`I've decided to stop working for today. Try again tomorrow!`,
18+
`Every time you see this error message, a developer vanishes in a puff of binary.`,
19+
`"Flavor Text"? I've never tasted text before...`,
20+
`( ͡° ͜ʖ ͡°) nice 404 page you got there.`,
21+
`Some day you'll learn. But until then, I control the cheese.`,
22+
`Please deposit 5 coins!`,
23+
`Failed to find global 'pandemic'.`,
24+
`I'm sorry, Dave. I'm afraid I can't do that.`,
25+
`<a href="https://xkcd.com/221/"><img src="https://imgs.xkcd.com/comics/random_number.png" alt="https://xkcd.com/221/"/></a>`
26+
]
27+
28+
function getRandomFlavorQuote() {
29+
return flavorQuotes[Math.floor(Math.random() * flavorQuotes.length)]
30+
}
231
</script>
332

433
<div class="page">
534
<div class="center-container">
635
<div class="header-container">
7-
<!-- svelte-ignore a11y-missing-attribute -->
8-
<img src="/img/animated_java_icon.svg" />
36+
<img src="/img/animated_java_icon.svg" alt="Animated Java icon" />
937
<div>
1038
<h1>Uh oh :(</h1>
11-
<p>Something's missing here.</p>
39+
<p>Looks like that page doesn't exist!</p>
40+
<p>
41+
Try <a href="/docs">searching our documentation</a> or return to the
42+
<a href="/">home page</a>.
43+
</p>
1244
</div>
13-
1445
</div>
46+
<q class="quote"><span>{@html getRandomFlavorQuote()}</span></q>
1547
</div>
1648
</div>
1749

@@ -35,6 +67,13 @@
3567
.discord-widget :global(.widgetBody-38iyIo) {
3668
display: none;
3769
} */
70+
a {
71+
color: var(--tw-prose-links);
72+
text-decoration: none;
73+
font-weight: 400;
74+
border-bottom: 1px solid rgb(var(--kd-color-brand));
75+
}
76+
3877
.page {
3978
display: flex;
4079
flex-direction: column;
@@ -54,7 +93,7 @@
5493
.header-container {
5594
display: flex;
5695
align-items: center;
57-
margin: 6rem 0 0rem 0;
96+
margin-top: 2rem;
5897
}
5998
.header-container div {
6099
display: flex;
@@ -71,16 +110,21 @@
71110
margin: 0px;
72111
font-size: 3rem;
73112
}
74-
hr {
75-
width: 100%;
76-
margin: 0rem 0 0.5rem 0;
77-
border: 1px solid rgb(var(--kd-color-brand));
113+
114+
q {
115+
margin: 1rem 0;
116+
color: var(--kd-color-subtle);
117+
font-size: 1.25rem;
118+
font-style: italic;
119+
}
120+
121+
q span {
122+
margin: 0 0.25em;
78123
}
79124
80125
@media (max-width: 768px) {
81126
.header-container {
82127
flex-direction: column;
83-
margin: 2rem 0 0 0;
84128
}
85129
.header-container > div {
86130
margin-left: unset;

0 commit comments

Comments
 (0)