Files
IoTManagerWeb/src/components/Card.svelte

38 lines
884 B
Svelte
Raw Normal View History

2021-09-16 02:00:52 +08:00
<script>
2022-02-10 17:39:50 +01:00
import CloudIcon from "../svg/Cloud.svelte";
2021-09-16 02:00:52 +08:00
export let title;
2022-02-10 17:39:50 +01:00
export let cloud = false;
export let cloudColor;
2021-09-16 02:00:52 +08:00
</script>
2021-12-28 23:55:14 +01:00
<div class="crd">
2022-02-10 17:39:50 +01:00
{#if title && !cloud}
2021-12-28 23:55:14 +01:00
<h1 class="crd-hdr">{title}</h1>
2022-02-10 17:39:50 +01:00
{:else if title && cloud}
<div class="flex items-center">
<div class="w-11/12">
<h1 class="crd-hdr">{title}</h1>
</div>
<div class="flex justify-end w-1/12">
<CloudIcon color={cloudColor} />
</div>
</div>
2021-12-28 01:06:01 +01:00
{/if}
2021-09-17 23:18:06 +08:00
<slot />
2021-09-16 02:00:52 +08:00
</div>
2022-02-06 18:19:38 +01:00
<style lang="postcss" global>
@tailwind base;
@tailwind components;
@tailwind utilities;
@layer components {
.crd {
2022-02-07 23:40:00 +01:00
@apply w-full mb-2 p-2 sm:p-2 md:p-2 lg:p-2 xl:px-8 xl:py-4 2xl:px-8 2xl:py-4 bg-white shadow-md lg:shadow-lg border border-gray-200 rounded-lg;
2022-02-06 18:19:38 +01:00
}
.crd-hdr {
@apply text-center text-lg text-gray-500 font-bold pb-4;
}
}
</style>