mirror of
https://github.com/Fluffy-Bean/TastyBites.git
synced 2025-01-14 10:35:19 +00:00
Add back button on images
Improve spacer element
This commit is contained in:
parent
fe96fb6f93
commit
899867e72d
|
@ -1,6 +1,6 @@
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { link } from 'svelte-spa-router';
|
import { link } from 'svelte-spa-router';
|
||||||
import { Acorn, Fish, GrainsSlash, Leaf, Minus, Pepper, Plus, SmileySad, ShoppingCart, SealWarning } from "phosphor-svelte";
|
import { Acorn, Fish, GrainsSlash, Leaf, Minus, Pepper, Plus, SmileySad, ShoppingCart, SealWarning, ArrowLeft } from "phosphor-svelte";
|
||||||
import SvelteMarkdown from 'svelte-markdown'
|
import SvelteMarkdown from 'svelte-markdown'
|
||||||
|
|
||||||
import { Labels } from "../lib/types";
|
import { Labels } from "../lib/types";
|
||||||
|
@ -46,6 +46,10 @@
|
||||||
{/if}
|
{/if}
|
||||||
{/await}
|
{/await}
|
||||||
|
|
||||||
|
<a href="/menu" use:link id="back-button"><ArrowLeft /> Back</a>
|
||||||
|
|
||||||
|
<div class="spacer half" />
|
||||||
|
|
||||||
<div class="main">
|
<div class="main">
|
||||||
{#await item}
|
{#await item}
|
||||||
<div id="images">
|
<div id="images">
|
||||||
|
@ -61,6 +65,8 @@
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="spacer half" />
|
||||||
|
|
||||||
<div id="info">
|
<div id="info">
|
||||||
<div class="loading title" />
|
<div class="loading title" />
|
||||||
<div class="loading price" />
|
<div class="loading price" />
|
||||||
|
@ -87,6 +93,9 @@
|
||||||
{/if}
|
{/if}
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="spacer half" />
|
||||||
|
|
||||||
<div id="info">
|
<div id="info">
|
||||||
<h2>{item.name}</h2>
|
<h2>{item.name}</h2>
|
||||||
<p>£{item.price}</p>
|
<p>£{item.price}</p>
|
||||||
|
@ -131,7 +140,7 @@
|
||||||
<button class="button" class:disabled={basketAmount <= 1} on:click={reduce}><Minus /></button>
|
<button class="button" class:disabled={basketAmount <= 1} on:click={reduce}><Minus /></button>
|
||||||
<p>{basketAmount}</p>
|
<p>{basketAmount}</p>
|
||||||
<button class="button" class:disabled={basketAmount >= 99} on:click={increase}><Plus /></button>
|
<button class="button" class:disabled={basketAmount >= 99} on:click={increase}><Plus /></button>
|
||||||
<hr>
|
<div class="spacer half" />
|
||||||
{#await cartLoaded}
|
{#await cartLoaded}
|
||||||
<button class="button add disabled" id="add-to-cart">Add to Cart <ShoppingCart weight="fill" /></button>
|
<button class="button add disabled" id="add-to-cart">Add to Cart <ShoppingCart weight="fill" /></button>
|
||||||
{:then _}
|
{:then _}
|
||||||
|
@ -191,13 +200,37 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#back-button {
|
||||||
|
margin-top: 8px;
|
||||||
|
padding: 0 $spacing-small;
|
||||||
|
|
||||||
|
width: max-content;
|
||||||
|
height: 30px;
|
||||||
|
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
justify-content: flex-start;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
font-size: $font-size-p;
|
||||||
|
text-decoration: none;
|
||||||
|
|
||||||
|
border-radius: 9999px;
|
||||||
|
background-color: transparent;
|
||||||
|
color: $color-on-background;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
background-color: $color-light;
|
||||||
|
color: $color-on-light;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.main {
|
.main {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
}
|
}
|
||||||
|
|
||||||
#images {
|
#images {
|
||||||
margin-right: $spacing-normal;
|
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
|
||||||
|
@ -341,7 +374,9 @@
|
||||||
|
|
||||||
&.add {
|
&.add {
|
||||||
padding: 0 $spacing-normal;
|
padding: 0 $spacing-normal;
|
||||||
|
|
||||||
border: 0 solid transparent;
|
border: 0 solid transparent;
|
||||||
|
border-radius: $border-radius-circle;
|
||||||
background-color: $color-dark;
|
background-color: $color-dark;
|
||||||
color: $color-on-dark;
|
color: $color-on-dark;
|
||||||
|
|
||||||
|
@ -384,16 +419,6 @@
|
||||||
border: 1px solid transparent;
|
border: 1px solid transparent;
|
||||||
color: $color-on-light;
|
color: $color-on-light;
|
||||||
}
|
}
|
||||||
|
|
||||||
> hr {
|
|
||||||
margin: 0 $spacing-small;
|
|
||||||
|
|
||||||
width: 1px;
|
|
||||||
height: 100%;
|
|
||||||
|
|
||||||
border: 0 solid transparent;
|
|
||||||
background-color: rgba($color-dark, 0.1);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.other {
|
.other {
|
||||||
|
|
|
@ -90,9 +90,20 @@ button {
|
||||||
}
|
}
|
||||||
|
|
||||||
.spacer {
|
.spacer {
|
||||||
|
min-width: $spacing-large;
|
||||||
|
width: $spacing-large;
|
||||||
|
max-width: $spacing-large;
|
||||||
|
min-height: $spacing-large;
|
||||||
height: $spacing-large;
|
height: $spacing-large;
|
||||||
|
max-height: $spacing-large;
|
||||||
|
|
||||||
&.half {
|
&.half {
|
||||||
|
min-width: calc($spacing-large / 2);
|
||||||
|
width: calc($spacing-large / 2);
|
||||||
|
max-width: calc($spacing-large / 2);
|
||||||
|
min-height: calc($spacing-large / 2);
|
||||||
height: calc($spacing-large / 2);
|
height: calc($spacing-large / 2);
|
||||||
|
max-height: calc($spacing-large / 2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue