mirror of https://github.com/Budibase/budibase.git
9 changed files with 449 additions and 15 deletions
@ -0,0 +1,80 @@ |
|||||
|
<script> |
||||
|
import { cssVars, createClasses } from "./cssVars" |
||||
|
|
||||
|
export let className = "" |
||||
|
export let imageUrl = "" |
||||
|
export let heading = "" |
||||
|
export let description = "" |
||||
|
export let linkText = "" |
||||
|
export let linkUrl |
||||
|
export let color |
||||
|
export let linkHoverColor |
||||
|
export let imageHeight |
||||
|
export let cardWidth |
||||
|
|
||||
|
$: cssVariables = { |
||||
|
color, |
||||
|
linkHoverColor, |
||||
|
imageHeight, |
||||
|
cardWidth, |
||||
|
} |
||||
|
|
||||
|
$: showImage = !!imageUrl |
||||
|
</script> |
||||
|
|
||||
|
<div use:cssVars={cssVariables} class="container"> |
||||
|
{#if showImage} |
||||
|
<img class="image" src={imageUrl} alt="" /> |
||||
|
{/if} |
||||
|
<div class="content"> |
||||
|
<h2 class="heading">{heading}</h2> |
||||
|
<h4 class="text">{description}</h4> |
||||
|
<a href={linkUrl}>{linkText}</a> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
<style> |
||||
|
.container { |
||||
|
width: var(--cardWidth); |
||||
|
overflow: hidden !important; |
||||
|
height: auto; |
||||
|
} |
||||
|
|
||||
|
.image { |
||||
|
width: 100% !important; |
||||
|
max-width: 100%; |
||||
|
height: var(--imageHeight); |
||||
|
vertical-align: middle; |
||||
|
} |
||||
|
|
||||
|
.content { |
||||
|
padding: 1.5rem; |
||||
|
display: flex; |
||||
|
flex-direction: column; |
||||
|
gap: 1rem; |
||||
|
} |
||||
|
|
||||
|
.heading { |
||||
|
font-size: 1.25rem; |
||||
|
font-weight: 700; |
||||
|
margin: 0; |
||||
|
} |
||||
|
|
||||
|
.text { |
||||
|
font-size: 1rem; |
||||
|
margin: 0; |
||||
|
font-weight: 400; |
||||
|
line-height: 1.5rem; |
||||
|
} |
||||
|
|
||||
|
a { |
||||
|
margin: 0.5rem 0; |
||||
|
text-decoration: none; |
||||
|
color: var(--color); |
||||
|
font-weight: 600; |
||||
|
} |
||||
|
|
||||
|
a:hover { |
||||
|
color: var(--linkHoverColor); |
||||
|
} |
||||
|
</style> |
||||
@ -0,0 +1,104 @@ |
|||||
|
<script> |
||||
|
import { cssVars, createClasses } from "./cssVars" |
||||
|
|
||||
|
export let className = "" |
||||
|
export let imageUrl = "" |
||||
|
export let heading = "" |
||||
|
export let description = "" |
||||
|
export let subtext = "" |
||||
|
export let linkText = "" |
||||
|
export let linkUrl |
||||
|
export let color |
||||
|
export let linkHoverColor |
||||
|
export let cardWidth |
||||
|
export let imageWidth |
||||
|
export let imageHeight |
||||
|
|
||||
|
$: cssVariables = { |
||||
|
color, |
||||
|
linkHoverColor, |
||||
|
imageWidth, |
||||
|
cardWidth, |
||||
|
imageHeight, |
||||
|
} |
||||
|
|
||||
|
$: showImage = !!imageUrl |
||||
|
</script> |
||||
|
|
||||
|
<div use:cssVars={cssVariables} class="container"> |
||||
|
{#if showImage} |
||||
|
<img class="image" src={imageUrl} alt="" /> |
||||
|
{/if} |
||||
|
<div class="content"> |
||||
|
<main> |
||||
|
<h2 class="heading">{heading}</h2> |
||||
|
<p class="text">{description}</p> |
||||
|
</main> |
||||
|
<footer> |
||||
|
<p class="subtext">{subtext}</p> |
||||
|
<a href={linkUrl}>{linkText}</a> |
||||
|
</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; |
||||
|
} |
||||
|
|
||||
|
.text { |
||||
|
font-size: 0.85rem; |
||||
|
margin: 0.5rem 0 0 0; |
||||
|
font-weight: 400; |
||||
|
line-height: 1.25rem; |
||||
|
} |
||||
|
|
||||
|
footer { |
||||
|
display: flex; |
||||
|
justify-content: space-between; |
||||
|
align-items: baseline; |
||||
|
} |
||||
|
|
||||
|
.subtext { |
||||
|
font-size: 0.85rem; |
||||
|
margin: 0; |
||||
|
font-weight: 400; |
||||
|
color: #757575; |
||||
|
} |
||||
|
|
||||
|
a { |
||||
|
margin: 0.5rem 0 0 0; |
||||
|
text-decoration: none; |
||||
|
color: var(--color); |
||||
|
font-weight: 600; |
||||
|
font-size: 0.85rem; |
||||
|
margin: 0; |
||||
|
} |
||||
|
|
||||
|
a:hover { |
||||
|
color: var(--linkHoverColor); |
||||
|
} |
||||
|
</style> |
||||
Loading…
Reference in new issue