Skip to content

Commit

Permalink
404
Browse files Browse the repository at this point in the history
  • Loading branch information
al committed Jun 28, 2024
1 parent 3b3d586 commit 60ce3ff
Show file tree
Hide file tree
Showing 6 changed files with 354 additions and 11 deletions.
Empty file added public/.nojekyll
Empty file.
14 changes: 4 additions & 10 deletions public/404.html
Original file line number Diff line number Diff line change
@@ -1,16 +1,10 @@
<!doctype html>
<html>
<head>
<meta
content="0;url=/"
http-equiv="refresh"
/>
<script>
var pathname = window.location.pathname
var search = window.location.search
var hash = window.location.hash

window.location.replace('/?' + pathname + search + hash)
<script type="text/javascript">
var fullPath = window.location.pathname + window.location.search + window.location.hash
sessionStorage.setItem('redirectPath', fullPath)
window.location.replace('/')
</script>
</head>
<body></body>
Expand Down
313 changes: 313 additions & 0 deletions src/assets/images/404.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/components/HomePage0628/WhatToDo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
</div>

<h2
class="text-center my-6 max-w-full flex-1 font-sans text-3xl font-bold text-gray-500 md:mx-auto md:flex-none leading-none tracking-tight sm:text-4xl"
class="text-center my-6 pb-4 max-w-full flex-1 font-sans text-3xl font-bold text-gray-500 md:mx-auto md:flex-none leading-none tracking-tight sm:text-4xl"
>
Do the right thing&hellip;
</h2>
Expand Down
12 changes: 12 additions & 0 deletions src/router/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import HomePage0625 from '../views/HomePage0625.vue'
import HomePage0624a from '../views/HomePage0624a.vue'
import HomePage0624b from '../views/HomePage0624b.vue'
import HomePage0620 from '../views/HomePage0620.vue'
import NotFound from '../views/NotFound.vue'
import PosterMaker from '../views/PosterMaker.vue'

const routes = [
Expand Down Expand Up @@ -44,6 +45,7 @@ const routes = [
],
component: PageLayout,
},
{ path: '/:pathMatch(.*)*', component: NotFound },
]

const router = createRouter({
Expand Down Expand Up @@ -76,4 +78,14 @@ const router = createRouter({
},
})

router.beforeEach((to, from, next) => {
const redirectPath = sessionStorage.getItem('redirectPath')
if (redirectPath) {
sessionStorage.removeItem('redirectPath')
next(redirectPath)
} else {
next()
}
})

export default router
24 changes: 24 additions & 0 deletions src/views/NotFound.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<template>
<div class="h-screen overflow-hidden flex items-center justify-center bg-white">
<div
class="container flex flex-col md:flex-row-reverse items-center justify-center px-5 text-gray-700"
>
<div class="max-w-lg">
<img src="@/assets/images/404.svg" />
</div>
<div class="text-center max-w-md">
<div class="text-5xl font-dark font-semibold">404</div>
<p class="text-2xl md:text-3xl my-10 font-light leading-normal">
Sorry we couldn't find that page.
</p>

<a
class="px-4 inline py-2 text-sm font-medium leading-5 shadow border border-transparent rounded-lg bg-orange-600 text-white transition duration-200 hover:bg-orange-900 focus:shadow-outline focus:outline-none"
href="/"
>
Back to homepage
</a>
</div>
</div>
</div>
</template>

0 comments on commit 60ce3ff

Please sign in to comment.