diff --git a/src/components/Card.svelte b/src/components/Card.svelte index ce25512..1d5208b 100644 --- a/src/components/Card.svelte +++ b/src/components/Card.svelte @@ -21,8 +21,7 @@ import {twMerge} from "tailwind-merge"; import {onMount} from "svelte"; - let cardElement: HTMLDivElement; - export let hoverEffect: boolean = true; + let cardElement: HTMLDivElement = $state(); function rotateElement(event: MouseEvent) { if(!hoverEffect) return; @@ -46,12 +45,18 @@ cardElement.style.setProperty('--rotate-y', "0"); } - export let extraClasses: string = ''; - $: classes = twMerge("w-72 border-2 bg-zinc-50 border-gray-100 flex flex-col items-center p-8 m-4 rounded-xl shadow-lg dark:bg-zinc-900 dark:border-gray-800 dark:text-gray-100", extraClasses) + interface Props { + hoverEffect?: boolean; + extraClasses?: string; + children?: import('svelte').Snippet; + } + + let { hoverEffect = true, extraClasses = '', children }: Props = $props(); + let classes = $derived(twMerge("w-72 border-2 bg-zinc-50 border-gray-100 flex flex-col items-center p-8 m-4 rounded-xl shadow-lg dark:bg-zinc-900 dark:border-gray-800 dark:text-gray-100", extraClasses)) -