randomize order of recipes based on day

This commit is contained in:
2023-07-10 13:00:11 +02:00
parent 51289117cf
commit 71d5dd14df
10 changed files with 41 additions and 77 deletions

View File

@ -5,13 +5,14 @@
export let data: PageData;
export let current_month = new Date().getMonth() + 1;
import Card from '$lib/components/Card.svelte'
import { rand_array } from '$lib/js/randomize';
</script>
<h1>Rezepte</h1>
<h2>In Kategorie {data.category}</h2>
<Search></Search>
<section>
<Recipes>
{#each data.recipes as recipe}
{#each rand_array(data.recipes) as recipe}
<Card {recipe} {current_month}></Card>
{/each}
</Recipes>