@turnipxenon/pineapple 2.4.12 → 2.4.14

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.
Files changed (127) hide show
  1. package/.idea/discord.xml +1 -1
  2. package/.idea/workspace.xml +139 -121
  3. package/.svelte-kit/__package__/app.postcss +28 -2
  4. package/.svelte-kit/__package__/assets/icons/close.svg +1 -0
  5. package/.svelte-kit/__package__/components/Card.svelte +28 -28
  6. package/.svelte-kit/__package__/components/CarouselElement.svelte +16 -16
  7. package/.svelte-kit/__package__/components/Chip.svelte +13 -12
  8. package/.svelte-kit/__package__/components/ElementVisbilityDetector.svelte +5 -5
  9. package/.svelte-kit/__package__/components/SocialSection.svelte +162 -159
  10. package/.svelte-kit/__package__/components/StickyElement.svelte +20 -20
  11. package/.svelte-kit/__package__/components/ToggleableContent.svelte +8 -8
  12. package/.svelte-kit/__package__/components/layouts/SeaweedBaseLayout.svelte +1 -8
  13. package/.svelte-kit/__package__/components/layouts/SeaweedBaseLayout.svelte.d.ts +1 -0
  14. package/.svelte-kit/__package__/components/{layouts → pineapple}/PineappleBaseLayout.svelte +65 -20
  15. package/.svelte-kit/__package__/components/pineapple/overlay_manager/OverlayManager.d.ts +0 -0
  16. package/.svelte-kit/__package__/components/pineapple/overlay_manager/OverlayManager.js +1 -0
  17. package/.svelte-kit/__package__/components/pineapple/toast/DefaultToastBody.d.ts +8 -0
  18. package/.svelte-kit/__package__/components/pineapple/toast/DefaultToastBody.js +1 -0
  19. package/.svelte-kit/__package__/components/pineapple/toast/DefaultToastBody.svelte +48 -0
  20. package/.svelte-kit/__package__/components/pineapple/toast/DefaultToastBody.svelte.d.ts +20 -0
  21. package/.svelte-kit/__package__/components/pineapple/toast/Toast.d.ts +27 -0
  22. package/.svelte-kit/__package__/components/pineapple/toast/Toast.js +37 -0
  23. package/.svelte-kit/__package__/components/pineapple/toast/Toast.svelte +89 -0
  24. package/.svelte-kit/__package__/components/pineapple/toast/Toast.svelte.d.ts +14 -0
  25. package/.svelte-kit/__package__/components/pineapple/toast/custom-toast/TestCustomToast.d.ts +5 -0
  26. package/.svelte-kit/__package__/components/pineapple/toast/custom-toast/TestCustomToast.js +1 -0
  27. package/.svelte-kit/__package__/components/pineapple/toast/custom-toast/TestCustomToast.svelte +1 -0
  28. package/.svelte-kit/__package__/components/pineapple/toast/custom-toast/TestCustomToast.svelte.d.ts +23 -0
  29. package/.svelte-kit/__package__/index.d.ts +1 -1
  30. package/.svelte-kit/__package__/index.js +1 -1
  31. package/.svelte-kit/__package__/postcss.d.ts +3 -3
  32. package/.svelte-kit/__package__/styles/global.css +1 -1
  33. package/.svelte-kit/__package__/theme.postcss +2 -1
  34. package/.svelte-kit/ambient.d.ts +4 -0
  35. package/.svelte-kit/generated/client/app.js +6 -5
  36. package/.svelte-kit/generated/client/nodes/2.js +1 -1
  37. package/.svelte-kit/generated/client/nodes/3.js +1 -1
  38. package/.svelte-kit/generated/client/nodes/4.js +1 -1
  39. package/.svelte-kit/generated/client/nodes/5.js +1 -1
  40. package/.svelte-kit/generated/client/nodes/6.js +1 -1
  41. package/.svelte-kit/generated/client/nodes/7.js +1 -0
  42. package/.svelte-kit/generated/server/internal.js +1 -1
  43. package/.svelte-kit/types/route_meta_data.json +6 -4
  44. package/.svelte-kit/types/src/routes/$types.d.ts +1 -4
  45. package/.svelte-kit/types/src/routes/{personal → (pineapple)}/$types.d.ts +2 -2
  46. package/.svelte-kit/types/src/routes/{portfolio/actual → (pineapple)/pineapple}/$types.d.ts +2 -2
  47. package/.svelte-kit/types/src/routes/(seaweed)/$types.d.ts +19 -0
  48. package/.svelte-kit/types/src/routes/{portfolio → (seaweed)/portfolio}/$types.d.ts +3 -3
  49. package/.svelte-kit/types/src/routes/(seaweed)/portfolio/actual/$types.d.ts +17 -0
  50. package/.svelte-kit/types/src/routes/{portfolio → (seaweed)/portfolio}/proxy+page.server.ts +1 -1
  51. package/README.md +8 -18
  52. package/dist/app.postcss +28 -2
  53. package/dist/assets/icons/close.svg +1 -0
  54. package/dist/components/Card.svelte +28 -28
  55. package/dist/components/CarouselElement.svelte +16 -16
  56. package/dist/components/Chip.svelte +13 -12
  57. package/dist/components/ElementVisbilityDetector.svelte +5 -5
  58. package/dist/components/SocialSection.svelte +162 -159
  59. package/dist/components/StickyElement.svelte +20 -20
  60. package/dist/components/ToggleableContent.svelte +8 -8
  61. package/dist/components/layouts/SeaweedBaseLayout.svelte +1 -8
  62. package/dist/components/layouts/SeaweedBaseLayout.svelte.d.ts +1 -0
  63. package/dist/components/{layouts → pineapple}/PineappleBaseLayout.svelte +65 -20
  64. package/dist/components/pineapple/overlay_manager/OverlayManager.d.ts +0 -0
  65. package/dist/components/pineapple/overlay_manager/OverlayManager.js +1 -0
  66. package/dist/components/pineapple/toast/DefaultToastBody.d.ts +8 -0
  67. package/dist/components/pineapple/toast/DefaultToastBody.js +1 -0
  68. package/dist/components/pineapple/toast/DefaultToastBody.svelte +48 -0
  69. package/dist/components/pineapple/toast/DefaultToastBody.svelte.d.ts +20 -0
  70. package/dist/components/pineapple/toast/Toast.d.ts +27 -0
  71. package/dist/components/pineapple/toast/Toast.js +37 -0
  72. package/dist/components/pineapple/toast/Toast.svelte +89 -0
  73. package/dist/components/pineapple/toast/Toast.svelte.d.ts +14 -0
  74. package/dist/components/pineapple/toast/custom-toast/TestCustomToast.d.ts +5 -0
  75. package/dist/components/pineapple/toast/custom-toast/TestCustomToast.js +1 -0
  76. package/dist/components/pineapple/toast/custom-toast/TestCustomToast.svelte +1 -0
  77. package/dist/components/pineapple/toast/custom-toast/TestCustomToast.svelte.d.ts +23 -0
  78. package/dist/index.d.ts +1 -1
  79. package/dist/index.js +1 -1
  80. package/dist/postcss.d.ts +3 -3
  81. package/dist/styles/global.css +1 -1
  82. package/dist/theme.postcss +2 -1
  83. package/docs/OverlaySpec.md +23 -0
  84. package/docs/pull_request_template.md +34 -0
  85. package/package.json +1 -1
  86. package/src/lib/app.postcss +28 -2
  87. package/src/lib/assets/icons/close.svg +1 -0
  88. package/src/lib/components/Card.svelte +32 -32
  89. package/src/lib/components/CarouselElement.svelte +22 -22
  90. package/src/lib/components/Chip.svelte +13 -12
  91. package/src/lib/components/ElementVisbilityDetector.svelte +22 -22
  92. package/src/lib/components/OnElementVisbilityChanged.ts +1 -1
  93. package/src/lib/components/SocialSection.svelte +95 -92
  94. package/src/lib/components/StickyElement.svelte +39 -39
  95. package/src/lib/components/ToggleableContent.svelte +85 -85
  96. package/src/lib/components/ToggleableContentType.ts +4 -4
  97. package/src/lib/components/layouts/LayoutConstants.ts +1 -1
  98. package/src/lib/components/layouts/SeaweedBaseLayout.svelte +1 -8
  99. package/src/lib/components/pineapple/PineappleBaseLayout.svelte +207 -0
  100. package/src/lib/components/pineapple/overlay_manager/OverlayManager.ts +0 -0
  101. package/src/lib/components/pineapple/toast/DefaultToastBody.svelte +43 -0
  102. package/src/lib/components/pineapple/toast/DefaultToastBody.ts +10 -0
  103. package/src/lib/components/pineapple/toast/Toast.svelte +113 -0
  104. package/src/lib/components/pineapple/toast/Toast.ts +57 -0
  105. package/src/lib/components/pineapple/toast/custom-toast/TestCustomToast.svelte +1 -0
  106. package/src/lib/components/pineapple/toast/custom-toast/TestCustomToast.ts +6 -0
  107. package/src/lib/consts.ts +2 -2
  108. package/src/lib/index.ts +1 -1
  109. package/src/lib/postcss.d.ts +3 -3
  110. package/src/lib/styles/global.css +1 -1
  111. package/src/lib/theme.postcss +2 -1
  112. package/src/lib/util/create_go_to_function.ts +5 -5
  113. package/src/routes/{personal → (pineapple)}/+layout.svelte +1 -1
  114. package/src/routes/(pineapple)/+page.svelte +36 -0
  115. package/src/routes/(pineapple)/pineapple/+page.svelte +44 -0
  116. package/src/routes/(seaweed)/+layout.svelte +10 -0
  117. package/src/routes/{portfolio → (seaweed)/portfolio}/+page.server.ts +1 -1
  118. package/src/routes/{portfolio → (seaweed)/portfolio}/+page.svelte +2 -2
  119. package/src/routes/{portfolio → (seaweed)/portfolio}/.gitignore +1 -1
  120. package/src/routes/{portfolio → (seaweed)/portfolio}/actual/+page.svelte +1 -1
  121. package/src/routes/+layout.svelte +0 -7
  122. package/static/robots.txt +5 -5
  123. package/src/lib/components/layouts/PineappleBaseLayout.svelte +0 -161
  124. package/src/routes/+page.svelte +0 -38
  125. package/src/routes/personal/+page.svelte +0 -37
  126. /package/.svelte-kit/__package__/components/{layouts → pineapple}/PineappleBaseLayout.svelte.d.ts +0 -0
  127. /package/dist/components/{layouts → pineapple}/PineappleBaseLayout.svelte.d.ts +0 -0
