svelteplot 0.7.0-pr-276.0 → 0.7.0-pr-276.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,14 +1,28 @@
|
|
|
1
1
|
<script>
|
|
2
2
|
import { resolve } from '$app/paths';
|
|
3
|
+
import { useDark } from './isDark.svelte';
|
|
3
4
|
let { examples } = $props();
|
|
5
|
+
|
|
6
|
+
const exampleImages = import.meta.glob('../../snapshots/*/*.png', {
|
|
7
|
+
eager: true,
|
|
8
|
+
query: {
|
|
9
|
+
enhanced: true,
|
|
10
|
+
w: 640
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
const ds = useDark();
|
|
4
15
|
</script>
|
|
5
16
|
|
|
6
17
|
<div class="list">
|
|
7
18
|
{#each examples as page, i (i)}
|
|
8
19
|
<a href={resolve(page.url)}>
|
|
9
20
|
<div>
|
|
10
|
-
|
|
11
|
-
|
|
21
|
+
<enhanced:img
|
|
22
|
+
src={ds.isDark
|
|
23
|
+
? exampleImages[`../../snapshots/${page.key}.dark.png`].default.img.src
|
|
24
|
+
: exampleImages[`../../snapshots/${page.key}.png`].default.img.src}
|
|
25
|
+
alt={page.title} />
|
|
12
26
|
</div>
|
|
13
27
|
<h4>
|
|
14
28
|
{page.title}
|
|
@@ -49,7 +63,7 @@
|
|
|
49
63
|
}
|
|
50
64
|
}
|
|
51
65
|
|
|
52
|
-
.list img {
|
|
66
|
+
.list :global(img) {
|
|
53
67
|
width: 100%;
|
|
54
68
|
box-sizing: border-box;
|
|
55
69
|
border-radius: 3px;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { resolve } from '$app/paths';
|
|
3
|
+
import { useDark } from './isDark.svelte';
|
|
3
4
|
|
|
4
|
-
const exampleImages = import.meta.glob('
|
|
5
|
+
const exampleImages = import.meta.glob('../../snapshots/*/*.png', {
|
|
5
6
|
eager: true,
|
|
6
7
|
query: {
|
|
7
8
|
enhanced: true,
|
|
@@ -11,8 +12,7 @@
|
|
|
11
12
|
|
|
12
13
|
let {
|
|
13
14
|
paths,
|
|
14
|
-
pages
|
|
15
|
-
isDark
|
|
15
|
+
pages
|
|
16
16
|
}: {
|
|
17
17
|
paths: Record<string, string[]>;
|
|
18
18
|
pages: Record<
|
|
@@ -24,9 +24,10 @@
|
|
|
24
24
|
transforms?: string[];
|
|
25
25
|
}
|
|
26
26
|
>;
|
|
27
|
-
isDark: boolean;
|
|
28
27
|
} = $props();
|
|
29
28
|
|
|
29
|
+
const ds = useDark();
|
|
30
|
+
|
|
30
31
|
function sortPages(a: string, b: string) {
|
|
31
32
|
const sortA = pages[a].sortKey ?? 10;
|
|
32
33
|
const sortB = pages[b].sortKey ?? 10;
|
|
@@ -53,9 +54,9 @@
|
|
|
53
54
|
<enhanced:img
|
|
54
55
|
title={pages[page].title}
|
|
55
56
|
src={exampleImages[
|
|
56
|
-
|
|
57
|
+
`../../snapshots/${page
|
|
57
58
|
.replace('./', '')
|
|
58
|
-
.replace('.svelte', isDark ? '.dark.png' : '.png')}`
|
|
59
|
+
.replace('.svelte', ds.isDark ? '.dark.png' : '.png')}`
|
|
59
60
|
].default}
|
|
60
61
|
alt={pages[page].title} />
|
|
61
62
|
<div class="title">{pages[page].title}</div>
|