Square Menu component
This commit is contained in:
pare
094eefbd42
commit
475e6217ed
S'han modificat 1 arxius amb 12 adicions i 0 eliminacions
12
src/lib/sqmenu.svelte
Normal file
12
src/lib/sqmenu.svelte
Normal file
|
@ -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>
|
Loading…
Referencia en una nova incidència