diff --git a/src/components/Card.svelte b/src/components/Card.svelte index b621e75..bd40ee5 100644 --- a/src/components/Card.svelte +++ b/src/components/Card.svelte @@ -31,20 +31,20 @@ const centerX = boundingRect.left + boundingRect.width / 2; const centerY = boundingRect.top + boundingRect.height / 2; - const rotateX = (centerY - y) / 10; - const rotateY = -(centerX - x) / 10; + const rotateX = (centerY - y) / 20; + const rotateY = -(centerX - x) / 20; - cardElement.style.setProperty('--tw-rotate-x', `${rotateX}deg`); - cardElement.style.setProperty('--tw-rotate-y', `${rotateY}deg`); + cardElement.style.setProperty('--rotate-x', `${rotateX}deg`); + cardElement.style.setProperty('--rotate-y', `${rotateY}deg`); } function resetElement() { - cardElement.style.setProperty('--tw-rotate-x', "0"); - cardElement.style.setProperty('--tw-rotate-y', "0"); + cardElement.style.setProperty('--rotate-x', "0"); + 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 scale-100 transition-transform duration-300 ease-in-out hover:scale-105 dark:bg-zinc-900 dark:border-gray-800 dark:text-gray-100", extraClasses) + $: 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)