Skip to content

Commit

Permalink
print fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
motocarota committed Aug 7, 2024
1 parent 0694e06 commit 7e52f3f
Show file tree
Hide file tree
Showing 8 changed files with 40 additions and 22 deletions.
3 changes: 2 additions & 1 deletion src/app.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
<link rel="icon" href="%sveltekit.assets%/favicon.png" />
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Montserrat">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Caudex">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Josefin+Sans:wght@100">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Quicksand">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Red+Hat+Display">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Red+Hat+Display">
<meta name="viewport" content="width=device-width, initial-scale=1" />
%sveltekit.head%
Expand Down
4 changes: 2 additions & 2 deletions src/lib/MenuFoodRow.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@
<div style="background: {color}" class="dot"></div>
</div>
<div class="flex-1 min-w-72">
<span style="color: {accentColor}" class="text-xl print:text-xs"
<span style="color: {accentColor}" class="text-xl print:text-sm"
>{name}</span
>
<br />
<span class="text-sm print:text-xs">{desc}</span>
<span class="text-sm print:text-sm">{desc}</span>
</div>
<div>
{n}
Expand Down
12 changes: 3 additions & 9 deletions src/lib/MenuRow.svelte
Original file line number Diff line number Diff line change
@@ -1,22 +1,16 @@
<script>
import MenuFoodRow from "./MenuFoodRow.svelte";
import MenuRowTitle from "./MenuRowTitle.svelte";
import MenuWineRow from "./MenuWineRow.svelte";
export let post;
export let data;
const altColor = data.secondaryColor ?? "#333";
const [_color = "", name, _notes, _desc, price, show = 0] = post ?? [];
const [_color = "", _name, _notes, _desc, price, show = 0] = post ?? [];
</script>
{#if show && show > 0}
<!-- TITLE -->
{#if !price}
<div
style="color: {altColor}"
class="p-5 print:p-0 print:pb-3 text-xl font-extrabold text-center"
>
{name}
</div>
<MenuRowTitle {data} {post} />
{:else}
{#if data.type === "food"}
<MenuFoodRow {data} {post} />
Expand Down
18 changes: 18 additions & 0 deletions src/lib/MenuRowTitle.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<script>
export let data;
export let post;
const altColor = data.secondaryColor ?? "#333";
const [_color, name] = post ?? [];
</script>
{#if name === "---"}
<div class="page-break"></div>
{:else}
<div
style="color: {altColor}"
class="p-5 print:mb-3 text-2xl font-extrabold text-center"
>
{name}
</div>
{/if}
17 changes: 11 additions & 6 deletions src/lib/MenuWineRow.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,18 @@
<div style="background: {color}" class="dot"></div>
</div>
<div class="flex-1 lg:min-w-72">
<span style="color: {accentColor}" class="text-xl print:text-xs"
>{name}</span
><br />
<span class="mr-6 print:text-xs">{notes}</span>
<div class="flex justify-center">
<div style="color: {accentColor}" class="text-xl print:text-md">
{name}
</div>
{#if desc}
<div class="text-xl print:text-md ml-1">- {desc}</div>
{/if}
</div>
<span class="mr-6 print:text-md">{notes}</span>
</div>
<div class="mr-6 print:text-xs">{desc}</div>
<div class="text-lg print:text-sm font-bold" style="color: {altColor}">
<div class="text-lg print:text-md font-bold" style="color: {altColor}">
{price}
</div>
</div>
2 changes: 1 addition & 1 deletion src/menus.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const base = {
primaryColor: '#898989',
secondaryColor: '#3b5577',
accentColor: '#3b5577',
fontFamily: 'Red Hat Display,sans-serif'
fontFamily: 'Quicksand'
},
ddf: {
address: "Piazza della Libertà 42, 16033 Lavagna GE",
Expand Down
2 changes: 1 addition & 1 deletion src/print.css
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
}

* {
font-size: 10px;
font-size: 13px;
}

li {
Expand Down
4 changes: 2 additions & 2 deletions src/routes/view/[menuId]/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
style="background-color: {data.bgColor ??
'#efefef'}; font-family: {data.fontFamily}; color: {data.primaryColor ??
'#333'}"
class="print:text-xs"
class="print:text-md"
>
<div class="no-print">
<h1 style="color: {data.accentColor ?? '#333'}">
Expand All @@ -41,7 +41,7 @@
<img src={data.pic} alt="logo" />
{/if}
</div>
<div class="table">
<div>
{#if loading}
<p class="text-center">Caricamento...</p>
{/if}
Expand Down

0 comments on commit 7e52f3f

Please sign in to comment.