@turnipxenon/pineapple 2.4.36 → 2.4.38
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.
- package/.idea/shelf/Changes1/shelved.patch +250 -0
- package/.idea/shelf/Changes1.xml +4 -0
- package/.idea/shelf/yarn_scripts/shelved.patch +20 -0
- package/.idea/workspace.xml +36 -32
- package/.svelte-kit/__package__/components/Card.svelte +3 -1
- package/.svelte-kit/__package__/components/Card.svelte.d.ts +1 -0
- package/.svelte-kit/__package__/components/dialog_overlay/DialogOverlay.svelte +9 -11
- package/.svelte-kit/__package__/components/navigation_component/NavigationComponent.svelte +240 -238
- package/.svelte-kit/__package__/components/navigation_component/NavigationControl.svelte +89 -89
- package/.svelte-kit/__package__/components/navigation_component/PageMeta.js +4 -4
- package/.svelte-kit/__package__/components/pineapple/PineappleBaseLayout.svelte +4 -4
- package/.svelte-kit/ambient.d.ts +2 -0
- package/.svelte-kit/generated/client/app.js +9 -9
- package/.svelte-kit/generated/client/nodes/10.js +1 -1
- package/.svelte-kit/generated/client/nodes/11.js +1 -1
- package/.svelte-kit/generated/client/nodes/12.js +1 -1
- package/.svelte-kit/generated/client/nodes/13.js +3 -1
- package/.svelte-kit/generated/client/nodes/5.js +1 -3
- package/.svelte-kit/generated/client/nodes/6.js +1 -1
- package/.svelte-kit/generated/client/nodes/7.js +1 -1
- package/.svelte-kit/generated/client/nodes/8.js +1 -1
- package/.svelte-kit/generated/client/nodes/9.js +1 -1
- package/.svelte-kit/generated/server/internal.js +1 -1
- package/.svelte-kit/types/route_meta_data.json +2 -2
- package/.svelte-kit/types/src/routes/$types.d.ts +1 -1
- package/.svelte-kit/types/src/routes/(pineapple)/$types.d.ts +1 -1
- package/.svelte-kit/types/src/routes/(pineapple)/pineapple/(pineapple)/$types.d.ts +19 -0
- package/dist/components/Card.svelte +3 -1
- package/dist/components/Card.svelte.d.ts +1 -0
- package/dist/components/dialog_overlay/DialogOverlay.svelte +9 -11
- package/dist/components/navigation_component/NavigationComponent.svelte +240 -238
- package/dist/components/navigation_component/NavigationControl.svelte +89 -89
- package/dist/components/navigation_component/PageMeta.js +4 -4
- package/dist/components/pineapple/PineappleBaseLayout.svelte +4 -4
- package/package.json +3 -2
- package/src/lib/components/Card.svelte +4 -1
- package/src/lib/components/dialog_overlay/DialogOverlay.svelte +11 -12
- package/src/lib/components/navigation_component/NavigationComponent.svelte +145 -143
- package/src/lib/components/navigation_component/NavigationControl.svelte +60 -60
- package/src/lib/components/navigation_component/PageMeta.ts +205 -206
- package/src/lib/components/pineapple/PineappleBaseLayout.svelte +4 -4
- package/src/routes/(pineapple)/+layout.svelte +1 -1
- package/src/routes/(pineapple)/pineapple/(extra-pages)/page1/+page.svelte +7 -7
- package/src/routes/(pineapple)/pineapple/(extra-pages)/page1/meta.json +23 -23
- package/src/routes/(pineapple)/pineapple/(extra-pages)/page2/+page.svelte +7 -7
- package/src/routes/(pineapple)/pineapple/(extra-pages)/page2/meta.json +7 -7
- package/src/routes/(pineapple)/pineapple/(extra-pages)/page3/+page.svelte +7 -7
- package/src/routes/(pineapple)/pineapple/(extra-pages)/page3/page5/+page.svelte +7 -7
- package/src/routes/(pineapple)/pineapple/(extra-pages)/page3/page5/meta.json +6 -6
- package/src/routes/(pineapple)/pineapple/(extra-pages)/page3/page6/+page.svelte +7 -7
- package/src/routes/(pineapple)/pineapple/(extra-pages)/page3/page7/(test_layout)/page8/+page.svelte +7 -7
- package/src/routes/(pineapple)/pineapple/(extra-pages)/page3/page7/(test_layout)/page8/meta.json +6 -6
- package/src/routes/(pineapple)/pineapple/(extra-pages)/page3/page7/+page.svelte +7 -7
- package/src/routes/(pineapple)/pineapple/(extra-pages)/page4/+page.svelte +6 -6
- package/src/routes/(pineapple)/pineapple/{+page.svelte → (pineapple)/+page.svelte} +25 -30
- package/src/routes/(pineapple)/pineapple/{(extra-pages) → (pineapple)}/ImageMap.ts +5 -5
- package/src/routes/(pineapple)/pineapple/{TestDialog.yarn → (pineapple)/TestDialog.yarn} +1 -1
- /package/src/routes/(pineapple)/pineapple/{+page.ts → (pineapple)/+page.ts} +0 -0
|
@@ -24,10 +24,9 @@ export const parsePageMeta = (fileList, jsonList, imageMap, compareFn) => {
|
|
|
24
24
|
// let pageGroupedList: PageMeta[] = [];
|
|
25
25
|
const jsonMap = new Map();
|
|
26
26
|
Object.keys(jsonList).forEach(path => {
|
|
27
|
-
const
|
|
27
|
+
const pathEnd = path.split("../").pop();
|
|
28
|
+
const pathParts = pathEnd.split("/");
|
|
28
29
|
pathParts.pop();
|
|
29
|
-
// get title
|
|
30
|
-
// const title = pathParts[pathParts.length - 1].replaceAll("-", " ");
|
|
31
30
|
// get url path
|
|
32
31
|
const subPath = pathParts.filter(s => {
|
|
33
32
|
return s !== "." && s.indexOf("(") !== 0;
|
|
@@ -40,7 +39,8 @@ export const parsePageMeta = (fileList, jsonList, imageMap, compareFn) => {
|
|
|
40
39
|
}
|
|
41
40
|
});
|
|
42
41
|
for (const path in fileList) {
|
|
43
|
-
const
|
|
42
|
+
const pathEnd = path.split("../").pop();
|
|
43
|
+
const pathParts = pathEnd.split("/");
|
|
44
44
|
pathParts.pop();
|
|
45
45
|
// get title
|
|
46
46
|
const title = pathParts[pathParts.length - 1].replaceAll("-", " ");
|
|
@@ -134,8 +134,8 @@ enableDialogueOverlay.set(showDialogByDefault);
|
|
|
134
134
|
display: flex;
|
|
135
135
|
align-items: center;
|
|
136
136
|
justify-content: center;
|
|
137
|
-
|
|
138
|
-
|
|
137
|
+
width: 100%;
|
|
138
|
+
padding: 1lh clamp(8px, 10vw, 2em);
|
|
139
139
|
flex-direction: column;
|
|
140
140
|
z-index: 0;
|
|
141
141
|
}
|
|
@@ -269,7 +269,7 @@ enableDialogueOverlay.set(showDialogByDefault);
|
|
|
269
269
|
bottom: var(--fab-margin);
|
|
270
270
|
width: 4em;
|
|
271
271
|
border-radius: 50%;
|
|
272
|
-
|
|
272
|
+
z-index: 100;
|
|
273
273
|
}
|
|
274
274
|
|
|
275
275
|
.fab > img {
|
|
@@ -285,6 +285,6 @@ enableDialogueOverlay.set(showDialogByDefault);
|
|
|
285
285
|
}
|
|
286
286
|
|
|
287
287
|
.turnip-icon {
|
|
288
|
-
|
|
288
|
+
margin: 4px;
|
|
289
289
|
}
|
|
290
290
|
</style>
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@turnipxenon/pineapple",
|
|
3
3
|
"description": "personal package for base styling for other personal projects",
|
|
4
|
-
"version": "2.4.
|
|
4
|
+
"version": "2.4.38",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"dev": "vite dev",
|
|
7
7
|
"build": "npm run check-requirements && vite build && yarn package",
|
|
@@ -15,7 +15,8 @@
|
|
|
15
15
|
"check-requirements": "npx vite-node src/lib/scripts/SetDefaultEnvironment.ts",
|
|
16
16
|
"custom-check": "npx vite-node src/lib/scripts/util/ManualCheckRun.ts",
|
|
17
17
|
"preview": "vite preview",
|
|
18
|
-
"prepublishOnly": "yarn package"
|
|
18
|
+
"prepublishOnly": "yarn package",
|
|
19
|
+
"to-dev": "git checkout main && git pull origin main && git checkout -b turnip/dev"
|
|
19
20
|
},
|
|
20
21
|
"devDependencies": {
|
|
21
22
|
"@sveltejs/adapter-auto": "^3.1.1",
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
export let marginBottom = "2lh";
|
|
4
4
|
export let overrideStyle = "";
|
|
5
5
|
export let includeDataNoSnippet = true;
|
|
6
|
+
export let additionalClass: string[] = [];
|
|
6
7
|
|
|
7
8
|
// warning: don't forget the semi-colon when adding new style!
|
|
8
9
|
const style = `
|
|
@@ -14,10 +15,12 @@
|
|
|
14
15
|
if (!$$slots.content) {
|
|
15
16
|
console.error("Missing content slot in card. No content will be displayed.");
|
|
16
17
|
}
|
|
18
|
+
|
|
19
|
+
const classes = ["card", "turnip-card"].concat(additionalClass).join(" ");
|
|
17
20
|
</script>
|
|
18
21
|
|
|
19
22
|
{#if (includeDataNoSnippet)}
|
|
20
|
-
<div class=
|
|
23
|
+
<div class={classes} style={style} data-no-snippet>
|
|
21
24
|
<slot name="content" class="card" />
|
|
22
25
|
</div>
|
|
23
26
|
{:else }
|
|
@@ -16,26 +16,25 @@
|
|
|
16
16
|
}
|
|
17
17
|
});
|
|
18
18
|
|
|
19
|
-
onMount(() => {
|
|
20
|
-
dialogManager.update(0);
|
|
21
|
-
});
|
|
22
|
-
|
|
23
19
|
let hidePercent = 100;
|
|
24
20
|
let isHidden = true;
|
|
25
|
-
|
|
26
|
-
hidePercent
|
|
27
|
-
|
|
28
|
-
|
|
21
|
+
onMount(() => {
|
|
22
|
+
dialogManager.hidePercent.subscribe((value) => {
|
|
23
|
+
hidePercent = value * 0.4;
|
|
24
|
+
isHidden = false;
|
|
25
|
+
});
|
|
29
26
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
27
|
+
dialogManager.currentReadableState.subscribe((value) => {
|
|
28
|
+
isHidden = value === DialogState.Invisible;
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
dialogManager.update(0);
|
|
34
32
|
});
|
|
35
33
|
|
|
36
34
|
const onDialogClick = () => {
|
|
37
35
|
dialogManager.skipAnimation();
|
|
38
36
|
};
|
|
37
|
+
|
|
39
38
|
</script>
|
|
40
39
|
|
|
41
40
|
<div class="dialog-elements"
|
|
@@ -1,144 +1,146 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import NavigationControl from "$pkg/components/navigation_component/NavigationControl.svelte";
|
|
3
|
-
import { Card, createGoToFunction } from "$pkg";
|
|
4
|
-
import { parsePageMeta, type ParsePageMetaCompareFn } from "$pkg/components/navigation_component/PageMeta";
|
|
5
|
-
|
|
6
|
-
export let title: string | undefined = undefined;
|
|
7
|
-
export let fileList: Record<string, unknown>;
|
|
8
|
-
export let jsonList: Record<string, unknown>;
|
|
9
|
-
export let imageMap = new Map<string, string>();
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Should include a slash before and after the path
|
|
13
|
-
*/
|
|
14
|
-
export let parentSubpath: string;
|
|
15
|
-
|
|
16
|
-
export let compareFn: undefined | ParsePageMetaCompareFn = undefined;
|
|
17
|
-
export let pageSize = 5;
|
|
18
|
-
export let currentIndex = 0;
|
|
19
|
-
|
|
20
|
-
const pageFlatList = parsePageMeta(fileList, jsonList, imageMap, compareFn);
|
|
21
|
-
|
|
22
|
-
$: visiblePages = pageFlatList.slice(currentIndex * pageSize, (currentIndex * pageSize) + pageSize);
|
|
23
|
-
</script>
|
|
24
|
-
|
|
25
|
-
<div class="navigation-wrapper">
|
|
26
|
-
{#if (title)}
|
|
27
|
-
<Card>
|
|
28
|
-
<h1 slot="content" class="default-card navigation-title">
|
|
29
|
-
{title}
|
|
30
|
-
</h1>
|
|
31
|
-
</Card>
|
|
32
|
-
{/if}
|
|
33
|
-
|
|
34
|
-
<NavigationControl bind:currentIndex={currentIndex}
|
|
35
|
-
bind:contentLength={pageFlatList.length}
|
|
36
|
-
bind:pageSize={pageSize}></NavigationControl>
|
|
37
|
-
|
|
38
|
-
<div class="navigation-component">
|
|
39
|
-
<!-- all the misc routes-->
|
|
40
|
-
{#each visiblePages as pageMeta}
|
|
41
|
-
{@const fullPath=`${parentSubpath}${pageMeta.relativeLink}`}
|
|
42
|
-
<button class="navigation-element"
|
|
43
|
-
title={fullPath}
|
|
44
|
-
on:click={createGoToFunction(fullPath)}>
|
|
45
|
-
{#if pageMeta.imageUrl}
|
|
46
|
-
<img src={pageMeta.imageUrl}
|
|
47
|
-
alt={pageMeta.imageAlt ?? "placeholder alt text please replace me or report me!"} />
|
|
48
|
-
{/if}
|
|
49
|
-
<section class="blurb-text">
|
|
50
|
-
<h2>{pageMeta.title}</h2>
|
|
51
|
-
<p>Published: {pageMeta.datePublished ?? "N/A"} | Last updated: {pageMeta.lastUpdated ?? "N/A"}</p>
|
|
52
|
-
<p>{pageMeta.description ?? ""}</p>
|
|
53
|
-
Tags:
|
|
54
|
-
{#if (pageMeta.tags && pageMeta.tags.length !== 0)}
|
|
55
|
-
{#each pageMeta.tags as tagValue}
|
|
56
|
-
<span class="badge variant-filled tag-container">{tagValue}</span>
|
|
57
|
-
{/each}
|
|
58
|
-
{:else}
|
|
59
|
-
None
|
|
60
|
-
{/if}
|
|
61
|
-
</section>
|
|
62
|
-
</button>
|
|
63
|
-
{/each}
|
|
64
|
-
|
|
65
|
-
{#if visiblePages.length === 0}
|
|
66
|
-
<Card>
|
|
67
|
-
<p class="default-card" slot="content">Sorry, no content was found</p>
|
|
68
|
-
</Card>
|
|
69
|
-
{/if}
|
|
70
|
-
</div>
|
|
71
|
-
|
|
72
|
-
<NavigationControl bind:currentIndex={currentIndex}
|
|
73
|
-
bind:contentLength={pageFlatList.length}
|
|
74
|
-
bind:pageSize={pageSize}></NavigationControl>
|
|
75
|
-
|
|
76
|
-
</div>
|
|
77
|
-
|
|
78
|
-
<style lang="postcss">
|
|
79
|
-
@media (max-width: 800px) {
|
|
80
|
-
img {
|
|
81
|
-
max-height: 20rem;
|
|
82
|
-
width: 100%;
|
|
83
|
-
flex-basis: 100%;
|
|
84
|
-
border-radius: var(--theme-rounded-container) var(--theme-rounded-container) 0 0;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
.navigation-element {
|
|
88
|
-
flex-direction: column;
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
@media (min-width: 801px) {
|
|
93
|
-
.navigation-element {
|
|
94
|
-
flex-direction: row;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
img {
|
|
98
|
-
width: 20em;
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
.navigation-element {
|
|
103
|
-
@apply btn card card-hover bg-surface-100 dark:bg-surface-900;
|
|
104
|
-
display: flex;
|
|
105
|
-
/*flex-direction: row;*/
|
|
106
|
-
text-align: start;
|
|
107
|
-
align-items: flex-start;
|
|
108
|
-
padding: 0;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
img {
|
|
112
|
-
height: 20em;
|
|
113
|
-
object-fit: cover;
|
|
114
|
-
padding: var(--theme-border-base);
|
|
115
|
-
border-radius: var(--theme-rounded-container) 0 0 var(--theme-rounded-container);
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
.navigation-component {
|
|
119
|
-
display: flex;
|
|
120
|
-
flex-direction: column;
|
|
121
|
-
gap: 2em;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
.navigation-title {
|
|
125
|
-
text-align: center;
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import NavigationControl from "$pkg/components/navigation_component/NavigationControl.svelte";
|
|
3
|
+
import { Card, createGoToFunction } from "$pkg";
|
|
4
|
+
import { parsePageMeta, type ParsePageMetaCompareFn } from "$pkg/components/navigation_component/PageMeta";
|
|
5
|
+
|
|
6
|
+
export let title: string | undefined = undefined;
|
|
7
|
+
export let fileList: Record<string, unknown>;
|
|
8
|
+
export let jsonList: Record<string, unknown>;
|
|
9
|
+
export let imageMap = new Map<string, string>();
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Should include a slash before and after the path
|
|
13
|
+
*/
|
|
14
|
+
export let parentSubpath: string;
|
|
15
|
+
|
|
16
|
+
export let compareFn: undefined | ParsePageMetaCompareFn = undefined;
|
|
17
|
+
export let pageSize = 5;
|
|
18
|
+
export let currentIndex = 0;
|
|
19
|
+
|
|
20
|
+
const pageFlatList = parsePageMeta(fileList, jsonList, imageMap, compareFn);
|
|
21
|
+
|
|
22
|
+
$: visiblePages = pageFlatList.slice(currentIndex * pageSize, (currentIndex * pageSize) + pageSize);
|
|
23
|
+
</script>
|
|
24
|
+
|
|
25
|
+
<div class="navigation-wrapper">
|
|
26
|
+
{#if (title)}
|
|
27
|
+
<Card>
|
|
28
|
+
<h1 slot="content" class="default-card navigation-title">
|
|
29
|
+
{title}
|
|
30
|
+
</h1>
|
|
31
|
+
</Card>
|
|
32
|
+
{/if}
|
|
33
|
+
|
|
34
|
+
<NavigationControl bind:currentIndex={currentIndex}
|
|
35
|
+
bind:contentLength={pageFlatList.length}
|
|
36
|
+
bind:pageSize={pageSize}></NavigationControl>
|
|
37
|
+
|
|
38
|
+
<div class="navigation-component">
|
|
39
|
+
<!-- all the misc routes-->
|
|
40
|
+
{#each visiblePages as pageMeta}
|
|
41
|
+
{@const fullPath=`${parentSubpath}${pageMeta.relativeLink}`}
|
|
42
|
+
<button class="navigation-element"
|
|
43
|
+
title={fullPath}
|
|
44
|
+
on:click={createGoToFunction(fullPath)}>
|
|
45
|
+
{#if pageMeta.imageUrl}
|
|
46
|
+
<img src={pageMeta.imageUrl}
|
|
47
|
+
alt={pageMeta.imageAlt ?? "placeholder alt text please replace me or report me!"} />
|
|
48
|
+
{/if}
|
|
49
|
+
<section class="blurb-text">
|
|
50
|
+
<h2>{pageMeta.title}</h2>
|
|
51
|
+
<p>Published: {pageMeta.datePublished ?? "N/A"} | Last updated: {pageMeta.lastUpdated ?? "N/A"}</p>
|
|
52
|
+
<p>{pageMeta.description ?? ""}</p>
|
|
53
|
+
Tags:
|
|
54
|
+
{#if (pageMeta.tags && pageMeta.tags.length !== 0)}
|
|
55
|
+
{#each pageMeta.tags as tagValue}
|
|
56
|
+
<span class="badge variant-filled tag-container">{tagValue}</span>
|
|
57
|
+
{/each}
|
|
58
|
+
{:else}
|
|
59
|
+
None
|
|
60
|
+
{/if}
|
|
61
|
+
</section>
|
|
62
|
+
</button>
|
|
63
|
+
{/each}
|
|
64
|
+
|
|
65
|
+
{#if visiblePages.length === 0}
|
|
66
|
+
<Card>
|
|
67
|
+
<p class="default-card" slot="content">Sorry, no content was found</p>
|
|
68
|
+
</Card>
|
|
69
|
+
{/if}
|
|
70
|
+
</div>
|
|
71
|
+
|
|
72
|
+
<NavigationControl bind:currentIndex={currentIndex}
|
|
73
|
+
bind:contentLength={pageFlatList.length}
|
|
74
|
+
bind:pageSize={pageSize}></NavigationControl>
|
|
75
|
+
|
|
76
|
+
</div>
|
|
77
|
+
|
|
78
|
+
<style lang="postcss">
|
|
79
|
+
@media (max-width: 800px) {
|
|
80
|
+
img {
|
|
81
|
+
max-height: 20rem;
|
|
82
|
+
width: 100%;
|
|
83
|
+
flex-basis: 100%;
|
|
84
|
+
border-radius: var(--theme-rounded-container) var(--theme-rounded-container) 0 0;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.navigation-element {
|
|
88
|
+
flex-direction: column;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
@media (min-width: 801px) {
|
|
93
|
+
.navigation-element {
|
|
94
|
+
flex-direction: row;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
img {
|
|
98
|
+
width: 20em;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.navigation-element {
|
|
103
|
+
@apply btn card card-hover bg-surface-100 dark:bg-surface-900;
|
|
104
|
+
display: flex;
|
|
105
|
+
/*flex-direction: row;*/
|
|
106
|
+
text-align: start;
|
|
107
|
+
align-items: flex-start;
|
|
108
|
+
padding: 0;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
img {
|
|
112
|
+
height: 20em;
|
|
113
|
+
object-fit: cover;
|
|
114
|
+
padding: var(--theme-border-base);
|
|
115
|
+
border-radius: var(--theme-rounded-container) 0 0 var(--theme-rounded-container);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.navigation-component {
|
|
119
|
+
display: flex;
|
|
120
|
+
flex-direction: column;
|
|
121
|
+
gap: 2em;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.navigation-title {
|
|
125
|
+
text-align: center;
|
|
126
|
+
max-width: initial;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.blurb-text {
|
|
130
|
+
padding: 2em;
|
|
131
|
+
flex-grow: 1;
|
|
132
|
+
white-space: initial;
|
|
133
|
+
min-width: 0;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
.navigation-wrapper {
|
|
137
|
+
display: flex;
|
|
138
|
+
flex-direction: column;
|
|
139
|
+
max-width: 1000px;
|
|
140
|
+
width: 100%;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
.tag-container {
|
|
144
|
+
margin: 0.25lh 0;
|
|
145
|
+
}
|
|
144
146
|
</style>
|
|
@@ -1,61 +1,61 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { onMount } from "svelte";
|
|
3
|
-
|
|
4
|
-
export let currentIndex = 0;
|
|
5
|
-
export let contentLength: number;
|
|
6
|
-
export let pageSize: number;
|
|
7
|
-
|
|
8
|
-
import { Card } from "$pkg";
|
|
9
|
-
import { page } from "$app/stores";
|
|
10
|
-
import { goto } from "$app/navigation";
|
|
11
|
-
|
|
12
|
-
const queryIndex = $page.url.searchParams.get("index");
|
|
13
|
-
if (queryIndex) {
|
|
14
|
-
currentIndex = parseInt(queryIndex) || 0;
|
|
15
|
-
}
|
|
16
|
-
const queryPageSize = $page.url.searchParams.get("pageSize");
|
|
17
|
-
if (queryPageSize) {
|
|
18
|
-
pageSize = parseInt(queryPageSize) || 5;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
const movePage = (isNext: boolean) => {
|
|
22
|
-
if (isNext) {
|
|
23
|
-
currentIndex = currentIndex + 1;
|
|
24
|
-
} else {
|
|
25
|
-
currentIndex = currentIndex - 1;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
const query = new URLSearchParams($page.url.searchParams.toString());
|
|
29
|
-
query.set("index", currentIndex.toString());
|
|
30
|
-
goto(`?${query.toString()}`);
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
onMount(() => {
|
|
34
|
-
const query = new URLSearchParams($page.url.searchParams.toString());
|
|
35
|
-
query.set("index", currentIndex.toString());
|
|
36
|
-
query.set("pageSize", pageSize.toString());
|
|
37
|
-
goto(`?${query.toString()}`);
|
|
38
|
-
});
|
|
39
|
-
</script>
|
|
40
|
-
|
|
41
|
-
<div class="navigation-control-container">
|
|
42
|
-
<button class="navigation-control-button"
|
|
43
|
-
disabled={currentIndex <= 0}
|
|
44
|
-
on:click={() => {movePage(false)}}>{"<"}</button>
|
|
45
|
-
<Card marginBottom="0"><p slot="content" style="margin: 1em">Page {currentIndex + 1}</p></Card>
|
|
46
|
-
<button class="navigation-control-button"
|
|
47
|
-
disabled={(currentIndex + 1) * pageSize >= contentLength}
|
|
48
|
-
on:click={() => {movePage(true)}}>{">"}</button>
|
|
49
|
-
</div>
|
|
50
|
-
|
|
51
|
-
<style lang="postcss">
|
|
52
|
-
.navigation-control-container {
|
|
53
|
-
display: flex;
|
|
54
|
-
justify-content: space-between;
|
|
55
|
-
margin: 1lh 0;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
.navigation-control-button {
|
|
59
|
-
@apply btn variant-filled-secondary;
|
|
60
|
-
}
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { onMount } from "svelte";
|
|
3
|
+
|
|
4
|
+
export let currentIndex = 0;
|
|
5
|
+
export let contentLength: number;
|
|
6
|
+
export let pageSize: number;
|
|
7
|
+
|
|
8
|
+
import { Card } from "$pkg";
|
|
9
|
+
import { page } from "$app/stores";
|
|
10
|
+
import { goto } from "$app/navigation";
|
|
11
|
+
|
|
12
|
+
const queryIndex = $page.url.searchParams.get("index");
|
|
13
|
+
if (queryIndex) {
|
|
14
|
+
currentIndex = parseInt(queryIndex) || 0;
|
|
15
|
+
}
|
|
16
|
+
const queryPageSize = $page.url.searchParams.get("pageSize");
|
|
17
|
+
if (queryPageSize) {
|
|
18
|
+
pageSize = parseInt(queryPageSize) || 5;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const movePage = (isNext: boolean) => {
|
|
22
|
+
if (isNext) {
|
|
23
|
+
currentIndex = currentIndex + 1;
|
|
24
|
+
} else {
|
|
25
|
+
currentIndex = currentIndex - 1;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const query = new URLSearchParams($page.url.searchParams.toString());
|
|
29
|
+
query.set("index", currentIndex.toString());
|
|
30
|
+
goto(`?${query.toString()}`);
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
onMount(() => {
|
|
34
|
+
const query = new URLSearchParams($page.url.searchParams.toString());
|
|
35
|
+
query.set("index", currentIndex.toString());
|
|
36
|
+
query.set("pageSize", pageSize.toString());
|
|
37
|
+
goto(`?${query.toString()}`);
|
|
38
|
+
});
|
|
39
|
+
</script>
|
|
40
|
+
|
|
41
|
+
<div class="navigation-control-container">
|
|
42
|
+
<button class="navigation-control-button"
|
|
43
|
+
disabled={currentIndex <= 0}
|
|
44
|
+
on:click={() => {movePage(false)}}>{"<"}</button>
|
|
45
|
+
<Card marginBottom="0"><p slot="content" style="margin: 1em">Page {currentIndex + 1}</p></Card>
|
|
46
|
+
<button class="navigation-control-button"
|
|
47
|
+
disabled={(currentIndex + 1) * pageSize >= contentLength}
|
|
48
|
+
on:click={() => {movePage(true)}}>{">"}</button>
|
|
49
|
+
</div>
|
|
50
|
+
|
|
51
|
+
<style lang="postcss">
|
|
52
|
+
.navigation-control-container {
|
|
53
|
+
display: flex;
|
|
54
|
+
justify-content: space-between;
|
|
55
|
+
margin: 1lh 0;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.navigation-control-button {
|
|
59
|
+
@apply btn variant-filled-secondary;
|
|
60
|
+
}
|
|
61
61
|
</style>
|