Start on Menu page

Update style of Loader
Tweak SCSS colours to make contrast better
This commit is contained in:
Michał 2024-04-24 12:01:06 +01:00
parent 7907972e1c
commit 1d4f6d5b70
7 changed files with 168 additions and 40 deletions

View file

@ -7,6 +7,7 @@
let oldLocation = undefined; let oldLocation = undefined;
let showNavBar = false; let showNavBar = false;
let fullWidth = false;
let scrollY = 0; let scrollY = 0;
function routeLoading(event) { function routeLoading(event) {
@ -14,6 +15,7 @@
return; // not an actual change return; // not an actual change
} }
showNavBar = event.detail.userData.showNavBar; showNavBar = event.detail.userData.showNavBar;
fullWidth = event.detail.userData.fullWidth;
oldLocation = event.detail.location; oldLocation = event.detail.location;
} }
@ -28,9 +30,14 @@
</svelte:head> </svelte:head>
{#if showNavBar } {#if showNavBar }
<NavigationBar scrolled={scrollY > 0} /> <NavigationBar
scrolled={scrollY > 0}
/>
{/if} {/if}
<main class:nav-space={showNavBar}> <main
class:nav-space={showNavBar}
class:full-width={fullWidth}
>
<Router <Router
routes={routes} routes={routes}
restoreScrollState={true} restoreScrollState={true}

View file

@ -38,7 +38,7 @@
name: "GwaGwa", name: "GwaGwa",
price: "Priceless", price: "Priceless",
labels: ["nut"], labels: ["nut"],
image: "/dab.jpg", // image: "/dab.jpg",
} }
]; ];
</script> </script>

View file

@ -1,5 +1,7 @@
<script> <script>
import { ArrowClockwise } from "phosphor-svelte";
import MenuList from "%/pages/components/MenuList.svelte"; import MenuList from "%/pages/components/MenuList.svelte";
import LoadingBar from "%/pages/components/LoadingBar.svelte";
const items = [ const items = [
{ {
@ -35,52 +37,165 @@
name: "GwaGwa", name: "GwaGwa",
price: "Priceless", price: "Priceless",
labels: ["nut"], labels: ["nut"],
image: "/dab.jpg", // image: "/dab.jpg",
} }
]; ];
</script> </script>
<h2>Menu</h2> <div class="menu">
<MenuList {items} /> <div class="menu-filter">
<div class="spacer"></div> <LoadingBar />
<h2>Menu</h2> <div class="menu-filter-header">
<MenuList {items} /> <h2>Filter</h2>
<div class="spacer"></div> <button><ArrowClockwise /></button>
</div>
<h2>Menu</h2> <hr>
<MenuList {items} />
<h3>Meal Preferences</h3>
<ul>
<li>Vegan</li>
<li>Vegetarian</li>
<li>Pescatarian</li>
</ul>
<hr>
<h3>Allergies</h3>
<ul>
<li>Nut</li>
<li>Sea</li>
<li>Dairy</li>
</ul>
<hr>
<h3>Types</h3>
<ul>
<li>Breakfast</li>
<li>Main</li>
<li>Dinner</li>
<li>
Drinks
<ul>
<li>Alcoholic</li>
<li>Non-Alcoholic</li>
</ul>
</li>
<li>Sides</li>
<li>Sweet</li>
</ul>
<hr>
<h3>Other</h3>
<ul>
<li>Hide Seasonal</li>
<li>Hide Unavailable</li>
</ul>
<hr>
<label>
Price
<input type="range" min="0" max="999">
</label>
</div>
<div class="menu-list">
<h2>Main Menu</h2>
<MenuList items={items} />
<div class="spacer"></div>
<h2>Pies</h2>
<MenuList items={items} />
<div class="spacer"></div>
<h2>Drinks</h2>
<MenuList items={items} />
</div>
</div>
<style lang="scss"> <style lang="scss">
h2 { h2 {
margin-bottom: 16px; margin-bottom: 16px;
} }
.spacer { .spacer {
height: 100px; height: 32px;
} }
a { .menu {
margin-top: 8px; display: flex;
flex-direction: row;
justify-content: normal;
align-items: flex-start;
}
padding-left: 10px; .menu-list {
padding-right: 10px; //padding-left: 300px;
padding-left: 16px;
}
height: 30px; .menu-filter {
padding: 16px;
width: 100%;
max-width: calc(300px - 16px);
position: sticky;
top: calc(55px + 16px);
//position: absolute;
//top: 16px;
//left: 16px;
border-radius: 5px;
background-color: #fffbf4;
color: #33251a;
h2 {
margin-bottom: 0;
}
hr {
margin: 16px -16px;
height: 1px;
border: 0 transparent;
background-color: rgba(#443023, 0.1);
}
button {
height: 32px;
width: 32px;
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
text-decoration: none; //position: absolute;
//top: 12px;
//right: 12px;
border-radius: 9999px; text-decoration: none;
background-color: transparent; font-size: 16px;
color: #33251a;
border-radius: 99999px;
border: 0 solid transparent;
background-color: #443023;
color: #e1dcd3;
&:hover { &:hover {
background-color: #fffbf4; background-color: #6A9343;
color: #33251a; color: #fffbf4;
} }
} }
}
.menu-filter-header {
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
}
</style> </style>

View file

@ -7,36 +7,36 @@ const routes = {
asyncComponent: () => import("%/pages/PageIndex.svelte"), asyncComponent: () => import("%/pages/PageIndex.svelte"),
loadingComponent: PageLoading, loadingComponent: PageLoading,
conditions: [], conditions: [],
userData: { showNavBar: true }, userData: { showNavBar: true, fullWidth: false, },
}), }),
"/menu": wrap({ "/menu": wrap({
asyncComponent: () => import("%/pages/PageMenu.svelte"), asyncComponent: () => import("%/pages/PageMenu.svelte"),
loadingComponent: PageLoading, loadingComponent: PageLoading,
conditions: [], conditions: [],
userData: { showNavBar: true }, userData: { showNavBar: true, fullWidth: true, },
}), }),
"/contact": wrap({ "/contact": wrap({
asyncComponent: () => import("%/pages/PageContact.svelte"), asyncComponent: () => import("%/pages/PageContact.svelte"),
loadingComponent: PageLoading, loadingComponent: PageLoading,
conditions: [], conditions: [],
userData: { showNavBar: true }, userData: { showNavBar: true, fullWidth: false, },
}), }),
"/about": wrap({ "/about": wrap({
component: PageLoading, component: PageLoading,
loadingComponent: PageLoading, loadingComponent: PageLoading,
conditions: [], conditions: [],
userData: { showNavBar: true }, userData: { showNavBar: true, fullWidth: false, },
}), }),
"/cart": wrap({ "/cart": wrap({
asyncComponent: () => import("%/pages/PageCart.svelte"), asyncComponent: () => import("%/pages/PageCart.svelte"),
loadingComponent: PageLoading, loadingComponent: PageLoading,
conditions: [], conditions: [],
userData: { showNavBar: true }, userData: { showNavBar: true, fullWidth: false, },
}), }),
'*': wrap({ '*': wrap({
component: Page404, component: Page404,
conditions: [], conditions: [],
userData: { showNavBar: false }, userData: { showNavBar: false, fullWidth: false, },
}) })
} }

