2020-08-13 09:58:48 +02:00
|
|
|
<script>
|
2020-11-18 22:06:12 +01:00
|
|
|
import { getContext } from "svelte"
|
2020-08-13 09:58:48 +02:00
|
|
|
|
2021-05-06 18:21:29 +02:00
|
|
|
const { styleable, linkable } = getContext("sdk")
|
2020-11-24 12:02:10 +01:00
|
|
|
const component = getContext("component")
|
2020-11-18 22:06:12 +01:00
|
|
|
|
2020-08-13 11:54:43 +02:00
|
|
|
export const className = ""
|
2020-08-13 09:58:48 +02:00
|
|
|
export let imageUrl = ""
|
|
|
|
export let heading = ""
|
|
|
|
export let description = ""
|
|
|
|
export let subtext = ""
|
|
|
|
export let linkText = ""
|
|
|
|
export let linkUrl
|
2020-12-09 13:21:04 +01:00
|
|
|
export let linkColor
|
2020-08-13 09:58:48 +02:00
|
|
|
export let linkHoverColor
|
|
|
|
export let cardWidth
|
|
|
|
export let imageWidth
|
|
|
|
export let imageHeight
|
|
|
|
|
|
|
|
$: showImage = !!imageUrl
|
|
|
|
</script>
|
|
|
|
|
2020-11-24 12:02:10 +01:00
|
|
|
<div
|
2020-12-09 15:12:10 +01:00
|
|
|
use:styleable={$component.styles}
|
2020-12-09 15:27:24 +01:00
|
|
|
class="container"
|
2021-05-04 12:04:42 +02:00
|
|
|
style="--cardWidth: {cardWidth}"
|
|
|
|
>
|
2020-12-10 12:11:53 +01:00
|
|
|
{#if showImage}
|
|
|
|
<img
|
|
|
|
style="--imageWidth: {imageWidth}; --imageHeight: {imageHeight}"
|
|
|
|
class="image"
|
|
|
|
src={imageUrl}
|
2021-05-04 12:04:42 +02:00
|
|
|
alt=""
|
|
|
|
/>
|
2020-12-10 12:11:53 +01:00
|
|
|
{/if}
|
2020-08-13 09:58:48 +02:00
|
|
|
<div class="content">
|
|
|
|
<main>
|
|
|
|
<h2 class="heading">{heading}</h2>
|
|
|
|
<p class="text">{description}</p>
|
|
|
|
</main>
|
2020-12-10 12:11:53 +01:00
|
|
|
<footer>
|
2020-08-13 09:58:48 +02:00
|
|
|
<p class="subtext">{subtext}</p>
|
2020-12-10 12:11:53 +01:00
|
|
|
<a
|
2021-05-06 18:21:29 +02:00
|
|
|
use:linkable
|
2020-12-10 12:11:53 +01:00
|
|
|
style="--linkColor: {linkColor}; --linkHoverColor: {linkHoverColor}"
|
2021-05-04 12:04:42 +02:00
|
|
|
href={linkUrl || "/"}>{linkText}</a
|
|
|
|
>
|
2020-08-13 09:58:48 +02:00
|
|
|
</footer>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<style>
|
|
|
|
.container {
|
|
|
|
height: 100%;
|
|
|
|
max-width: var(--cardWidth);
|
|
|
|
display: flex !important;
|
|
|
|
text-align: left;
|
|
|
|
}
|
|
|
|
|
|
|
|
.image {
|
|
|
|
width: var(--imageWidth);
|
|
|
|
height: var(--imageHeight);
|
|
|
|
vertical-align: middle;
|
|
|
|
}
|
|
|
|
|
|
|
|
.content {
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
justify-content: space-between;
|
|
|
|
width: 100%;
|
|
|
|
padding: 0.85rem 1.5rem;
|
|
|
|
}
|
|
|
|
|
|
|
|
.heading {
|
|
|
|
font-size: 1rem;
|
|
|
|
font-weight: 700;
|
|
|
|
margin: 0;
|
2021-02-23 11:15:16 +01:00
|
|
|
white-space: pre-wrap;
|
2020-08-13 09:58:48 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
.text {
|
|
|
|
font-size: 0.85rem;
|
|
|
|
margin: 0.5rem 0 0 0;
|
|
|
|
font-weight: 400;
|
|
|
|
line-height: 1.25rem;
|
2021-02-23 11:15:16 +01:00
|
|
|
white-space: pre-wrap;
|
2020-08-13 09:58:48 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
footer {
|
|
|
|
display: flex;
|
|
|
|
justify-content: space-between;
|
|
|
|
align-items: baseline;
|
|
|
|
}
|
|
|
|
|
|
|
|
.subtext {
|
|
|
|
font-size: 0.85rem;
|
|
|
|
margin: 0;
|
|
|
|
font-weight: 400;
|
2020-08-13 11:45:25 +02:00
|
|
|
color: #757575;
|
2021-02-23 11:15:16 +01:00
|
|
|
white-space: pre-wrap;
|
2020-08-13 09:58:48 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
a {
|
|
|
|
margin: 0.5rem 0 0 0;
|
|
|
|
text-decoration: none;
|
2020-12-09 13:21:04 +01:00
|
|
|
color: var(--linkColor);
|
2020-08-13 09:58:48 +02:00
|
|
|
font-weight: 600;
|
|
|
|
font-size: 0.85rem;
|
2021-02-23 11:15:16 +01:00
|
|
|
white-space: pre-wrap;
|
2020-08-13 09:58:48 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
a:hover {
|
|
|
|
color: var(--linkHoverColor);
|
|
|
|
}
|
|
|
|
</style>
|