diff --git a/src/lib/InfiniteLoading.svelte b/src/lib/InfiniteLoading.svelte new file mode 100644 index 0000000..d3f2f3a --- /dev/null +++ b/src/lib/InfiniteLoading.svelte @@ -0,0 +1,380 @@ + + + + +
+ {#if showSpinner} +
+ + + +
+ {/if} + + {#if showNoResults} +
+ + + +
+ {/if} + + {#if showNoMore} +
+ + + +
+ {/if} + + {#if showError} +
+ + --- +
+ +
+
+ {/if} +
+ + \ No newline at end of file diff --git a/src/lib/Spinner.svelte b/src/lib/Spinner.svelte new file mode 100644 index 0000000..c50b3c8 --- /dev/null +++ b/src/lib/Spinner.svelte @@ -0,0 +1,467 @@ + + +{#if spinner === 'bubbles'} + + + + + + + + + + + + + +{:else if spinner === 'circles'} + + + + + + + + + + + + + +{:else if spinner === 'spiral'} + + + + +{:else if spinner === 'wavedots'} + + + + + + + + + + +{:else} + + + + +{/if} + + \ No newline at end of file diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index e85ffce..f95bcb2 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -1,33 +1,64 @@
-

Products

-
- {#await recipes_p} - waiting... - {:then data} - {#each data.data.recipes as recipe (recipe.id)} - - + {:then data} +
+ {#each recipes_list as recipe} + +
+ {recipe.title} +
+

{recipe.ctime} / {recipe.cal}

+

{recipe.title}

+
+ {/each} +
+ + {/await}
\ No newline at end of file diff --git a/src/routes/Header.svelte b/src/routes/Header.svelte index 1855a90..165a013 100644 --- a/src/routes/Header.svelte +++ b/src/routes/Header.svelte @@ -1,6 +1,12 @@ - +
-
+ {/if} \ No newline at end of file diff --git a/src/routes/categories/+page.svelte b/src/routes/categories/+page.svelte index eb10fe5..81ec279 100644 --- a/src/routes/categories/+page.svelte +++ b/src/routes/categories/+page.svelte @@ -1,17 +1,54 @@

Products

-
+
{#each category_list as category} - -
- {category} -

{category}

+
+
+ {category.title} +

{category.title}

{/each} @@ -24,4 +61,22 @@ --tw-brightness: brightness(.3); filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow); } + + @font-face { + font-family: 'RobotoRegular'; + font-style: normal; + font-weight: 400; + src: url('/fonts/Roboto-Regular.ttf'); + } + + @font-face { + font-family: 'AlegreyaSansSC'; + font-style: normal; + font-weight: 800; + src: url('/fonts/Alegreyasansscextrabold.ttf'); + } + + #category { + font-size: 3dvh; + } \ No newline at end of file diff --git a/src/routes/categories/[category]/+page.svelte b/src/routes/categories/[category]/+page.svelte index d548326..117978f 100644 --- a/src/routes/categories/[category]/+page.svelte +++ b/src/routes/categories/[category]/+page.svelte @@ -1,9 +1,50 @@
- hello, {$page.params.category} +
+

Категории

+ {#await recipes} +
+
+ + Loading... +
+
+ {:then data} +
+ {#each data.data.recipes as recipe (recipe.id)} + +
+ {recipe.title} +
+

{recipe.ctime} / {recipe.cal}

+

{recipe.title}

+
+ {/each} +
+ {:catch} + Ошибка + {/await} +
\ No newline at end of file diff --git a/src/routes/recipe/[recipeid]/+page.svelte b/src/routes/recipe/[recipeid]/+page.svelte index b8ef7d0..386a040 100644 --- a/src/routes/recipe/[recipeid]/+page.svelte +++ b/src/routes/recipe/[recipeid]/+page.svelte @@ -3,7 +3,7 @@ import axios from 'axios'; // create request - let serverurl = 'http://127.0.0.1:3000'; + let serverurl = 'http://192.168.0.105:3000'; let recipe_p = axios.get(serverurl+"/recipe?r_id="+$page.params.recipeid) recipe_p.then(function (response) { console.log(response);