forked from quoid/userscripts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLoader.svelte
More file actions
44 lines (39 loc) · 1.04 KB
/
Copy pathLoader.svelte
File metadata and controls
44 lines (39 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<script>
import {fade} from "svelte/transition";
import iconLoader from "../../shared/img/icon-loader.svg";
export let abort = false;
export let abortClick = () => {};
export let backgroundColor = "var(--color-bg-secondary)";
</script>
<div class="loader" style="background-color: {backgroundColor};" out:fade="{{duration: 125}}">
{@html iconLoader}
{#if abort}
<div>
Fetching resources, <span class="link" on:click={abortClick}>cancel request</span>
</div>
{/if}
</div>
<style>
.loader {
align-items: center;
bottom: 0;
display: flex;
flex-direction: column;
justify-content: center;
left: 0;
position: absolute;
right: 0;
top: 0;
z-index: 90;
}
.loader :global(svg) {
height: 2rem;
width: 2rem;
}
.loader div {
color: var(--text-color-disabled);
font: var(--text-small);
letter-spacing: var(--letter-spacing-small);
margin-top: 1rem;
}
</style>