2022-07-08 15:17:17 +00:00
|
|
|
<script>
|
|
|
|
export let title;
|
|
|
|
export let subtitle;
|
2022-07-11 09:32:28 +00:00
|
|
|
export let color;
|
2022-07-11 11:15:39 +00:00
|
|
|
export let date;
|
2022-07-08 15:17:17 +00:00
|
|
|
</script>
|
|
|
|
|
2022-07-11 09:32:28 +00:00
|
|
|
<div class="tile {color}">
|
2022-07-11 11:15:39 +00:00
|
|
|
{#if title || subtitle || date}
|
2022-07-11 09:20:44 +00:00
|
|
|
<div class="desc">
|
2022-07-11 11:15:39 +00:00
|
|
|
<div>
|
|
|
|
{#if title}
|
|
|
|
<div class="title">{title}</div>
|
|
|
|
{/if}
|
|
|
|
|
|
|
|
{#if subtitle}
|
|
|
|
<div class="subtitle">{subtitle}</div>
|
|
|
|
{/if}
|
|
|
|
</div>
|
2022-07-08 15:17:17 +00:00
|
|
|
|
2022-07-11 11:15:39 +00:00
|
|
|
{#if date}
|
|
|
|
<div class="time">{date.toLocaleTimeString('en-GB', {
|
|
|
|
timeStyle: 'short',
|
|
|
|
})}</div>
|
2022-07-11 09:20:44 +00:00
|
|
|
{/if}
|
|
|
|
</div>
|
2022-07-08 15:17:17 +00:00
|
|
|
{/if}
|
2022-07-11 09:20:44 +00:00
|
|
|
|
2022-07-11 11:15:39 +00:00
|
|
|
<div class="content"><slot /></div>
|
2022-07-08 15:17:17 +00:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<style>
|
|
|
|
.tile {
|
|
|
|
padding: 1rem;
|
2022-07-09 09:12:39 +00:00
|
|
|
background-color: var(--tile-bg);
|
2022-07-08 15:17:17 +00:00
|
|
|
border-radius: var(--radius);
|
2022-07-11 09:32:28 +00:00
|
|
|
border: 2px solid var(--tile-bg);
|
|
|
|
}
|
|
|
|
|
|
|
|
.tile.red {
|
|
|
|
background-color: var(--red);
|
|
|
|
border-color: var(--red);
|
|
|
|
color: #fff;
|
|
|
|
}
|
|
|
|
|
|
|
|
.tile.green {
|
|
|
|
border-color: var(--green);
|
2022-07-11 13:07:47 +00:00
|
|
|
background-color: var(--green);
|
2022-07-11 09:32:28 +00:00
|
|
|
}
|
|
|
|
|
2022-07-11 11:17:26 +00:00
|
|
|
.tile.grey {
|
|
|
|
opacity: 0.5;
|
2022-07-11 11:20:42 +00:00
|
|
|
border-color: var(--grey);
|
2022-07-11 11:17:26 +00:00
|
|
|
}
|
|
|
|
|
2022-07-11 11:15:39 +00:00
|
|
|
.tile.grey .content {
|
|
|
|
color: var(--grey);
|
|
|
|
}
|
|
|
|
|
2022-07-11 09:32:28 +00:00
|
|
|
.desc {
|
|
|
|
font-size: 1.3rem;
|
|
|
|
margin-bottom: 1rem;
|
2022-07-11 11:15:39 +00:00
|
|
|
display: flex;
|
2022-07-08 15:17:17 +00:00
|
|
|
}
|
|
|
|
|
2022-07-11 09:32:28 +00:00
|
|
|
.desc .title {
|
2022-07-11 13:09:37 +00:00
|
|
|
font-weight: 300;
|
2022-07-08 15:17:17 +00:00
|
|
|
}
|
|
|
|
|
2022-07-11 09:32:28 +00:00
|
|
|
.desc .subtitle {
|
2022-07-11 09:20:44 +00:00
|
|
|
font-weight: 100;
|
2022-07-08 15:17:17 +00:00
|
|
|
}
|
2022-07-11 11:15:39 +00:00
|
|
|
|
|
|
|
.desc .time {
|
|
|
|
opacity: 0.6;
|
|
|
|
margin-left: auto;
|
|
|
|
}
|
2022-07-08 15:17:17 +00:00
|
|
|
</style>
|