@@ -0,0 +1,207 @@
1
+ <script lang="ts">
2
+ // For auto dark/light mode
3
+ import { AppBar, AppShell, autoModeWatcher, LightSwitch } from "@skeletonlabs/skeleton";
4
+ import RandomizedBackground from "$pkg/components/RandomizedBackground.svelte";
5
+
6
+ // navigation
7
+ import { page } from "$app/stores";
8
+ // store
9
+ import { enableBackground } from "$pkg/store";
10
+ import type { BreadcrumbData } from "$pkg/types/BreadcrumbData";
11
+ // assets
12
+ // import DialogOverlay from "$lib/components/DialogOverlay.svelte";
13
+ import AresLogo from "$pkg/assets/characters/ares/ares_logo.webp";
14
+ import FABIcon from "$pkg/assets/placeholder/placeholder_circle.png";
15
+ import { enableDialogueOverlay } from "$pkg/components/dialog_manager/DialogManagerStore";
16
+ import Toast from "$pkg/components/pineapple/toast/Toast.svelte";
17
+ // todo: clean up all these imports!
18
+
19
+ let pages: BreadcrumbData[] = [];
20
+
21
+ const updateBreadcrumb = (pathname: string) => {
22
+ pages = [];
23
+ let basePath = "";
24
+ pathname.split("/").forEach((value, index) => {
25
+ if (index === 0) {
26
+ basePath = "/";
27
+ pages.push({
28
+ path: "/",
29
+ name: "Home"
30
+ });
31
+ return;
32
+ }
33
+
34
+ if (value === "") {
35
+ return;
36
+ }
37
+
38
+ basePath += value + "/";
39
+ pages.push({
40
+ path: basePath,
41
+ name: value
42
+ });
43
+ });
44
+ pages = pages;
45
+ };
46
+
47
+ $: updateBreadcrumb($page.url.pathname); // run every time we navigate
48
+
49
+ let enableBackgroundValue = true;
50
+ enableBackground.subscribe((value) => {
51
+ enableBackgroundValue = value;
52
+ });
53
+
54
+ let enableDialogueOverlayValue = true;
55
+ enableDialogueOverlay.subscribe((value) => {
56
+ enableDialogueOverlayValue = value;
57
+ });
58
+ </script>
59
+
60
+ <!-- App Shell -->
61
+ <svelte:head>
62
+ {@html `<script>${autoModeWatcher.toString()} autoModeWatcher();</script>`}
63
+ </svelte:head>
64
+
65
+ <!--todo: turn off hidden when it's time-->
66
+ <button type="button" class="fab" on:click={()=>{
67
+ enableDialogueOverlay.set(!enableDialogueOverlayValue);
68
+ }}>
69
+ <img src={FABIcon} alt="interactive floating action button represented as a turnip">
70
+ </button>
71
+
72
+ <AppShell>
73
+ <svelte:fragment slot="header">
74
+ <!-- App Bar -->
75
+ <AppBar
76
+ background="app-shell-token"
77
+ slotDefault="place-content-start"
78
+ slotTrail="place-content-end">
79
+ <svelte:fragment slot="lead">
80
+ <!--TODO: add logo or something for the lead in layout-->
81
+ <img
82
+ alt="Ares's head titled towards the left with his tongue out and winking"
83
+ class="ares-logo"
84
+ src={AresLogo}
85
+ />
86
+ <span class="mr-2" />
87
+ <ol class="breadcrumb">
88
+ {#each pages as crumb, i}
89
+ {#if i < pages.length - 1}
90
+ <li class="crumb">
91
+ <a href={crumb.path}>{crumb.name.charAt(0).toUpperCase() + crumb.name.slice(1)}</a>
92
+ </li>
93
+ <li class="crumb-separator" aria-hidden="true">&rsaquo;</li>
94
+ {:else}
95
+ <li class="crumb">{crumb.name.charAt(0).toUpperCase() + crumb.name.slice(1)}</li>
96
+ {/if}
97
+ {/each}
98
+ </ol>
99
+ </svelte:fragment>
100
+ <svelte:fragment slot="trail">
101
+ <LightSwitch bgLight="bg-surface-400" />
102
+ </svelte:fragment>
103
+ </AppBar>
104
+ </svelte:fragment>
105
+
106
+ <RandomizedBackground enable={enableBackgroundValue} />
107
+
108
+ <Toast></Toast>
109
+
110
+ <div class="default-page-container">
111
+ <slot />
112
+ <div class="footer-space" />
113
+ </div>
114
+ <!--{#if enableDialogueOverlayValue}-->
115
+ <!-- &lt;!&ndash; Page Route Content &ndash;&gt;-->
116
+ <!-- <div class="default-page-container">-->
117
+ <!-- <slot />-->
118
+ <!-- <div class="footer-space" />-->
119
+ <!-- </div>-->
120
+ <!-- <DialogOverlay />-->
121
+ <!--{:else}-->
122
+ <!-- <DialogOverlay />-->
123
+ <!-- <slot />-->
124
+ <!--{/if}-->
125
+ </AppShell>
126
+
127
+ <style lang="postcss">
128
+ :root {
129
+ --dialog-left-pad: clamp(0em, 5vw, 2em);
130
+ --dialog-box-width: min(calc(50em + 4em), calc(100vw - var(--dialog-left-pad) - var(--theme-border-base)));
131
+ --dialog-box-height: clamp(15em, 50vw, 18em);
132
+
133
+ /** FAB icon margin/position calculation origin:
134
+ Criteria:
135
+ - We want at mobile (360px) our margin to be at 1em (16px)
136
+ - We want at web (1960px) our margin to be at 2em (32px)
137
+
138
+ A useful scaling factor might vw. At 360px, 16px would be around 4.44vw (360/16).
139
+ At 360px: margin is at 16px or 1em.
140
+ At 1960px: 4.44vw is at 87px but that will be clamped to 32px or 2em.
141
+ The calculation implies that the natural point that the margin becomes 2em is clamped on
142
+ wider screens is at 727px.
143
+ */
144
+ --fab-margin: clamp(1em, 4.44vw, 2em);
145
+ }
146
+
147
+ .default-page-container {
148
+ @apply flex justify-center items-center;
149
+ margin-top: 4em;
150
+ margin-left: clamp(1em, 15vw, 10em);
151
+ margin-right: 1em;
152
+ flex-direction: column;
153
+ z-index: 0;
154
+ }
155
+
156
+ .ares-logo {
157
+ object-fit: contain;
158
+ height: 2em;
159
+ margin-inline-end: 0.5em;
160
+ }
161
+
162
+ /* breadcrumb does not work due to a lot of magic stuff i do
163
+ the code below is from skeleton's tailwind css:
164
+ https://github.com/skeletonlabs/skeleton/blob/54f4ecedabf2be6d94a670b56dc8821095ca3fc9/packages/plugin/src/styles/components/breadcrumbs.css
165
+
166
+ it likely disappeared due to code gen shenanigans and package magic */
167
+ .breadcrumb,
168
+ .breadcrumb-nonresponsive {
169
+ @apply flex items-center space-x-4 w-full overflow-x-auto;
170
+ /*@apply flex items-center space-x-4 w-full hide-scrollbar overflow-x-auto;*/
171
+ }
172
+
173
+ .crumb {
174
+ @apply flex justify-center items-center space-x-2;
175
+ }
176
+
177
+ .crumb-separator {
178
+ @apply flex text-surface-700-200-token opacity-50;
179
+ }
180
+
181
+ /* === Auto-Responsive === */
182
+
183
+ .breadcrumb li {
184
+ @apply hidden md:block;
185
+ }
186
+
187
+ .breadcrumb li:nth-last-child(3),
188
+ .breadcrumb li:nth-last-child(2),
189
+ .breadcrumb li:nth-last-child(1) {
190
+ @apply block;
191
+ }
192
+
193
+ .fab {
194
+ position: fixed;
195
+ bottom: var(--fab-margin);
196
+ width: 4em;
197
+ border-radius: 50%;
198
+ }
199
+
200
+ .fab:dir(ltr) {
201
+ right: var(--fab-margin);
202
+ }
203
+
204
+ .fab:dir(rtl) {
205
+ left: var(--fab-margin);
206
+ }
207
+ </style>
@@ -0,0 +1,43 @@
1
+ <script lang="ts">
2
+ import type { Props } from "$pkg/components/pineapple/toast/DefaultToastBody";
3
+ import type { DismissToastCallback } from "$pkg/components/pineapple/toast/Toast";
4
+ import CloseIcon from "$pkg/assets/icons/close.svg";
5
+
6
+ export let props: Props;
7
+ export let dismissToastCallback: DismissToastCallback | undefined;
8
+ export let shouldEnableButton = false;
9
+ </script>
10
+
11
+ <div class="body-container">
12
+ <!-- todo: support markdown? -->
13
+ <button class="btn"
14
+ disabled={!shouldEnableButton}
15
+ on:click={dismissToastCallback}>
16
+ <img class="img-icon" src={CloseIcon} alt="close button">
17
+ </button>
18
+ <div class="text-container">
19
+ <span>{props.message}</span>
20
+ </div>
21
+ </div>
22
+
23
+ <style lang="postcss">
24
+ .body-container {
25
+ display: flex;
26
+ gap: 1em;
27
+ }
28
+
29
+ .text-container {
30
+ margin-top: 0.25lh;
31
+ margin-right: 1em;
32
+ }
33
+
34
+ .text-container:dir(rtl) {
35
+ margin-left: 1em;
36
+ }
37
+
38
+ .btn {
39
+ @apply bg-surface-100 dark:bg-surface-900;
40
+ border-radius: 8px;
41
+ padding: 0.5em;
42
+ }
43
+ </style>
@@ -0,0 +1,10 @@
1
+ import DefaultToastBody from "./DefaultToastBody.svelte";
2
+
3
+ export interface Props {
4
+ message: string;
5
+ }
6
+
7
+ export interface DefaultToastPair {
8
+ component: typeof DefaultToastBody;
9
+ props: Props;
10
+ }
@@ -0,0 +1,113 @@
1
+ <script lang="ts">
2
+ import {
3
+ activeToast,
4
+ type CustomToastPairs,
5
+ DefaultToastParamsDuration,
6
+ toastQueue
7
+ } from "$pkg/components/pineapple/toast/Toast";
8
+ import { type ComponentType } from "svelte";
9
+ import Card from "$pkg/components/Card.svelte";
10
+ import { spring, tweened } from "svelte/motion";
11
+
12
+ let localComponent: ComponentType | undefined;
13
+ let localProps: CustomToastPairs["props"];
14
+
15
+ // todo: make hidden value reliant on current vh
16
+ const HIDDEN_VALUE = -15;
17
+ const SHOWN_VALUE = 0;
18
+ const progress = tweened(0, { duration: DefaultToastParamsDuration });
19
+ const position = spring(HIDDEN_VALUE);
20
+ position.damping = 0.4;
21
+ let isDismissed = false;
22
+ let shouldEnableButton = false;
23
+
24
+ const onToastDisappear = () => {
25
+ // clear the local component to undefined to make the component disappear
26
+ // also set activeToast to null to indicate to the system that it's ready to take new
27
+ // Toast requests
28
+ localComponent = undefined;
29
+ activeToast.update(() => {
30
+ if (toastQueue.length === 0) {
31
+ return undefined;
32
+ }
33
+ return toastQueue.shift();
34
+ });
35
+ };
36
+
37
+ activeToast.subscribe((params) => {
38
+ if (!params) {
39
+ return;
40
+ }
41
+
42
+ if (params.componentAndProps?.component === localComponent) {
43
+ return;
44
+ }
45
+
46
+ localComponent = params.componentAndProps.component;
47
+ localProps = params.componentAndProps.props;
48
+
49
+ // todo: make unnested
50
+ // set progress to 0 before showing
51
+ progress.set(0, { duration: 0 }).then(() => {
52
+ // animate showing the toast
53
+ position.set(SHOWN_VALUE).then(() => {
54
+ shouldEnableButton = true;
55
+
56
+ // now animate the lifespan of the current toast
57
+ progress.set(100, { delay: 500, duration: params.duration ?? DefaultToastParamsDuration }).then(() => {
58
+ // during the lifecycle the button to cause dismissal can only happen when
59
+ // position is completely set SHOWN_VALUE and when progress has reached to 100
60
+ shouldEnableButton = false;
61
+ if (isDismissed) {
62
+ return;
63
+ }
64
+
65
+ // when the lifespan duration is over, animate hiding the toast by putting its bottom
66
+ // position out of bounds
67
+ position.set(HIDDEN_VALUE).then(onToastDisappear);
68
+ });
69
+ });
70
+ });
71
+ });
72
+
73
+ const dismissToast = () => {
74
+ shouldEnableButton = false;
75
+ isDismissed = true;
76
+ position.set(HIDDEN_VALUE).then(onToastDisappear);
77
+ };
78
+ </script>
79
+
80
+ {#if (localComponent !== undefined)}
81
+ <div class="toast-positioner" style={`bottom: ${$position}lh;`}>
82
+ <!-- todo: adjust shadow to be more dynamic or transparent -->
83
+ <Card marginBottom="1lh" overrideStyle="box-shadow: 3px 3px 3px var(--shadow-color);">
84
+ <div slot="content">
85
+ {#if (localProps !== undefined)}
86
+ <svelte:component this={localComponent}
87
+ props={localProps}
88
+ dismissToastCallback={dismissToast}
89
+ shouldEnableButton={shouldEnableButton} />
90
+ {:else }
91
+ <svelte:component this={localComponent} />
92
+ {/if}
93
+ <progress id="toast-progress" value={$progress/100}></progress>
94
+ </div>
95
+ </Card>
96
+ </div>
97
+ {/if}
98
+
99
+ <style lang="postcss">
100
+ .toast-positioner {
101
+ position: fixed;
102
+ /* 12em = this component's margin (4em) + fab margin + width (8em) */
103
+ max-width: calc(100vw - 12em);
104
+ }
105
+
106
+ .toast-positioner:dir(ltr) {
107
+ left: 2em;
108
+ }
109
+
110
+ .toast-positioner:dir(rtl) {
111
+ right: 2em;
112
+ }
113
+ </style>
@@ -0,0 +1,57 @@
1
+ import { writable } from "svelte/store";
2
+ import type { DefaultToastPair } from "$pkg/components/pineapple/toast/DefaultToastBody";
3
+ import DefaultToastBody from "$pkg/components/pineapple/toast/DefaultToastBody.svelte";
4
+ import type { TestCustomToastPair } from "$pkg/components/pineapple/toast/custom-toast/TestCustomToast";
5
+
6
+ /**
7
+ * Default toast duration is 5 seconds
8
+ */
9
+ export const DefaultToastParamsDuration = 5000;
10
+
11
+ export type CustomToastPairs = DefaultToastPair
12
+ | TestCustomToastPair;
13
+
14
+ export type DismissToastCallback = () => void;
15
+
16
+ // todo: note may not be possible
17
+ export interface ToastParams {
18
+ componentAndProps: CustomToastPairs;
19
+ /**
20
+ * Time in millisecond. If undefined, defaults to DefaultToastParamsDuration
21
+ */
22
+ duration?: number;
23
+ }
24
+
25
+ /**
26
+ * todo: do not call directly documentation
27
+ */
28
+ export const activeToast = writable<ToastParams | undefined>();
29
+
30
+ export const toastQueue: ToastParams[] = [];
31
+
32
+ /**
33
+ *
34
+ * @param newToast
35
+ */
36
+ export const showComponentInToast = (newToast: ToastParams) => {
37
+ // todo: queue component
38
+ activeToast.update((currentToast) => {
39
+ if (currentToast !== undefined) {
40
+ toastQueue.push(newToast);
41
+ return currentToast;
42
+ } else {
43
+ return newToast;
44
+ }
45
+ });
46
+ };
47
+
48
+ export const showTextInToast = (message: string) => {
49
+ showComponentInToast({
50
+ componentAndProps: {
51
+ component: DefaultToastBody,
52
+ props: {
53
+ message
54
+ }
55
+ }
56
+ });
57
+ };
@@ -0,0 +1 @@
1
+ <h1>Testing bad custom card</h1>
@@ -0,0 +1,6 @@
1
+ import TestCustomToast from "./TestCustomToast.svelte";
2
+
3
+ export interface TestCustomToastPair {
4
+ component: typeof TestCustomToast;
5
+ props: undefined;
6
+ }
package/src/lib/consts.ts CHANGED
@@ -1,2 +1,2 @@
1
- export const ItchBadgeHotLink = "https://static.itch.io/images/badge.svg";
2
- export const ItchLogoHotLink = "https://static.itch.io/images/itchio-textless-black.svg";
1
+ export const ItchBadgeHotLink = "https://static.itch.io/images/badge.svg";
2
+ export const ItchLogoHotLink = "https://static.itch.io/images/itchio-textless-black.svg";
package/src/lib/index.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { default as PineappleLayoutBase } from "./components/layouts/PineappleBaseLayout.svelte";
1
+ export { default as PineappleLayoutBase } from "./components/pineapple/PineappleBaseLayout.svelte";
2
2
  export { default as SeaweedTemplate } from "./template/SeaweedTemplate.svelte";
3
3
  export { default as LazyAsset } from "./components/LazyAsset.svelte";
4
4
 
@@ -1,3 +1,3 @@
1
- // from https://stackoverflow.com/a/63885623/17836168
2
- declare module "./app.postcss";
3
- declare module "./theme.postcss";
1
+ // from https://stackoverflow.com/a/63885623/17836168
2
+ declare module "./app.postcss";
3
+ declare module "./theme.postcss";
@@ -1 +1 @@
1
- /* todo: delete if unneeded */
1
+ /* todo: delete if unneeded */
@@ -5,7 +5,7 @@
5
5
  --theme-font-family-base: system-ui;
6
6
  --theme-font-family-heading: system-ui;
7
7
  --theme-font-color-base: var(--color-primary-900);
8
- --theme-font-color-dark: var(--color-primary-100);
8
+ --theme-font-color-dark: var(--color-primary-50);
9
9
  --theme-rounded-base: 24px;
10
10
  --theme-rounded-container: 16px;
11
11
  --theme-border-base: 2px;
@@ -99,6 +99,7 @@
99
99
  --color-surface-800: 153 148 136; /* ⬅ #999488 */
100
100
  --color-surface-900: 125 121 111; /* ⬅ #7d796f */
101
101
  /* text color | #3f312f */
102
+ --color-text-25: 237 234 234; /* ⬅ #e2e0e0 */
102
103
  --color-text-50: 226 224 224; /* ⬅ #e2e0e0 */
103
104
  --color-text-100: 217 214 213; /* ⬅ #d9d6d5 */
104
105
  --color-text-200: 207 204 203; /* ⬅ #cfcccb */
@@ -1,5 +1,5 @@
1
- export const createGoToFunction = (path: string): (() => void) => {
2
- return (() => {
3
- location.href = path;
4
- });
5
- };
1
+ export const createGoToFunction = (path: string): (() => void) => {
2
+ return (() => {
3
+ location.href = path;
4
+ });
5
+ };
@@ -1,5 +1,5 @@
1
1
  <script lang="ts">
2
- import PinyaBaseLayout from "$lib/components/layouts/PineappleBaseLayout.svelte";
2
+ import PinyaBaseLayout from "$pkg/components/pineapple/PineappleBaseLayout.svelte";
3
3
  import { PUBLIC_CRINGE_USERNAME } from "$env/static/public";
4
4
  </script>
5
5
 
@@ -0,0 +1,36 @@
1
+ <script>
2
+ import { PUBLIC_CRINGE_USERNAME } from "$env/static/public";
3
+
4
+ import { createGoToFunction } from "$pkg/util/create_go_to_function";
5
+ import PineappleBaseLayout from "$pkg/components/pineapple/PineappleBaseLayout.svelte";
6
+ </script>
7
+
8
+ <svelte:head>
9
+ <title>Welcome to {PUBLIC_CRINGE_USERNAME}'s Home</title>
10
+ <meta content="Welcome to {PUBLIC_CRINGE_USERNAME}'s Home" name="og:title" />
11
+ <meta
12
+ content="Welcome to {PUBLIC_CRINGE_USERNAME}'s home! It's a neat place to be at if you're feeling lost. Come hang around!"
13
+ name="og:description"
14
+ />
15
+ </svelte:head>
16
+
17
+ <div class="card default-card">
18
+ <h1 class="mb-8">Directory</h1>
19
+
20
+ <div class="btn-group-vertical variant-filled-secondary">
21
+ <button on:click={createGoToFunction("pineapple")}><h2>Personal</h2></button>
22
+ <button on:click={createGoToFunction("portfolio")}><h2>Portfolio</h2></button>
23
+ </div>
24
+ </div>
25
+
26
+ <style lang="postcss">
27
+ .btn-group-vertical button {
28
+ padding: 2em;
29
+ }
30
+
31
+ .default-card {
32
+ text-align: center;
33
+ padding-inline-end: 0;
34
+ @apply p-16;
35
+ }
36
+ </style>
@@ -0,0 +1,44 @@
1
+ <script lang="ts">
2
+ import { PUBLIC_CRINGE_USERNAME } from "$env/static/public";
3
+ import { showComponentInToast, showTextInToast } from "$pkg/components/pineapple/toast/Toast";
4
+ import TestCard from "$pkg/components/pineapple/toast/custom-toast/TestCustomToast.svelte";
5
+
6
+ let testingQueueNumber = 1;
7
+ const testingRandomPhrases = [
8
+ "Niko",
9
+ "Niko the Baikal seal",
10
+ "Niko the Baikal seal\nfrom Toba Aquarium"
11
+ ];
12
+ </script>
13
+
14
+ <svelte:head>
15
+ <title>Welcome to {PUBLIC_CRINGE_USERNAME}'s Home</title>
16
+ <meta content="Welcome to {PUBLIC_CRINGE_USERNAME}'s Home" name="og:title" />
17
+ <meta
18
+ content="Welcome to {PUBLIC_CRINGE_USERNAME}'s home! It's a neat place to be at if you're feeling lost. Come hang around!"
19
+ name="og:description"
20
+ />
21
+ </svelte:head>
22
+
23
+ <div class="card default-card">
24
+
25
+ <button
26
+ class="btn variant-filled-secondary"
27
+ on:click={() => {
28
+ showComponentInToast({componentAndProps: {component: TestCard, props: undefined}});
29
+ }}><h3>Test custom toast</h3></button>
30
+ <button
31
+ class="btn variant-filled-secondary"
32
+ on:click={() => {
33
+ showTextInToast(`${testingQueueNumber} ${testingRandomPhrases[testingQueueNumber]}`);
34
+ testingQueueNumber = (testingQueueNumber + 1) % testingRandomPhrases.length;
35
+ }}><h3>Handy toast</h3></button>
36
+ </div>
37
+
38
+ <style lang="postcss">
39
+ .default-card {
40
+ display: flex;
41
+ flex-wrap: wrap;
42
+ gap: 2em;
43
+ }
44
+ </style>
@@ -0,0 +1,10 @@
1
+ <script lang="ts">
2
+ import { initializeStores } from "@skeletonlabs/skeleton";
3
+ import { Modal } from "@skeletonlabs/skeleton";
4
+
5
+ initializeStores();
6
+ </script>
7
+
8
+ <Modal />
9
+
10
+ <slot />
@@ -1,4 +1,4 @@
1
- import type {PageLoad} from './$types';
1
+ import type {PageLoad} from '../../../../.svelte-kit/types/src/routes';
2
2
  import * as htmlparser2 from "htmlparser2";
3
3
  import {DomUtils} from "htmlparser2";
4
4
 
@@ -1,5 +1,5 @@
1
1
  <script>
2
- import SeaweedTemplate from "$lib/template/SeaweedTemplate.svelte";
2
+ import SeaweedTemplate from "$pkg/template/SeaweedTemplate.svelte";
3
3
  import WebThumbnailImage from "$pkg/assets/placeholder/placeholder_circle.png";
4
4
 
5
5
  export let metaWebsite = "https://www.crouton.com/test/portfolio-base-layout";
@@ -17,4 +17,4 @@
17
17
  </svelte:head>
18
18
 
19
19
  <!--todo: maybe add check that this is always false? -->
20
- <SeaweedTemplate letChaos={false}></SeaweedTemplate>
20
+ <SeaweedTemplate letChaos={true}></SeaweedTemplate>
@@ -1 +1 @@
1
- actual/
1
+ actual/
@@ -1,5 +1,5 @@
1
1
  <script>
2
- import SeaweedTemplate from "$lib/template/SeaweedTemplate.svelte";
2
+ import SeaweedTemplate from "$pkg/template/SeaweedTemplate.svelte";
3
3
  </script>
4
4
 
5
5
  <SeaweedTemplate name="Allan Manuba"
@@ -6,14 +6,7 @@
6
6
  // Most of your app wide CSS should be put in this file
7
7
  import "$lib/app.postcss";
8
8
 
9
-
10
- import { initializeStores } from "@skeletonlabs/skeleton";
11
- import { Modal } from "@skeletonlabs/skeleton";
12
9
  import "$lib/styles/global.css";
13
-
14
- initializeStores();
15
10
  </script>
16
11
 
17
- <Modal />
18
-
19
12
  <slot />
package/static/robots.txt CHANGED
@@ -1,5 +1,5 @@
1
- User-agent: Twitterbot
2
- Disallow:
3
-
4
- User-agent: *
5
- Disallow: /
1
+ User-agent: Twitterbot
2
+ Disallow:
3
+
4
+ User-agent: *
5
+ Disallow: /