Files
online-energieausweis/src/components/design/content/WidgetCardTemplate_ORG.svelte
Robert Jagtiani 4678d41cc5 widget
2025-02-05 16:33:06 +01:00

100 lines
2.2 KiB
Svelte

<script lang="ts">
export let price: number;
export let name: string;
export let variant: string;
export let services: [string, boolean][];
export let href: string;
export let src: string;
export let alt: string;
export let empfehlung: string;
</script>
<h2 class="titel">{name}</h2>
{#if empfehlung=="ja"}
<!--<div class="empfehlung">Empfehlung</div>-->
{/if}
<div class="titelPic grid grid-cols-2 items-center mb-0 mt-0 w-full">
<div style="">
<img
{src}
{alt}
/>
</div>
<div class="justify-self-start">
<p class="tracking-tighter text-[1.75rem] text-gray-700 pl-3">
<span class="[font-family:Antique_Olive_Compact_bold]">
ab {price}
</span>
</p>
</div>
</div>
<div class="variante justify-self-end">{variant}</div>
<div class="white grid grid-rows-subgrid row-span-6 relative">
{#each services as [service, check]}
<div class="services grid grid-cols-[content-fit_1fr] items-center">
<span>{@html service}</span>
<div class:check={check} class:check-no={!check}>{check ? "✔" : "✘"}</div>
</div>
{/each}
</div>
<div class="w-full grid grid-cols-2 gap-2">
<a
{href}
class="w-full justify-self-center text-center text-white bg-secondary rounded-md px-3 py-1 mt-2 no-underline
hover:bg-primary
">jetzt online erstellen</a
>
<a
{href}
class="w-full justify-self-center text-center text-secondary ring-1 ring-secondary/50 bg-white rounded-md px-3 py-1 mt-2 no-underline
hover:bg-secondary/15
">zur Produktübersicht</a
>
</div>
<style lang="postcss">
.titel {@apply [font-size:_clamp(14px,1.5vw,18px)]
pr-12 text-left
}
.empfehlung{@apply bg-red-700 text-[0.75rem] text-white px-2 py-1 rounded-sm rotate-[5deg]}
.variante {
@apply -mt-2 text-xl w-fit text-black justify-self-end;
}
.services {
@apply text-start py-1 grid grid-cols-[1fr_minmax(10px,50px)];
}
.services:not(:last-child) {
@apply border-b-[1px] border-gray-200;
}
.check {
@apply justify-self-end font-bold text-green-700;
}
.check-no {
@apply justify-self-end font-bold text-red-700;
}
</style>