From f03f9f91143bbf4f82a7a38f0dcbad24e358a716 Mon Sep 17 00:00:00 2001 From: yyasha Date: Tue, 14 Nov 2023 16:16:44 +0300 Subject: [PATCH] mobile recipe version --- src/routes/+page.svelte | 2 + src/routes/Header.svelte | 7 +- src/routes/categories/+page.svelte | 32 +++------ src/routes/categories/[category]/+page.svelte | 69 ++++++++++++++----- src/routes/recipe/[recipeid]/+page.svelte | 56 ++++++++------- 5 files changed, 95 insertions(+), 71 deletions(-) diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index f95bcb2..ce10d79 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -59,6 +59,8 @@ {/each} + {:catch error} + Ошибка {error} {/await} \ No newline at end of file diff --git a/src/routes/Header.svelte b/src/routes/Header.svelte index 165a013..7007189 100644 --- a/src/routes/Header.svelte +++ b/src/routes/Header.svelte @@ -1,8 +1,6 @@
-
+
Все рецепты в категории
"{$page.params.category.toLowerCase()}"
+

Категории

{#await recipes}
@@ -33,7 +50,7 @@
{:then data}
- {#each data.data.recipes as recipe (recipe.id)} + {#each recipes_list as recipe (recipe.id)} - {:catch} - Ошибка + + {:catch error} + Ошибка {error} {/await}
-
\ No newline at end of file +
+ + \ No newline at end of file diff --git a/src/routes/recipe/[recipeid]/+page.svelte b/src/routes/recipe/[recipeid]/+page.svelte index 386a040..d327e2f 100644 --- a/src/routes/recipe/[recipeid]/+page.svelte +++ b/src/routes/recipe/[recipeid]/+page.svelte @@ -14,7 +14,7 @@ }) -
+
{#await recipe_p}
@@ -29,33 +29,39 @@ {:then data}
-
- - - -

Время приготовления: {data.data.recipe.ctime}

-

|

- - - -

Количество порций: {data.data.recipe.snum}

-

|

- - - -

Калорийность: {data.data.recipe.cal}

+
+
+ + + +

Время приготовления: {data.data.recipe.ctime}

+
+ +
+ + + +

Количество порций: {data.data.recipe.snum}

+
+ +
+ + + +

Калорийность: {data.data.recipe.cal}

+
{#each data.data.recipe.categories as category} - {category} + {category} {/each}

{data.data.recipe.title}

-
+
{data.data.recipe.title} @@ -65,9 +71,9 @@ {data.data.recipe.desc}
-
+
-
+
{#each data.data.recipe.ingredients as ingredients}
@@ -136,14 +142,13 @@ .desc_container { display: flex; - flex-direction: row; align-items: center; - font-size: 1.3em; + /* font-size: 1.3em; */ /* gap: 14px; */ } .mainimg { - flex: 1 1; + flex: 1 0; border: dashed blue 1px; } @@ -155,7 +160,7 @@ .recipedesc { flex: 1; box-sizing: border-box; - padding: 0px 20px 0px 20px; + /* padding: 0px 20px 0px 20px; */ } #info svg { @@ -167,10 +172,12 @@ } #tags { + /* display: flex; */ align-items: flex-start; } #tags a { + margin-top: 5px; min-width: 3em; border-radius: 13px; font-size: 0.9em; @@ -183,7 +190,6 @@ .recipe_container { display: flex; - flex-direction: row; flex-wrap: wrap; box-sizing: border-box; gap: 5vw;