error page, cleanup +layout slightly

This commit is contained in:
Jill 2023-05-18 05:34:32 +03:00
parent 3f3eea8f09
commit ace334e5a3
Signed by: oat
GPG Key ID: 33489AA58A955108
2 changed files with 65 additions and 13 deletions

39
src/routes/+error.svelte Normal file
View File

@ -0,0 +1,39 @@
<script>
import { page } from '$app/stores';
</script>
<style>
.content {
max-width: 600px;
margin: auto;
}
.gradient {
font-size: 5rem;
line-height: 1.0;
background: repeating-linear-gradient(98deg, rgba(190,190,190,1) 0%, rgba(190,190,190,1) 10%, rgba(207,207,207,1) 10%, rgba(207,207,207,1) 20%);
background-clip: text;
-webkit-text-fill-color: transparent;
font-weight: bolder;
}
h1 {
margin-bottom: 0.15em;
}
.error {
display: flex;
flex-direction: column;
align-items: center;
width: 100%;
margin-top: 1rem;
margin-bottom: 1rem;
font-size: 1.2rem;
}
</style>
<div class="content">
<div class="error">
<div class="gradient">
<h1>{$page.status}</h1>
</div>
{$page.error.message}
</div>
</div>

View File

@ -30,20 +30,33 @@
max-width: 1200px;
width: 100%;
}
.content {
min-height: 100vh;
display: flex;
flex-direction: column;
justify-content: flex-start;
}
.location.errored {
color: #e95678;
}
</style>
<header>
<CommandLine>
cd {(new URL($page.url)).pathname}
</CommandLine>
</header>
<div class="content">
<header>
<CommandLine>
cd <span class="location" class:errored={$page.error !== null}>{(new URL($page.url)).pathname}</span>
</CommandLine>
</header>
<slot/>
<slot/>
<footer>
<div class="inner">
<a href="https://cohost.org/{config.handle}/tagged/{config.tag}" target="_blank" rel="noopener noreferrer">view on cohost</a>
&middot;
<a href={constants.repo} target="_blank" rel="noopener noreferrer">powered by {constants.name}</a>
</div>
</footer>
<footer>
<div class="inner">
<a href="https://cohost.org/{config.handle}/tagged/{config.tag}" target="_blank" rel="noopener noreferrer">view on cohost</a>
&middot;
<a href={constants.repo} target="_blank" rel="noopener noreferrer">powered by {constants.name}</a>
</div>
</footer>
</div>