31 lines
611 B
Svelte
31 lines
611 B
Svelte
<script lang="ts">
|
|
import { asset } from '$app/paths';
|
|
|
|
let {
|
|
pattern = 'none',
|
|
color = '#000000',
|
|
opacity = 0.1
|
|
}: {
|
|
pattern?: string;
|
|
color?: string;
|
|
opacity?: number;
|
|
} = $props();
|
|
|
|
const patternPath = $derived(asset(`/themes/${pattern}/item.svg`));
|
|
</script>
|
|
|
|
{#if pattern !== 'none'}
|
|
<div
|
|
class="absolute bottom-0 top-0 right-0 pointer-events-none overflow-hidden rounded-b-lg"
|
|
style="
|
|
mask-image: url({patternPath});
|
|
mask-size: cover;
|
|
mask-repeat: no-repeat;
|
|
mask-position: right bottom;
|
|
background-color: {color};
|
|
opacity: {opacity};
|
|
width: 100%;
|
|
"
|
|
/>
|
|
{/if}
|