feat: style 404 page (#649)

close #649
pull/654/head
Kia King Ishii 2 years ago
parent 36a67bd67d
commit c1ee195469

@ -2,23 +2,83 @@
import { useData } from 'vitepress'
const { site } = useData()
const msgs = [
`There's nothing here.`,
`How did we get here?`,
`That's a Four-Oh-Four.`,
`Looks like we've got some broken links.`
]
function getMsg() {
return msgs[Math.floor(Math.random() * msgs.length)]
}
</script>
<template>
<div class="NotFound">
<h1>404</h1>
<blockquote>{{ getMsg() }}</blockquote>
<a :href="site.base" aria-label="go to home">Take me home.</a>
<p class="code">404</p>
<h1 class="title">PAGE NOT FOUND</h1>
<div class="divider" />
<blockquote class="quote">
But if you don't change your direction, and if you keep looking, you may end up where you are heading.
</blockquote>
<div class="action">
<a class="link" :href="site.base" aria-label="go to home">
Take me home
</a>
</div>
</div>
</template>
<style scoped>
.NotFound {
padding: 64px 24px 96px;
text-align: center;
}
@media (min-width: 768px) {
.NotFound {
padding: 96px 32px 168px;
}
}
.code {
line-height: 64px;
font-size: 64px;
font-weight: 600;
}
.title {
padding-top: 12px;
letter-spacing: 2px;
line-height: 20px;
font-size: 20px;
font-weight: 700;
}
.divider {
margin: 24px auto 18px;
width: 64px;
height: 1px;
background-color: var(--vp-c-divider)
}
.quote {
margin: 0 auto;
max-width: 256px;
font-size: 14px;
font-weight: 500;
color: var(--vp-c-text-2);
}
.action {
padding-top: 20px;
}
.link {
display: inline-block;
border: 1px solid var(--vp-c-brand);
border-radius: 16px;
padding: 3px 16px;
font-size: 14px;
font-weight: 500;
color: var(--vp-c-brand);
transition: border-color 0.25s, color .25s;
}
.link:hover {
border-color: var(--vp-c-brand-dark);
color: var(--vp-c-brand-dark);
}
</style>

@ -92,6 +92,10 @@ ul {
padding: 0;
}
blockquote {
margin: 0;
}
pre,
code,
kbd,

Loading…
Cancel
Save