Initial commit

This commit is contained in:
2023-06-19 00:32:51 +02:00
parent db849fd21f
commit 89612f02b6
281 changed files with 2199 additions and 0 deletions

View File

@@ -0,0 +1,11 @@
// import { error } from '@sveltejs/kit';
import type { PageLoad } from "./$types";
//import { Recipe } from '../../../models/Recipe';
//import { dbConnect, dbDisconnect } from '../../../utils/db';
export async function load({ fetch, params }) {
const res = await fetch(`/api/items/${params.name}`);
const item = await res.json();
return item;
};

View File

@@ -0,0 +1,46 @@
<script lang="ts">
import type { PageData } from './$types';
import MultiImgWrapper from './MultiImgWrapper.svelte'
export let data: PageData;
</script>
<h1>{data.name}</h1>
<MultiImgWrapper wrap={data.images.length>1} class=double>
{#each data.images as img}
<figure>
{#if img.caption}
<caption>{img.caption}</caption>
{/if}
</figure>
{/each}
</MultiImgWrapper>
{#if data.ingredients}
<h2>Zutaten</h2>
{#each data.ingredients as list}
{#if list.name}
<h3>{list.name}</h3>
{/if}
<ul>
{#each list.list as item}
<li>{item.amount} {item.unit} {item.name}</li>
{/each}
</ul>
{/each}
{/if}
{#if data.instructions}
<h2>Zubereitung</h2>
{#each data.instructions as list}
{#if list.name}
<h3>{list.name}</h3>
{/if}
<ol>
{#each list.steps as step}
<li>{step}</li>
{/each}
</ol>
{/each}
{/if}

View File

@@ -0,0 +1 @@
{"terminal": "nvimterm"}

View File

@@ -0,0 +1,10 @@
<script>
export let wrap = false
</script>
{#if wrap}
<div {...$$restProps}>
<slot />
</div>
{:else}
<slot />
{/if}