From 383f22bdf83eeb7f7761d26e994787d618e0148b Mon Sep 17 00:00:00 2001 From: Fluffy-Bean Date: Sun, 28 Apr 2024 19:19:05 +0100 Subject: [PATCH] Improve Item page Add 500 page and dedicated 404 page Add fake cache to tester API Adjust some styles for better readability and usability --- front/src/App.svelte | 18 +- .../src/components/AnnouncementBanner.svelte | 9 +- front/src/components/DropDown.svelte | 2 +- front/src/components/MenuItem.svelte | 20 +- front/src/components/MenuList.svelte | 10 +- front/src/lib/test-api.js | 35 ++- front/src/lib/test-data.js | 8 + front/src/pages/Page500.svelte | 32 +++ front/src/pages/PageContact.svelte | 1 + front/src/pages/PageItem.svelte | 235 ++++++++++++++---- front/src/routes.js | 18 +- 11 files changed, 297 insertions(+), 91 deletions(-) create mode 100644 front/src/pages/Page500.svelte diff --git a/front/src/App.svelte b/front/src/App.svelte index 63e85df..28090dc 100644 --- a/front/src/App.svelte +++ b/front/src/App.svelte @@ -14,20 +14,19 @@ cart: {path: '/cart', className: 'active'}, } - let windowScrollY = 0; - let windowWidth = 0; + let scrollY = 0; + let width = 0; let oldLocation = undefined; let fullWidth = false; let showNavBar = false; - $: scrolled = windowScrollY > 0 - $: mobile = windowWidth < 700 - function routeLoading(event) { if (event.detail.location === oldLocation) { + console.log("Fake!"); return; // not an actual change } + showNavBar = event.detail.userData.showNavBar; fullWidth = event.detail.userData.fullWidth; oldLocation = event.detail.location; @@ -38,15 +37,18 @@ } - + {#if showNavBar } -