Updated to work with live site Added components from somewhere fixed some css background image
This commit is contained in:
parent
faf1fb29b8
commit
a046f7c3f2
16 changed files with 885 additions and 4 deletions
36
src/components/Link.svelte
Normal file
36
src/components/Link.svelte
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
<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>
|
||||
Loading…
Reference in a new issue