Skip to content

Commit

Permalink
Merge pull request #13 from nblackburn/feature/404
Browse files Browse the repository at this point in the history
404 page
  • Loading branch information
nblackburn authored Oct 24, 2022
2 parents 2a811d4 + ccc4bc6 commit 308e364
Show file tree
Hide file tree
Showing 5 changed files with 74 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@nblackburn/website",
"private": true,
"version": "1.3.0",
"version": "1.4.0",
"scripts": {
"start": "astro dev",
"build": "astro build",
Expand Down
39 changes: 39 additions & 0 deletions src/components/notFound.css.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import { style } from '@vanilla-extract/css';
import { sizes, vars, primaryAccent, containers } from '@styles/theme.css';

export const notFound = style({
flex: 1,
display: 'flex',
fontSize: '1.2rem',
alignItems: 'center',
flexDirection: 'column',
justifyContent: 'center'
});

export const container = style({
textAlign: 'center',
maxWidth: containers.small
});

export const title = style({
margin: 0,
fontWeight: 'bold',
color: primaryAccent,
fontSize: sizes.xtraLarge,
marginBottom: sizes.small
});

export const subTitle = style({
margin: 0,
fontSize: sizes.medium,
color: vars.colors.davyGrey,
'@media': {
'(prefers-color-scheme: dark)': {
color: vars.colors.silverChalice
}
}
});

export const description = style({
lineHeight: 1.5
});
22 changes: 22 additions & 0 deletions src/components/notFound.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<template>
<section :class="styles.notFound">
<div :class="styles.container">
<h1 :class="styles.title">404</h1>
<h2 :class="styles.subTitle">Page not found</h2>
<p :class="styles.description">
Well this is embarrasing, the link you clicked appears to be
broken or the page has moved.
</p>
</div>
</section>
</template>

<script lang="ts">
import * as styles from './notFound.css';
export default {
setup() {
return { styles };
}
};
</script>
2 changes: 1 addition & 1 deletion src/layouts/base.astro
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { getActivePalette } from '@utilities/paletteManager';
export interface Props {
title: string;
activePage: string;
activePage?: string;
description?: string;
}
Expand Down
11 changes: 11 additions & 0 deletions src/pages/404.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
import BaseLayout from '@layouts/base.astro';
import NotFound from '@components/notFound.vue';
const title = '404';
const description = 'Page not found';
---

<BaseLayout title={title} description={description}>
<NotFound />
</BaseLayout>

0 comments on commit 308e364

Please sign in to comment.