parent
f167f937ec
commit
5c9fb2517a
@ -1,42 +1,25 @@
|
||||
<script>
|
||||
export let color = "bg-gradient-to-br from-gray-200 to-gray-400 dark:bg-gradient-to-br dark:from-gray-500 dark:to-gray-700";
|
||||
export let rotation = "";
|
||||
export let buttonText;
|
||||
export let buttonRedirect = "";
|
||||
export let buttonHref;
|
||||
let skew;
|
||||
</script>
|
||||
|
||||
switch (rotation) {
|
||||
case "left":
|
||||
skew = "skew-x-1 lg:skew-x-6";
|
||||
break;
|
||||
<div class="z-10 flex flex-col group">
|
||||
<span class="h-4 group-hover:-translate-y-1 bg-blue-600 rounded-t-xl duration-300"></span>
|
||||
|
||||
case "right":
|
||||
skew = "-skew-x-1 lg:-skew-x-6";
|
||||
break;
|
||||
}
|
||||
</script>
|
||||
<div class="flex-grow flex flex-col gap-2 w-full relative p-10 group-hover:-translate-y-1 duration-300 bg-gradient-to-br from-gray-200 to-gray-300 dark:from-gray-800 dark:to-gray-700">
|
||||
<slot />
|
||||
</div>
|
||||
|
||||
<div class="flex flex-col gap-2 w-full relative py-8 px-8 lg:px-12 lg:py-10 group hover:-translate-y-1 duration-300">
|
||||
<div
|
||||
class="{skew} {color} absolute inset-0 z-0 w-full shadow-lg rounded-xl flex flex-col justify-end group-hover:shadow-xl duration-300"
|
||||
>
|
||||
{#if buttonText != null && buttonHref != null}
|
||||
<a
|
||||
href={buttonHref}
|
||||
target={buttonRedirect}
|
||||
class="rounded-b-xl bg-white bg-opacity-50 p-5 hover:bg-opacity-100 duration-150 text-base lg:text-lg font-bold dark:text-black z-40"
|
||||
class="rounded-b-xl bg-white dark:bg-gray-900 bg-opacity-50 p-5 group-hover:-translate-y-1 hover:bg-opacity-100 dark:hover:bg-blue-600 hover:bg-blue-200 duration-300 text-base lg:text-lg font-bold z-40"
|
||||
>
|
||||
<span class="p-5 z-10">{buttonText}</span>
|
||||
<span class="px-5">{buttonText}</span>
|
||||
</a>
|
||||
{:else}
|
||||
<span class="h-10 bg-opacity-50 group-hover:-translate-y-1 bg-white dark:bg-gray-900 rounded-b-xl duration-300"></span>
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
<div class="z-10 flex flex-col gap-5 flex-grow">
|
||||
<slot />
|
||||
|
||||
{#if buttonText != null && buttonHref != null}
|
||||
<span class="h-16 lg:h-10" />
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
Loading…
Reference in new issue