@turnipxenon/pineapple 2.4.37 → 2.4.39
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/shelf/yarn_scripts.xml +4 -0
- package/.idea/workspace.xml +33 -31
- 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 +246 -239
- package/.svelte-kit/__package__/components/navigation_component/NavigationComponent.svelte.d.ts +2 -1
- package/.svelte-kit/__package__/components/navigation_component/NavigationControl.svelte +89 -89
- package/.svelte-kit/__package__/components/pineapple/PineappleBaseLayout.svelte +4 -4
- package/.svelte-kit/ambient.d.ts +2 -2
- package/.svelte-kit/generated/server/internal.js +1 -1
- 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 +246 -239
- package/dist/components/navigation_component/NavigationComponent.svelte.d.ts +2 -1
- package/dist/components/navigation_component/NavigationControl.svelte +89 -89
- 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 +150 -143
- package/src/lib/components/navigation_component/NavigationControl.svelte +60 -60
- package/src/lib/components/navigation_component/PageMeta.ts +205 -205
- 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/(pineapple)/+page.svelte +25 -29
- package/src/routes/(pineapple)/pineapple/{(extra-pages) → (pineapple)}/ImageMap.ts +5 -5
|
@@ -29,93 +29,93 @@ onMount(() => {
|
|
|
29
29
|
query.set("pageSize", pageSize.toString());
|
|
30
30
|
goto(`?${query.toString()}`);
|
|
31
31
|
});
|
|
32
|
-
</script>
|
|
33
|
-
|
|
34
|
-
<div class="navigation-control-container">
|
|
35
|
-
<button class="navigation-control-button"
|
|
36
|
-
disabled={currentIndex <= 0}
|
|
37
|
-
on:click={() => {movePage(false)}}>{"<"}</button>
|
|
38
|
-
<Card marginBottom="0"><p slot="content" style="margin: 1em">Page {currentIndex + 1}</p></Card>
|
|
39
|
-
<button class="navigation-control-button"
|
|
40
|
-
disabled={(currentIndex + 1) * pageSize >= contentLength}
|
|
41
|
-
on:click={() => {movePage(true)}}>{">"}</button>
|
|
42
|
-
</div>
|
|
43
|
-
|
|
44
|
-
<style>
|
|
45
|
-
.navigation-control-container {
|
|
46
|
-
display: flex;
|
|
47
|
-
justify-content: space-between;
|
|
48
|
-
margin: 1lh 0;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
:is(.dark .navigation-control-button) {
|
|
52
|
-
--tw-bg-opacity: 1;
|
|
53
|
-
background-color: rgb(var(--color-secondary-500) / var(--tw-bg-opacity));
|
|
54
|
-
color: rgb(var(--on-secondary));
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
.navigation-control-button:disabled {
|
|
58
|
-
cursor: not-allowed;
|
|
59
|
-
opacity: 0.5;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
.navigation-control-button:disabled:hover {
|
|
63
|
-
--tw-brightness: brightness(1);
|
|
64
|
-
filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
.navigation-control-button:disabled:active {
|
|
68
|
-
--tw-scale-x: 1;
|
|
69
|
-
--tw-scale-y: 1;
|
|
70
|
-
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
.navigation-control-button {
|
|
74
|
-
font-size: 1rem;
|
|
75
|
-
line-height: 1.5rem;
|
|
76
|
-
padding-left: 1.25rem;
|
|
77
|
-
padding-right: 1.25rem;
|
|
78
|
-
padding-top: 9px;
|
|
79
|
-
padding-bottom: 9px;
|
|
80
|
-
white-space: nowrap;
|
|
81
|
-
text-align: center;
|
|
82
|
-
display: inline-flex;
|
|
83
|
-
align-items: center;
|
|
84
|
-
justify-content: center;
|
|
85
|
-
transition-property: all;
|
|
86
|
-
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
|
87
|
-
transition-duration: 150ms;
|
|
88
|
-
border-radius: var(--theme-rounded-base);
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
.navigation-control-button > :not([hidden]) ~ :not([hidden]) {
|
|
92
|
-
--tw-space-x-reverse: 0;
|
|
93
|
-
margin-right: calc(0.5rem * var(--tw-space-x-reverse));
|
|
94
|
-
margin-left: calc(0.5rem * calc(1 - var(--tw-space-x-reverse)));
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
.navigation-control-button:hover {
|
|
98
|
-
--tw-brightness: brightness(1.15);
|
|
99
|
-
filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
.navigation-control-button:active {
|
|
103
|
-
--tw-scale-x: 95%;
|
|
104
|
-
--tw-scale-y: 95%;
|
|
105
|
-
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
|
|
106
|
-
--tw-brightness: brightness(.9);
|
|
107
|
-
filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
.navigation-control-button {
|
|
111
|
-
--tw-bg-opacity: 1;
|
|
112
|
-
background-color: rgb(var(--color-secondary-500) / var(--tw-bg-opacity));
|
|
113
|
-
color: rgb(var(--on-secondary));
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
:is(.dark .navigation-control-button) {
|
|
117
|
-
--tw-bg-opacity: 1;
|
|
118
|
-
background-color: rgb(var(--color-secondary-500) / var(--tw-bg-opacity));
|
|
119
|
-
color: rgb(var(--on-secondary));
|
|
120
|
-
}
|
|
32
|
+
</script>
|
|
33
|
+
|
|
34
|
+
<div class="navigation-control-container">
|
|
35
|
+
<button class="navigation-control-button"
|
|
36
|
+
disabled={currentIndex <= 0}
|
|
37
|
+
on:click={() => {movePage(false)}}>{"<"}</button>
|
|
38
|
+
<Card marginBottom="0"><p slot="content" style="margin: 1em">Page {currentIndex + 1}</p></Card>
|
|
39
|
+
<button class="navigation-control-button"
|
|
40
|
+
disabled={(currentIndex + 1) * pageSize >= contentLength}
|
|
41
|
+
on:click={() => {movePage(true)}}>{">"}</button>
|
|
42
|
+
</div>
|
|
43
|
+
|
|
44
|
+
<style>
|
|
45
|
+
.navigation-control-container {
|
|
46
|
+
display: flex;
|
|
47
|
+
justify-content: space-between;
|
|
48
|
+
margin: 1lh 0;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
:is(.dark .navigation-control-button) {
|
|
52
|
+
--tw-bg-opacity: 1;
|
|
53
|
+
background-color: rgb(var(--color-secondary-500) / var(--tw-bg-opacity));
|
|
54
|
+
color: rgb(var(--on-secondary));
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.navigation-control-button:disabled {
|
|
58
|
+
cursor: not-allowed;
|
|
59
|
+
opacity: 0.5;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.navigation-control-button:disabled:hover {
|
|
63
|
+
--tw-brightness: brightness(1);
|
|
64
|
+
filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.navigation-control-button:disabled:active {
|
|
68
|
+
--tw-scale-x: 1;
|
|
69
|
+
--tw-scale-y: 1;
|
|
70
|
+
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.navigation-control-button {
|
|
74
|
+
font-size: 1rem;
|
|
75
|
+
line-height: 1.5rem;
|
|
76
|
+
padding-left: 1.25rem;
|
|
77
|
+
padding-right: 1.25rem;
|
|
78
|
+
padding-top: 9px;
|
|
79
|
+
padding-bottom: 9px;
|
|
80
|
+
white-space: nowrap;
|
|
81
|
+
text-align: center;
|
|
82
|
+
display: inline-flex;
|
|
83
|
+
align-items: center;
|
|
84
|
+
justify-content: center;
|
|
85
|
+
transition-property: all;
|
|
86
|
+
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
|
87
|
+
transition-duration: 150ms;
|
|
88
|
+
border-radius: var(--theme-rounded-base);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.navigation-control-button > :not([hidden]) ~ :not([hidden]) {
|
|
92
|
+
--tw-space-x-reverse: 0;
|
|
93
|
+
margin-right: calc(0.5rem * var(--tw-space-x-reverse));
|
|
94
|
+
margin-left: calc(0.5rem * calc(1 - var(--tw-space-x-reverse)));
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.navigation-control-button:hover {
|
|
98
|
+
--tw-brightness: brightness(1.15);
|
|
99
|
+
filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.navigation-control-button:active {
|
|
103
|
+
--tw-scale-x: 95%;
|
|
104
|
+
--tw-scale-y: 95%;
|
|
105
|
+
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
|
|
106
|
+
--tw-brightness: brightness(.9);
|
|
107
|
+
filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.navigation-control-button {
|
|
111
|
+
--tw-bg-opacity: 1;
|
|
112
|
+
background-color: rgb(var(--color-secondary-500) / var(--tw-bg-opacity));
|
|
113
|
+
color: rgb(var(--on-secondary));
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
:is(.dark .navigation-control-button) {
|
|
117
|
+
--tw-bg-opacity: 1;
|
|
118
|
+
background-color: rgb(var(--color-secondary-500) / var(--tw-bg-opacity));
|
|
119
|
+
color: rgb(var(--on-secondary));
|
|
120
|
+
}
|
|
121
121
|
</style>
|
|
@@ -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.39",
|
|
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,151 @@
|
|
|
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
|
|
7
|
-
export let
|
|
8
|
-
export let
|
|
9
|
-
export let imageMap = new Map<string, string>();
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
export let
|
|
18
|
-
export let
|
|
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
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
{
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
{
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
flex-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
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 fileList: Record<string, unknown>;
|
|
7
|
+
export let jsonList: Record<string, unknown>;
|
|
8
|
+
export let title: string | undefined = undefined;
|
|
9
|
+
export let imageMap = new Map<string, string>();
|
|
10
|
+
export let shouldAllowControl = true;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Should include a slash before and after the path
|
|
14
|
+
*/
|
|
15
|
+
export let parentSubpath: string;
|
|
16
|
+
|
|
17
|
+
export let compareFn: undefined | ParsePageMetaCompareFn = undefined;
|
|
18
|
+
export let pageSize = 5;
|
|
19
|
+
export let currentIndex = 0;
|
|
20
|
+
|
|
21
|
+
const pageFlatList = parsePageMeta(fileList, jsonList, imageMap, compareFn);
|
|
22
|
+
|
|
23
|
+
$: visiblePages = pageFlatList.slice(currentIndex * pageSize, (currentIndex * pageSize) + pageSize);
|
|
24
|
+
</script>
|
|
25
|
+
|
|
26
|
+
<div class="navigation-wrapper">
|
|
27
|
+
{#if (title)}
|
|
28
|
+
<Card>
|
|
29
|
+
<h1 slot="content" class="default-card navigation-title">
|
|
30
|
+
{title}
|
|
31
|
+
</h1>
|
|
32
|
+
</Card>
|
|
33
|
+
{/if}
|
|
34
|
+
|
|
35
|
+
{#if shouldAllowControl}
|
|
36
|
+
<NavigationControl bind:currentIndex={currentIndex}
|
|
37
|
+
bind:contentLength={pageFlatList.length}
|
|
38
|
+
bind:pageSize={pageSize}></NavigationControl>
|
|
39
|
+
{/if}
|
|
40
|
+
|
|
41
|
+
<div class="navigation-component">
|
|
42
|
+
<!-- all the misc routes-->
|
|
43
|
+
{#each visiblePages as pageMeta}
|
|
44
|
+
{@const fullPath=`${parentSubpath}${pageMeta.relativeLink}`}
|
|
45
|
+
<button class="navigation-element"
|
|
46
|
+
title={fullPath}
|
|
47
|
+
on:click={createGoToFunction(fullPath)}>
|
|
48
|
+
{#if pageMeta.imageUrl}
|
|
49
|
+
<img src={pageMeta.imageUrl}
|
|
50
|
+
alt={pageMeta.imageAlt ?? "placeholder alt text please replace me or report me!"} />
|
|
51
|
+
{/if}
|
|
52
|
+
<section class="blurb-text">
|
|
53
|
+
<h2>{pageMeta.title}</h2>
|
|
54
|
+
<p>Published: {pageMeta.datePublished ?? "N/A"} | Last updated: {pageMeta.lastUpdated ?? "N/A"}</p>
|
|
55
|
+
<p>{pageMeta.description ?? ""}</p>
|
|
56
|
+
Tags:
|
|
57
|
+
{#if (pageMeta.tags && pageMeta.tags.length !== 0)}
|
|
58
|
+
{#each pageMeta.tags as tagValue}
|
|
59
|
+
<span class="badge variant-filled tag-container">{tagValue}</span>
|
|
60
|
+
{/each}
|
|
61
|
+
{:else}
|
|
62
|
+
None
|
|
63
|
+
{/if}
|
|
64
|
+
</section>
|
|
65
|
+
</button>
|
|
66
|
+
{/each}
|
|
67
|
+
|
|
68
|
+
{#if visiblePages.length === 0}
|
|
69
|
+
<Card>
|
|
70
|
+
<p class="default-card" slot="content">Sorry, no content was found</p>
|
|
71
|
+
</Card>
|
|
72
|
+
{/if}
|
|
73
|
+
</div>
|
|
74
|
+
|
|
75
|
+
{#if shouldAllowControl}
|
|
76
|
+
<NavigationControl bind:currentIndex={currentIndex}
|
|
77
|
+
bind:contentLength={pageFlatList.length}
|
|
78
|
+
bind:pageSize={pageSize}></NavigationControl>
|
|
79
|
+
{/if}
|
|
80
|
+
|
|
81
|
+
</div>
|
|
82
|
+
|
|
83
|
+
<style lang="postcss">
|
|
84
|
+
@media (max-width: 800px) {
|
|
85
|
+
img {
|
|
86
|
+
max-height: 20rem;
|
|
87
|
+
width: 100%;
|
|
88
|
+
flex-basis: 100%;
|
|
89
|
+
border-radius: var(--theme-rounded-container) var(--theme-rounded-container) 0 0;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.navigation-element {
|
|
93
|
+
flex-direction: column;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
@media (min-width: 801px) {
|
|
98
|
+
.navigation-element {
|
|
99
|
+
flex-direction: row;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
img {
|
|
103
|
+
width: 20em;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.navigation-element {
|
|
108
|
+
@apply btn card card-hover bg-surface-100 dark:bg-surface-900;
|
|
109
|
+
display: flex;
|
|
110
|
+
/*flex-direction: row;*/
|
|
111
|
+
text-align: start;
|
|
112
|
+
align-items: flex-start;
|
|
113
|
+
padding: 0;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
img {
|
|
117
|
+
height: 20em;
|
|
118
|
+
object-fit: cover;
|
|
119
|
+
padding: var(--theme-border-base);
|
|
120
|
+
border-radius: var(--theme-rounded-container) 0 0 var(--theme-rounded-container);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.navigation-component {
|
|
124
|
+
display: flex;
|
|
125
|
+
flex-direction: column;
|
|
126
|
+
gap: 2em;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.navigation-title {
|
|
130
|
+
text-align: center;
|
|
131
|
+
max-width: initial;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.blurb-text {
|
|
135
|
+
padding: 2em;
|
|
136
|
+
flex-grow: 1;
|
|
137
|
+
white-space: initial;
|
|
138
|
+
min-width: 0;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
.navigation-wrapper {
|
|
142
|
+
display: flex;
|
|
143
|
+
flex-direction: column;
|
|
144
|
+
max-width: 1000px;
|
|
145
|
+
width: 100%;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
.tag-container {
|
|
149
|
+
margin: 0.25lh 0;
|
|
150
|
+
}
|
|
144
151
|
</style>
|