chore: routing

This commit is contained in:
Ax333l
2023-02-03 17:50:41 +01:00
parent 5a376cd5b0
commit a34ec3a750
20 changed files with 14 additions and 18 deletions

View File

@@ -4,6 +4,7 @@
export let href = '';
export let maxWidth = false;
export let icon = '';
export let alt = '';
export let target = '';
export let unclickable = false;
</script>
@@ -11,7 +12,7 @@
<a {href} {target} on:click class:unclickable>
<div class={type} style="width: {maxWidth ? '100%' : 'max-content'}">
{#if icon}
<img src="../icons/{icon}.svg" alt={icon} />
<img src={icon} {alt} />
{/if}
<slot />
</div>

View File

@@ -3,6 +3,9 @@
import Modal from './Dialogue.svelte';
import Button from './Button.svelte';
import next from '$lib/assets/icons/next.svg';
import previous from '$lib/assets/icons/previous.svg';
export let name = '';
export let selected: Array<string>;
export let variants;
@@ -109,14 +112,16 @@
on:click={prevVariant}
on:click={stopAutoScroll}
unclickable={i <= 0}
icon="previous"
icon={previous}
alt="previous"
/>
<h4>{i + 1}/{variants.length}</h4>
<Button
on:click={nextVariant}
on:click={stopAutoScroll}
unclickable={i + 1 >= variants.length}
icon="next"
icon={next}
alt="next"
/>
</div>
{/if}