45 lines
868 B
Svelte
45 lines
868 B
Svelte
<script lang="ts">
|
|
import type { BrandConfig } from '$lib/config';
|
|
|
|
export let brand: BrandConfig = {};
|
|
export let color = 'var(--text)';
|
|
|
|
function masked() {
|
|
return brand.logo != undefined && brand.asmask == true;
|
|
}
|
|
</script>
|
|
|
|
<div style="--mask: url({brand.logo || ''}); --mask-color: {color}" class:masked={masked()}>
|
|
{#if brand.logo}
|
|
{#if brand.asmask != true}
|
|
<img src={brand.logo} alt="logo" />
|
|
{/if}
|
|
{:else if brand.icon}
|
|
<i class={brand.icon} />
|
|
{/if}
|
|
</div>
|
|
|
|
<style>
|
|
div {
|
|
height: 100%;
|
|
width: 100%;
|
|
color: var(--mask-color);
|
|
display: flex;
|
|
justify-content: center;
|
|
align-items: center;
|
|
}
|
|
|
|
img {
|
|
max-width: 100%;
|
|
max-height: 100%;
|
|
}
|
|
|
|
.masked {
|
|
background: var(--mask-color);
|
|
mask: var(--mask) center no-repeat;
|
|
mask-size: 100%;
|
|
-webkit-mask: var(--mask) center no-repeat;
|
|
-webkit-mask-size: 100%;
|
|
}
|
|
</style>
|