From 60ce3ffd6c2eaee9df8470b68bfa3c2844c615a0 Mon Sep 17 00:00:00 2001 From: Alan Larkin Date: Fri, 28 Jun 2024 16:55:18 +0100 Subject: [PATCH] 404 --- public/.nojekyll | 0 public/404.html | 14 +- src/assets/images/404.svg | 313 +++++++++++++++++++++++ src/components/HomePage0628/WhatToDo.vue | 2 +- src/router/index.js | 12 + src/views/NotFound.vue | 24 ++ 6 files changed, 354 insertions(+), 11 deletions(-) create mode 100644 public/.nojekyll create mode 100644 src/assets/images/404.svg create mode 100644 src/views/NotFound.vue diff --git a/public/.nojekyll b/public/.nojekyll new file mode 100644 index 0000000..e69de29 diff --git a/public/404.html b/public/404.html index 3100031..9e44fd4 100644 --- a/public/404.html +++ b/public/404.html @@ -1,16 +1,10 @@ - - diff --git a/src/assets/images/404.svg b/src/assets/images/404.svg new file mode 100644 index 0000000..e05630a --- /dev/null +++ b/src/assets/images/404.svg @@ -0,0 +1,313 @@ + + + + + + Artboard 1 copy + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/components/HomePage0628/WhatToDo.vue b/src/components/HomePage0628/WhatToDo.vue index 4803fcf..0ef6845 100644 --- a/src/components/HomePage0628/WhatToDo.vue +++ b/src/components/HomePage0628/WhatToDo.vue @@ -16,7 +16,7 @@

Do the right thing…

diff --git a/src/router/index.js b/src/router/index.js index 45b4374..c47a03d 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -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 = [ @@ -44,6 +45,7 @@ const routes = [ ], component: PageLayout, }, + { path: '/:pathMatch(.*)*', component: NotFound }, ] const router = createRouter({ @@ -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 diff --git a/src/views/NotFound.vue b/src/views/NotFound.vue new file mode 100644 index 0000000..b39dffd --- /dev/null +++ b/src/views/NotFound.vue @@ -0,0 +1,24 @@ +