feat: add new site
This commit is contained in:
parent
53738961bb
commit
532a32db68
27 changed files with 1198 additions and 1328 deletions
40
src/components/Link.svelte
Normal file
40
src/components/Link.svelte
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
<script lang="ts">
|
||||
import { mdiLinkVariant } from '@mdi/js';
|
||||
import { mdiChevronRight } from '@mdi/js';
|
||||
import Icon from 'mdi-svelte';
|
||||
export let href: string;
|
||||
export let disableIcon = false;
|
||||
// svelte-ignore unused-export-let
|
||||
export let rel = '';
|
||||
|
||||
const internal = !href.startsWith('http');
|
||||
let spin = false;
|
||||
</script>
|
||||
|
||||
<a
|
||||
rel={!internal ? 'nofollow noreferrer noopener' : ''}
|
||||
target={!internal ? '_blank' : ''}
|
||||
{href}
|
||||
on:mouseover={() => (spin = true)}
|
||||
on:focus={() => (spin = true)}
|
||||
on:mouseleave={() => (spin = false)}
|
||||
>
|
||||
{#if !disableIcon}
|
||||
<Icon path={internal ? mdiChevronRight : mdiLinkVariant} size="1rem" {spin} />
|
||||
{/if}
|
||||
<span class="text"><slot /></span>
|
||||
</a>
|
||||
|
||||
<style>
|
||||
a {
|
||||
color: var(--special-color);
|
||||
text-decoration: none;
|
||||
font-weight: 550;
|
||||
}
|
||||
a:hover {
|
||||
color: var(--dark-color);
|
||||
}
|
||||
.text {
|
||||
text-decoration: underline;
|
||||
}
|
||||
</style>
|
||||
Loading…
Add table
Add a link
Reference in a new issue