From 04adf38b469e750d965aeeda819fb1cd90d17289 Mon Sep 17 00:00:00 2001 From: Fluffy Date: Fri, 26 Apr 2024 13:50:21 +0100 Subject: [PATCH] Add contact form Fake API Make Index resize to mobile better Add error colour --- front/public/LogoAlt.svg | 13 ++- front/src/lib/APIDEV.js | 22 ++++ front/src/{ => lib}/testData.js | 26 ++--- front/src/pages/PageCart.svelte | 3 - front/src/pages/PageContact.svelte | 158 +++++++++++++++++++++++++- front/src/pages/PageIndex.svelte | 48 ++++---- front/src/pages/PageItem.svelte | 2 +- front/src/pages/PageMenu.svelte | 23 ++-- front/src/styles/_navigation_bar.scss | 4 +- front/src/styles/_reset.scss | 6 +- front/src/styles/vars.scss | 2 + 11 files changed, 248 insertions(+), 59 deletions(-) create mode 100644 front/src/lib/APIDEV.js rename front/src/{ => lib}/testData.js (69%) diff --git a/front/public/LogoAlt.svg b/front/public/LogoAlt.svg index 203865c..d416966 100644 --- a/front/public/LogoAlt.svg +++ b/front/public/LogoAlt.svg @@ -1,14 +1,15 @@ - - - - + + + + - - + + + diff --git a/front/src/lib/APIDEV.js b/front/src/lib/APIDEV.js new file mode 100644 index 0000000..241cbd3 --- /dev/null +++ b/front/src/lib/APIDEV.js @@ -0,0 +1,22 @@ +import Items from '%/lib/testData.js'; + +export function getPopularToday() { + return Items; +} + +export function getMenuItems() { + return [ + { + name: "Main Menu", + items: Items, + }, + { + name: "Breakfast", + items: [], + }, + { + name: "Seasonal", + items: Items, + }, + ]; +} diff --git a/front/src/testData.js b/front/src/lib/testData.js similarity index 69% rename from front/src/testData.js rename to front/src/lib/testData.js index 23383f7..b8b3f75 100644 --- a/front/src/testData.js +++ b/front/src/lib/testData.js @@ -32,22 +32,22 @@ export default Items = [ price: -9999, labels: ["nut"], }, - { - name: "GwaGwa", - price: "Priceless", - labels: ["nut"], - // image: "/dab.jpg", - }, + // { + // name: "GwaGwa", + // price: "Priceless", + // labels: ["nut"], + // image: "/dab.jpg", + // }, { name: "Hogermellon", - price: "balls", + price: "1111", labels: ["fish"], image: "/wathog.jpg", }, - { - name: "Blue HOGGGGG", - price: "ARUGH", - labels: ["nut", "gluten", "spicy"], - image: "/sonichog.jpg", - }, + // { + // name: "Blue HOGGGGG", + // price: "ARUGH", + // labels: ["nut", "gluten", "spicy"], + // image: "/sonichog.jpg", + // }, ]; diff --git a/front/src/pages/PageCart.svelte b/front/src/pages/PageCart.svelte index fd0db9a..b4d53bf 100644 --- a/front/src/pages/PageCart.svelte +++ b/front/src/pages/PageCart.svelte @@ -13,6 +13,3 @@

Looking past orders? Check out the commonly asked questions

- - \ No newline at end of file diff --git a/front/src/pages/PageContact.svelte b/front/src/pages/PageContact.svelte index 0a90642..9d6686e 100644 --- a/front/src/pages/PageContact.svelte +++ b/front/src/pages/PageContact.svelte @@ -1,5 +1,24 @@

Contact us

@@ -26,6 +45,141 @@

Contact From

-
+ +
+ + {nameValid = name.length > 1}} + type="text" + id="name" + name="name" + class="form-input" + /> + {#if !nameValid} + Enter a name + {/if} +
-
\ No newline at end of file +
+ + {emailValid = email.length > 1}} + type="text" + id="email" + name="email" + class="form-input" + /> + {#if !emailValid} + Email not valid + {/if} +
+ +
+ +