View file

@ -15,7 +15,6 @@
.bar { .bar {
position: absolute; position: absolute;
background-color: $color-primary;
transition: transform .2s linear; transition: transform .2s linear;
left: 0; left: 0;
top: 0; top: 0;
@ -24,10 +23,12 @@
width: 100%; width: 100%;
&.bar-1 { &.bar-1 {
background-color: $color-dark;
animation: growBar1 2.5s infinite, moveBar1 2.5s infinite; animation: growBar1 2.5s infinite, moveBar1 2.5s infinite;
} }
&.bar-2 { &.bar-2 {
background-color: $color-primary;
animation: growBar2 2.5s infinite, moveBar2 2.5s infinite; animation: growBar2 2.5s infinite, moveBar2 2.5s infinite;
} }
} }

View file

@ -13,6 +13,7 @@ body, #app {
body { body {
background-color: $color-background; background-color: $color-background;
color: $color-on-background;
} }
main { main {
@ -29,4 +30,7 @@ main {
&.nav-space { &.nav-space {
margin-top: $sizing-navigation-height; margin-top: $sizing-navigation-height;
} }
&.full-width {
max-width: $sizing-full-width;
}
} }

View file

@ -6,7 +6,7 @@ $color-on-dark: #e1dcd3;
$color-light: #fffbf4; $color-light: #fffbf4;
$color-on-light: #33251a; $color-on-light: #33251a;
$color-primary: #6A9343; $color-primary: #6A9343;
$color-on-primary: #ccc2ae; $color-on-primary: #fffbf4;
$color-vegan: #75a446; $color-vegan: #75a446;
$color-fish: #487fa6; $color-fish: #487fa6;
@ -20,6 +20,7 @@ $border-radius-circle: 99999px;
// SIZING // SIZING
$sizing-default-width: 1000px; $sizing-default-width: 1000px;
$sizing-full-width: 1200px;
$sizing-navigation-height: 55px; $sizing-navigation-height: 55px;
// PADDING/MARGIN // PADDING/MARGIN