Ben Parsons 94c60f2251 Updated to work with live site
Added components from somewhere
fixed some css background image
2020-08-20 19:56:24 +10:00

37 lines
840 B
Svelte

<script>
import {getContext} from 'svelte';
import {writable} from 'svelte/store';
const navigate = getContext('navigate');
const navaid = getContext('navaid');
const base = navaid && navaid.base || writable('/');
const library = navaid && navaid.library || writable(null);
let props;
let href;
export let append;
$: {
props = {...$$props};
href = props.href;
delete props.href;
href = ($library && $library.prefix ? $library.prefix : '') + (!append ? $base : '') + href.replace(/^\//, '');
}
const click = () => {
navigate(href);
}
</script>
<style>
span {
text-decoration: none;
padding: 1rem 0.5rem;
display: block;
color: #005de6;
}
</style>
<span {...props} on:click={click}><slot></slot></span>