dynamic promo widget

This commit is contained in:
SPRINX0\prochazka
2025-10-17 14:04:08 +02:00
parent a98c953876
commit 1fa4216b18
7 changed files with 146 additions and 48 deletions

View File

@@ -0,0 +1,21 @@
<script lang="ts">
import FormStyledButton from '../buttons/FormStyledButton.svelte';
import { openWebLink } from '../utility/simpleTools';
export let text: string;
export let link: string;
export let newTab: boolean = true;
// very light url guard
const safe = /^(https?:)?\/\//i.test(link) || link.startsWith('/');
</script>
<div class="center">
<FormStyledButton on:click={() => openWebLink(link)} value={text} skipWidth />
</div>
<style>
.center {
text-align: center;
}
</style>