Square Menu component

This commit is contained in:
Pau Figueras 2023-07-27 01:58:32 +02:00
pare 094eefbd42
commit 475e6217ed

12
src/lib/sqmenu.svelte Normal file
Veure arxiu

@ -0,0 +1,12 @@
<script lang="ts">
import { Card } from "flowbite-svelte";
export let menudata: {menuName: string, menuLink: string}[] = [];
$: colNum = Math.floor(menudata.length / 2) < 3 ? Math.floor(menudata.length / 2) : 3;
</script>
<div class="w-[60%] grid gap-y-8 grid-cols-{colNum} text-center mx-auto py-5 sm:grid-cols-1 justify-content-center">
{#each menudata as menu}
<Card href='{menu.menuLink}' class='lg:px-16 lg:py-8 md:px-12 md:py-6 dark:hover:bg-zinc-900 dark:bg-transparent bg-transparent min-w-[50%]'>
<h2 class='text-xl'>{menu.menuName}</h2>
</Card>
{/each}
</div>