@turnipxenon/pineapple 3.0.0 → 3.1.0-alpha.2
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/README.md +85 -0
- package/dist/components/blog_template/BlogTemplate.svelte +15 -18
- package/dist/components/blog_template/BlogTemplate.svelte.d.ts +3 -2
- package/dist/components/blog_template/BlogTemplateInner.svelte +1 -1
- package/dist/components/blog_template/BlogTemplateInner.svelte.d.ts +1 -1
- package/dist/components/dialog_manager/DialogMangerInit.d.ts +1 -1
- package/dist/components/dialog_manager/IDialogManager.d.ts +1 -1
- package/dist/components/dialog_overlay/DialogOverlay.svelte +127 -17
- package/dist/components/layouts/SeaweedBaseLayout.svelte +0 -6
- package/dist/components/pineapple/PineappleBaseLayout.svelte +0 -19
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/styles/app.css +9 -14
- package/dist/ui/components/ModalBase.svelte +74 -74
- package/dist/ui/components/accordion/PinyaAccordion.svelte +20 -20
- package/dist/ui/components/accordion/PinyaAccordionItem.svelte +28 -28
- package/dist/ui/components/randomized-background/RandomizedBackground.svelte +9 -1
- package/dist/ui/elements/CodeBlock/CodeBlock.svelte +64 -64
- package/dist/ui/elements/ImageIcon.svelte +53 -53
- package/dist/ui/elements/PinyaCard/PinyaCard.svelte +29 -0
- package/dist/ui/elements/PinyaCard/PinyaCard.svelte.d.ts +7 -0
- package/dist/ui/elements/PinyaCard/index.d.ts +2 -0
- package/dist/ui/elements/PinyaCard/index.js +2 -0
- package/dist/ui/elements/Placeholder.svelte +17 -17
- package/dist/ui/elements/TextLink.svelte +16 -16
- package/dist/ui/elements/index.d.ts +1 -1
- package/dist/ui/elements/index.js +1 -1
- package/dist/ui/elements/pinya-combobox/PinyaCombobox.svelte +34 -34
- package/dist/ui/elements/text-chip/TextChip.svelte +14 -14
- package/dist/{components/navigation_component → ui/modules/NavigationMenu}/NavigationControl.svelte +24 -20
- package/dist/{components/navigation_component/NavigationComponent.svelte → ui/modules/NavigationMenu/NavigationMenu.svelte} +69 -43
- package/dist/{components/navigation_component/NavigationComponent.svelte.d.ts → ui/modules/NavigationMenu/NavigationMenu.svelte.d.ts} +6 -6
- package/dist/{components/navigation_component → ui/modules/NavigationMenu}/PageMeta.d.ts +4 -4
- package/dist/ui/modules/NavigationMenu/index.d.ts +2 -0
- package/dist/ui/modules/NavigationMenu/index.js +2 -0
- package/dist/ui/modules/index.d.ts +1 -1
- package/dist/ui/modules/index.js +1 -1
- package/dist/ui/modules/modals/general-settings/GeneralSettingsModal.svelte +109 -109
- package/dist/ui/modules/modals/general-settings/LanguagePicker.svelte +42 -42
- package/dist/ui/modules/projects/Pengi.svelte +61 -61
- package/dist/ui/modules/projects/ThisWebpage.svelte +10 -8
- package/dist/ui/templates/PinyaPageLayout/PinyaPageLayout.svelte +2 -1
- package/dist/ui/templates/PinyaPageLayout/runes.svelte.d.ts +3 -0
- package/dist/ui/templates/PinyaPageLayout/runes.svelte.js +1 -0
- package/dist/ui/{modules/seaweed → templates/SeaweedLayout}/ChumBucket.svelte +1 -1
- package/dist/ui/templates/SeaweedLayout/EntryGroup.svelte +65 -88
- package/dist/ui/templates/SeaweedLayout/ProjectComponentProps.d.ts +1 -0
- package/dist/ui/templates/SeaweedLayout/ProjectGroupConfig.svelte +316 -316
- package/dist/ui/templates/SeaweedLayout/SeaweedLayout.md +3 -3
- package/dist/ui/templates/SeaweedLayout/SeaweedLayout.svelte +278 -276
- package/dist/ui/templates/SeaweedLayout/props.d.ts +2 -2
- package/dist/ui/templates/confirmation-modal/component.svelte +46 -46
- package/package.json +1 -1
- package/src/lib/styles/app.css +9 -14
- package/dist/components/navigation_component/index.d.ts +0 -2
- package/dist/components/navigation_component/index.js +0 -3
- package/dist/ui/elements/pinya-card/component.svelte +0 -21
- package/dist/ui/elements/pinya-card/component.svelte.d.ts +0 -7
- package/dist/ui/elements/pinya-card/index.d.ts +0 -2
- package/dist/ui/elements/pinya-card/index.js +0 -2
- package/dist/ui/modules/seaweed/index.d.ts +0 -3
- package/dist/ui/modules/seaweed/index.js +0 -4
- /package/dist/ui/elements/{pinya-card/props.d.ts → PinyaCard/PinyaCardProps.d.ts} +0 -0
- /package/dist/ui/elements/{pinya-card/props.js → PinyaCard/PinyaCardProps.js} +0 -0
- /package/dist/{components/navigation_component → ui/modules/NavigationMenu}/NavigationControl.svelte.d.ts +0 -0
- /package/dist/{components/navigation_component → ui/modules/NavigationMenu}/PageMeta.js +0 -0
- /package/dist/ui/{modules/seaweed → templates/SeaweedLayout}/ChumBucket.svelte.d.ts +0 -0
package/README.md
CHANGED
|
@@ -26,3 +26,88 @@ yarn build
|
|
|
26
26
|
You can preview the production build with `yarn preview`.
|
|
27
27
|
|
|
28
28
|
> To deploy your app, you may need to install an [adapter](https://kit.svelte.dev/docs/adapters) for your target environment.
|
|
29
|
+
|
|
30
|
+
## Installing as a package
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
yarn add @turnipxenon2/pineapple
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
**Manual steps**
|
|
37
|
+
|
|
38
|
+
We still have to do some manual set up to our project to make it work.
|
|
39
|
+
|
|
40
|
+
1. **Configure Tailwind.** Open your global stylesheet in `/src/app.css` and add the following imports:
|
|
41
|
+
|
|
42
|
+
```css
|
|
43
|
+
@import 'tailwindcss';
|
|
44
|
+
@import '@skeletonlabs/skeleton/optional/presets';
|
|
45
|
+
@import '@skeletonlabs/skeleton';
|
|
46
|
+
@import '@skeletonlabs/skeleton/themes/cerberus';
|
|
47
|
+
@import '../node_modules/@turnipxenon/pineapple/dist/styles/app.css';
|
|
48
|
+
|
|
49
|
+
@plugin '@tailwindcss/forms';
|
|
50
|
+
@plugin '@tailwindcss/typography';
|
|
51
|
+
|
|
52
|
+
@source '../node_modules/@skeletonlabs/skeleton-svelte/dist';
|
|
53
|
+
@source '../node_modules/@turnipxenon/pineapple/dist/styles'
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
2. **Set Active Theme.** Open /src/app.html, then set the data-theme attribute on the HTML tag to define the active theme.
|
|
57
|
+
|
|
58
|
+
```html
|
|
59
|
+
<html lang="en" data-theme="turnip">
|
|
60
|
+
...
|
|
61
|
+
</html>
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
3. We have to setup +layout.svelte to and import some dependencies
|
|
65
|
+
|
|
66
|
+
As a reference as to why we need to do above, we use the UI framework Skeleton, which has the same setup. But, we have to make some modifications to make our project and Skeleton to work as a package.
|
|
67
|
+
|
|
68
|
+
**Reference**
|
|
69
|
+
|
|
70
|
+
- https://next.skeleton.dev/docs/get-started/installation/sveltekit
|
|
71
|
+
- https://inlang.com/m/gerre34r/library-inlang-paraglideJs/sveltekit
|
|
72
|
+
|
|
73
|
+
- Just use skeleton or use the base project?
|
|
74
|
+
|
|
75
|
+
**Current steps how to use this package in another project**
|
|
76
|
+
|
|
77
|
+
1. Create using Skeleton: https://next.skeleton.dev/docs/get-started/installation/sveltekit
|
|
78
|
+
2. Follow instructions and skeleton UI package
|
|
79
|
+
3. Install pineapple
|
|
80
|
+
4. Set up ModeWatcher and Modals, primarily in +layout.svelte
|
|
81
|
+
5. Set up ParaglideJS internationalization (beta not SvelteKit)
|
|
82
|
+
6. Add this to `+layout.svelte`
|
|
83
|
+
|
|
84
|
+
```sveltehtml
|
|
85
|
+
<script lang="ts">
|
|
86
|
+
import { PinyaPageLayout, PinyaBase } from '@turnipxenon/pineapple/templates';
|
|
87
|
+
import '../app.css';
|
|
88
|
+
|
|
89
|
+
let { children } = $props();
|
|
90
|
+
</script>
|
|
91
|
+
|
|
92
|
+
<PinyaBase>
|
|
93
|
+
<PinyaPageLayout>
|
|
94
|
+
{@render children()}
|
|
95
|
+
</PinyaPageLayout>
|
|
96
|
+
</PinyaBase>
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
TODO: if we are happy with our base, publish it to github and link the corresponding git commits here
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
## Local linking
|
|
103
|
+
|
|
104
|
+
1. In pineapple, run `yarn link`
|
|
105
|
+
2. In seaweed2, run `yarn unlink @turnipxenon/pineapple`
|
|
106
|
+
|
|
107
|
+
**To unlink:**
|
|
108
|
+
|
|
109
|
+
1. In seaweed2, run `yarn unlink @turnipxenon/pineapple`
|
|
110
|
+
2. In pineapple, run `yarn unlink`
|
|
111
|
+
3. **If unlinking, remember to restart PC cause Windows symlinking is tricky**
|
|
112
|
+
|
|
113
|
+
To reinstall a single package: `yarn add @turnipxenon/pineapple --no-package-lock --no-save`
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import "./blog-template.css";
|
|
3
|
-
import {
|
|
4
|
-
import { onDestroy, onMount } from "svelte";
|
|
3
|
+
import { onDestroy, onMount, type Snippet } from "svelte";
|
|
5
4
|
import BlogTemplateInner from "./BlogTemplateInner.svelte";
|
|
6
|
-
import type { SimplePageMeta } from "
|
|
5
|
+
import type { SimplePageMeta } from "../../ui/modules/NavigationMenu/index";
|
|
7
6
|
import { enableDialogueOverlay } from "../dialog_manager/DialogManagerStore";
|
|
8
|
-
import
|
|
7
|
+
import PinyaCard from "../../ui/elements/PinyaCard/PinyaCard.svelte";
|
|
8
|
+
import { appState } from "../../ui/templates/index";
|
|
9
9
|
|
|
10
10
|
// grab page meta from the adjacent meta.json
|
|
11
11
|
interface Props {
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
shouldFillWholePage?: boolean;
|
|
14
14
|
shouldEnableDialogOverlay?: boolean;
|
|
15
15
|
includeDataNoSnippet?: boolean;
|
|
16
|
-
children?:
|
|
16
|
+
children?: Snippet;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
let {
|
|
@@ -24,7 +24,6 @@
|
|
|
24
24
|
children
|
|
25
25
|
}: Props = $props();
|
|
26
26
|
|
|
27
|
-
enableBackground.set(!shouldFillWholePage);
|
|
28
27
|
let initialDialogState = false;
|
|
29
28
|
|
|
30
29
|
onMount(() => {
|
|
@@ -33,10 +32,11 @@
|
|
|
33
32
|
});
|
|
34
33
|
|
|
35
34
|
onDestroy(() => {
|
|
36
|
-
|
|
35
|
+
appState.bgOpacity = 1;
|
|
37
36
|
enableDialogueOverlay.set(initialDialogState);
|
|
38
37
|
});
|
|
39
38
|
|
|
39
|
+
appState.bgOpacity = shouldFillWholePage ? 0.2 : 1;
|
|
40
40
|
</script>
|
|
41
41
|
|
|
42
42
|
{#if shouldFillWholePage}
|
|
@@ -46,21 +46,18 @@
|
|
|
46
46
|
</BlogTemplateInner>
|
|
47
47
|
</div>
|
|
48
48
|
{:else}
|
|
49
|
-
<
|
|
50
|
-
{
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
</BlogTemplateInner>
|
|
55
|
-
</div>
|
|
56
|
-
{/snippet}
|
|
57
|
-
</Card>
|
|
49
|
+
<PinyaCard {includeDataNoSnippet} widthClass="max-w-4xl">
|
|
50
|
+
<BlogTemplateInner pageMeta={pageMeta}>
|
|
51
|
+
{@render children?.()}
|
|
52
|
+
</BlogTemplateInner>
|
|
53
|
+
</PinyaCard>
|
|
58
54
|
{/if}
|
|
59
55
|
|
|
60
56
|
<style>
|
|
61
57
|
.whole-page {
|
|
62
|
-
height:
|
|
58
|
+
height: 100vh;
|
|
63
59
|
width: 100%;
|
|
64
|
-
|
|
60
|
+
padding-right: 2em;
|
|
61
|
+
padding-left: 2em;
|
|
65
62
|
}
|
|
66
63
|
</style>
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import "./blog-template.css";
|
|
2
|
-
import type
|
|
2
|
+
import { type Snippet } from "svelte";
|
|
3
|
+
import type { SimplePageMeta } from "../../ui/modules/NavigationMenu/index";
|
|
3
4
|
interface Props {
|
|
4
5
|
pageMeta: SimplePageMeta;
|
|
5
6
|
shouldFillWholePage?: boolean;
|
|
6
7
|
shouldEnableDialogOverlay?: boolean;
|
|
7
8
|
includeDataNoSnippet?: boolean;
|
|
8
|
-
children?:
|
|
9
|
+
children?: Snippet;
|
|
9
10
|
}
|
|
10
11
|
declare const BlogTemplate: import("svelte").Component<Props, {}, "">;
|
|
11
12
|
type BlogTemplate = ReturnType<typeof BlogTemplate>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { IDialogManager } from "./IDialogManager";
|
|
2
|
-
export declare const getDialogManager: () => Promise<IDialogManager>;
|
|
2
|
+
export declare const getDialogManager: () => Promise<IDialogManager | undefined>;
|
|
@@ -13,7 +13,7 @@ export interface IDialogManager {
|
|
|
13
13
|
currentIndex: number;
|
|
14
14
|
previousTimestamp: number;
|
|
15
15
|
isDoneTransition: boolean;
|
|
16
|
-
currentPortrait: Writable<
|
|
16
|
+
currentPortrait: Writable<string>;
|
|
17
17
|
portraitMap: Map<string, any>;
|
|
18
18
|
currentState: DialogState;
|
|
19
19
|
currentReadableState: Writable<DialogState>;
|
|
@@ -4,9 +4,17 @@
|
|
|
4
4
|
import { DialogState } from "../../types/pineapple_fiber/DialogState";
|
|
5
5
|
import { getDialogManager } from "../dialog_manager/DialogMangerInit";
|
|
6
6
|
import type { IDialogManager } from "../dialog_manager/IDialogManager";
|
|
7
|
+
import PinyaCard from "../../ui/elements/PinyaCard/PinyaCard.svelte";
|
|
8
|
+
import { appState } from "../../ui/templates/index";
|
|
9
|
+
import CloseIcon from "../../assets/icons/close.svg";
|
|
10
|
+
import FABIcon from "../../assets/bg_tiled/bg_tiled_turnip.png";
|
|
11
|
+
import { enableDialogueOverlay } from "../dialog_manager/DialogManagerStore";
|
|
12
|
+
import { PinyaButton } from "../../ui/elements/index";
|
|
13
|
+
import { slide } from "svelte/transition";
|
|
7
14
|
|
|
8
15
|
let currentMessage = $state("");
|
|
9
16
|
let currentPortrait = $state(AresHappy);
|
|
17
|
+
let isMounted = $state(false);
|
|
10
18
|
|
|
11
19
|
let hidePercent = $state(100);
|
|
12
20
|
let isHidden = $state(true);
|
|
@@ -36,6 +44,7 @@
|
|
|
36
44
|
});
|
|
37
45
|
|
|
38
46
|
dialogManager.update(0);
|
|
47
|
+
isMounted = true;
|
|
39
48
|
});
|
|
40
49
|
|
|
41
50
|
});
|
|
@@ -44,6 +53,12 @@
|
|
|
44
53
|
dialogManager?.skipAnimation();
|
|
45
54
|
};
|
|
46
55
|
|
|
56
|
+
let enableDialogueOverlayValue = $state(true);
|
|
57
|
+
enableDialogueOverlay.subscribe((value) => {
|
|
58
|
+
enableDialogueOverlayValue = value;
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
enableDialogueOverlay.set(appState.enableDialogOnByDefault ?? false);
|
|
47
62
|
</script>
|
|
48
63
|
|
|
49
64
|
<div class="dialog-elements"
|
|
@@ -53,18 +68,64 @@
|
|
|
53
68
|
<div class="dialog-portrait-container">
|
|
54
69
|
<img src={currentPortrait} alt="Ares" class="dialog-portrait" />
|
|
55
70
|
</div>
|
|
56
|
-
<div
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
71
|
+
<div
|
|
72
|
+
tabindex="0"
|
|
73
|
+
role="button"
|
|
74
|
+
class="dialog-box"
|
|
75
|
+
onclick={onDialogClick}
|
|
76
|
+
onkeyup={(e) => {
|
|
77
|
+
if (e.key === 'j') {
|
|
78
|
+
onDialogClick()
|
|
79
|
+
; }
|
|
80
|
+
}}
|
|
81
|
+
>
|
|
82
|
+
<PinyaCard
|
|
83
|
+
widthClass=""
|
|
84
|
+
paddingClass=""
|
|
85
|
+
className="dialog-name"
|
|
86
|
+
>
|
|
87
|
+
<div>
|
|
88
|
+
<b class="fake-h1">Turnip</b>
|
|
89
|
+
</div>
|
|
90
|
+
</PinyaCard>
|
|
91
|
+
<PinyaCard
|
|
92
|
+
widthClass="w-full"
|
|
93
|
+
className="dialog-text"
|
|
94
|
+
>
|
|
61
95
|
<!-- Made for 140 characters, like the original tweets -->
|
|
62
96
|
{@html currentMessage}
|
|
63
|
-
</
|
|
97
|
+
</PinyaCard>
|
|
64
98
|
</div>
|
|
65
99
|
</div>
|
|
66
100
|
|
|
101
|
+
|
|
102
|
+
{#if appState.allowDialog && isMounted}
|
|
103
|
+
<div class="fab-container" in:slide>
|
|
104
|
+
<PinyaButton
|
|
105
|
+
classes="fab"
|
|
106
|
+
onclick={()=>{
|
|
107
|
+
getDialogManager().then(dm => dm.toggleDialogOverlay());
|
|
108
|
+
}}>
|
|
109
|
+
{#if (enableDialogueOverlayValue)}
|
|
110
|
+
<img class="turnip-icon" src={CloseIcon} alt="interactive floating action button represented as a turnip">
|
|
111
|
+
{:else }
|
|
112
|
+
<img class="turnip-icon" src={FABIcon} alt="interactive floating action button represented as a turnip">
|
|
113
|
+
{/if}
|
|
114
|
+
</PinyaButton>
|
|
115
|
+
</div>
|
|
116
|
+
{/if}
|
|
117
|
+
|
|
67
118
|
<style>
|
|
119
|
+
:global(.dialog-text) {
|
|
120
|
+
height: 100%;
|
|
121
|
+
padding: 1.2lh 2rem 0.5lh;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
:global(.dialog-box *,.dialog-name *) {
|
|
125
|
+
font-size: clamp(1em, 5vw, 1.3em);
|
|
126
|
+
line-height: 1.5em;
|
|
127
|
+
}
|
|
128
|
+
|
|
68
129
|
.dialog-elements {
|
|
69
130
|
position: fixed;
|
|
70
131
|
z-index: 10;
|
|
@@ -82,11 +143,6 @@
|
|
|
82
143
|
transform: translateY(var(--hidePercentHeight));
|
|
83
144
|
}
|
|
84
145
|
|
|
85
|
-
.dialog-box *,
|
|
86
|
-
.dialog-name * {
|
|
87
|
-
font-size: clamp(1em, 5vw, 1.3em);
|
|
88
|
-
line-height: 1.5em;
|
|
89
|
-
}
|
|
90
146
|
|
|
91
147
|
.dialog-padding :global(p) {
|
|
92
148
|
font-size: clamp(1em, 5vw, 1.3em) !important;
|
|
@@ -97,19 +153,18 @@
|
|
|
97
153
|
padding: clamp(1.5em, 5vw, 1.75em) clamp(0em, 5vw - 0.5em, 2em) 0;
|
|
98
154
|
}
|
|
99
155
|
|
|
100
|
-
.dialog-name {
|
|
101
|
-
padding-
|
|
102
|
-
padding-
|
|
103
|
-
padding-right: 4rem;
|
|
156
|
+
:global(.dialog-name) {
|
|
157
|
+
padding-left: 2rem;
|
|
158
|
+
padding-right: 2rem;
|
|
104
159
|
position: fixed;
|
|
105
160
|
}
|
|
106
161
|
|
|
107
|
-
.dialog-name:dir(ltr) {
|
|
162
|
+
:global(.dialog-name:dir(ltr)) {
|
|
108
163
|
/* for centering vertically */
|
|
109
164
|
transform: translateX(clamp(0em, 5vw - 0.5em, 1em)) translateY(-50%);
|
|
110
165
|
}
|
|
111
166
|
|
|
112
|
-
.dialog-name:dir(rtl) {
|
|
167
|
+
:global(.dialog-name:dir(rtl)) {
|
|
113
168
|
/* for centering vertically */
|
|
114
169
|
transform: translateX(calc(clamp(0em, 5vw - 0.5em, 1em) * -1)) translateY(-50%);
|
|
115
170
|
}
|
|
@@ -138,4 +193,59 @@
|
|
|
138
193
|
.dialog-portrait:dir(rtl) {
|
|
139
194
|
transform: scaleX(-1);
|
|
140
195
|
}
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
.dialog-box {
|
|
199
|
+
background-color: var(--color-surface-500);
|
|
200
|
+
position: fixed;
|
|
201
|
+
bottom: 0;
|
|
202
|
+
width: var(--dialog-box-width); /*75em + 4em padding*/
|
|
203
|
+
height: var(--dialog-box-height);
|
|
204
|
+
max-width: calc(100vw - ((var(--fab-margin) * 2) + 4em));
|
|
205
|
+
border-radius: 1rem;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
.dark .dialog-box {
|
|
209
|
+
background-color: rgb(var(--color-surface-900) / 0.95);
|
|
210
|
+
--tw-ring-color: rgb(var(--color-text-400));
|
|
211
|
+
/*background-color: red;*/
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
:global(.fab) {
|
|
215
|
+
/*@apply btn preset-filled-tertiary-500;*/
|
|
216
|
+
background-color: var(--color-tertiary-500);
|
|
217
|
+
padding: 0.3rem;
|
|
218
|
+
width: 4em;
|
|
219
|
+
border-radius: 50%;
|
|
220
|
+
z-index: 100;
|
|
221
|
+
box-shadow: 3px 3px 3px var(--shadow-color);
|
|
222
|
+
margin-bottom: var(--fab-margin);
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
.fab-container {
|
|
226
|
+
position: fixed;
|
|
227
|
+
bottom: 0;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
.fab-container:dir(ltr) {
|
|
231
|
+
right: 0;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
.fab-container:dir(rtl) {
|
|
235
|
+
left: 0;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
:global(.fab > img) {
|
|
239
|
+
width: 100%;
|
|
240
|
+
filter: brightness(0) invert(1);
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
:global(.fab:dir(ltr)) {
|
|
244
|
+
margin-right: var(--fab-margin);
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
:global(.fab:dir(rtl)) {
|
|
248
|
+
margin-left: var(--fab-margin);
|
|
249
|
+
}
|
|
250
|
+
|
|
141
251
|
</style>
|
|
@@ -90,12 +90,6 @@
|
|
|
90
90
|
</div>
|
|
91
91
|
|
|
92
92
|
<style>
|
|
93
|
-
:root {
|
|
94
|
-
--dialog-start-pad: clamp(0em, 5vw, 2em);
|
|
95
|
-
--dialog-box-width: min(calc(50em + 4em), calc(100vw - var(--dialog-start-pad) - var(--theme-border-base)));
|
|
96
|
-
--dialog-box-height: clamp(15em, 50vw, 18em);
|
|
97
|
-
}
|
|
98
|
-
|
|
99
93
|
.default-page-container {
|
|
100
94
|
max-width: 2100px;
|
|
101
95
|
margin: 4em auto;
|
|
@@ -137,25 +137,6 @@
|
|
|
137
137
|
</div>
|
|
138
138
|
|
|
139
139
|
<style>
|
|
140
|
-
:root {
|
|
141
|
-
--dialog-start-pad: clamp(0em, 5vw, 2em);
|
|
142
|
-
--dialog-box-width: min(calc(50em + 4em), calc(100vw - var(--dialog-start-pad) - var(--theme-border-base)));
|
|
143
|
-
--dialog-box-height: clamp(15em, 50vw, 18em);
|
|
144
|
-
|
|
145
|
-
/** FAB icon margin/position calculation origin:
|
|
146
|
-
Criteria:
|
|
147
|
-
- We want at mobile (360px) our margin to be at 1em (16px)
|
|
148
|
-
- We want at web (1960px) our margin to be at 2em (32px)
|
|
149
|
-
|
|
150
|
-
A useful scaling factor might vw. At 360px, 16px would be around 4.44vw (360/16).
|
|
151
|
-
At 360px: margin is at 16px or 1em.
|
|
152
|
-
At 1960px: 4.44vw is at 87px but that will be clamped to 32px or 2em.
|
|
153
|
-
The calculation implies that the natural point that the margin becomes 2em is clamped on
|
|
154
|
-
wider screens is at 727px.
|
|
155
|
-
*/
|
|
156
|
-
--fab-margin: clamp(1em, 4.44vw, 2em);
|
|
157
|
-
}
|
|
158
|
-
|
|
159
140
|
/*todo*/
|
|
160
141
|
/*@apply flex justify-center items-center;*/
|
|
161
142
|
.default-page-container {
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { default as PineappleLayoutBase } from "./components/pineapple/PineappleBaseLayout.svelte";
|
|
2
2
|
export * from "./components/index";
|
|
3
3
|
export * from "./components/overrideable_meta/index";
|
|
4
|
-
export * from "./
|
|
4
|
+
export * from "./ui/modules/NavigationMenu/index";
|
|
5
5
|
export * from "./types/api/index";
|
|
6
6
|
export * from "./components/dialog_manager/DialogManagerStore";
|
|
7
7
|
export * from "./components/dialog_manager/DialogManager";
|
package/dist/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
export { default as PineappleLayoutBase } from "./components/pineapple/PineappleBaseLayout.svelte";
|
|
3
3
|
export * from "./components/index";
|
|
4
4
|
export * from "./components/overrideable_meta/index";
|
|
5
|
-
export * from "./
|
|
5
|
+
export * from "./ui/modules/NavigationMenu/index";
|
|
6
6
|
export * from "./types/api/index";
|
|
7
7
|
export * from "./components/dialog_manager/DialogManagerStore";
|
|
8
8
|
export * from "./components/dialog_manager/DialogManager";
|
package/dist/styles/app.css
CHANGED
|
@@ -10,16 +10,25 @@
|
|
|
10
10
|
|
|
11
11
|
@custom-variant turnip (&:where([data-theme=turnip], [data-theme=turnip] *));
|
|
12
12
|
|
|
13
|
+
html {
|
|
14
|
+
--dialog-start-pad: clamp(0em, 5vw, 2em);
|
|
15
|
+
--dialog-box-width: min(calc(54em), calc(100vw - var(--dialog-start-pad) - 2px));
|
|
16
|
+
--dialog-box-height: clamp(15em, 50vw, 18em);
|
|
17
|
+
--fab-margin: 1rem;
|
|
18
|
+
}
|
|
19
|
+
|
|
13
20
|
.footer-space {
|
|
14
21
|
width: 100%;
|
|
15
22
|
height: calc(var(--dialog-box-height) + 4em);
|
|
16
23
|
}
|
|
17
24
|
|
|
18
25
|
a.dialog-choice {
|
|
26
|
+
font-size: inherit;
|
|
19
27
|
cursor: url("$pkg/assets/icons/chat-cursor.svg"), auto;
|
|
20
28
|
}
|
|
21
29
|
|
|
22
30
|
a.external-link {
|
|
31
|
+
font-size: inherit;
|
|
23
32
|
cursor: url("$pkg/assets/icons/external-link.svg"), auto;
|
|
24
33
|
}
|
|
25
34
|
|
|
@@ -37,20 +46,6 @@ a.external-link {
|
|
|
37
46
|
background: rgba(var(--color-secondary-500));
|
|
38
47
|
}
|
|
39
48
|
|
|
40
|
-
.dialog-box {
|
|
41
|
-
background-color: rgb(var(--color-surface-500) / 0.9);
|
|
42
|
-
position: fixed;
|
|
43
|
-
bottom: 0;
|
|
44
|
-
width: var(--dialog-box-width); /*75em + 4em padding*/
|
|
45
|
-
height: var(--dialog-box-height);
|
|
46
|
-
max-width: calc(100vw - ((var(--fab-margin) * 2) + 4em));
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
.dark .dialog-box {
|
|
50
|
-
background-color: rgb(var(--color-surface-900) / 0.95);
|
|
51
|
-
--tw-ring-color: rgb(var(--color-text-400));
|
|
52
|
-
/*background-color: red;*/
|
|
53
|
-
}
|
|
54
49
|
|
|
55
50
|
@layer base {
|
|
56
51
|
.game-link-section {
|
|
@@ -1,75 +1,75 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { scale } from 'svelte/transition';
|
|
3
|
-
import { elasticOut } from 'svelte/easing';
|
|
4
|
-
|
|
5
|
-
import type { ModalProps } from 'svelte-modals';
|
|
6
|
-
|
|
7
|
-
import { onMount, type Snippet } from 'svelte';
|
|
8
|
-
import { PinyaCard } from '../elements';
|
|
9
|
-
|
|
10
|
-
// https://svelte-modals.mattjennin.gs/modal-components/props/#typescript
|
|
11
|
-
interface ModalBaseProps extends ModalProps {
|
|
12
|
-
children: Snippet,
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
let {
|
|
16
|
-
children,
|
|
17
|
-
isOpen,
|
|
18
|
-
close
|
|
19
|
-
}: ModalBaseProps = $props();
|
|
20
|
-
|
|
21
|
-
let container: HTMLDivElement;
|
|
22
|
-
onMount(() => {
|
|
23
|
-
const focusableElement = container.querySelector('input, select, textarea, button, object, a, area[href], [tabindex]');
|
|
24
|
-
if (focusableElement) {
|
|
25
|
-
(focusableElement as HTMLElement).focus();
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
document.addEventListener('keydown', (e) => {
|
|
29
|
-
if (e.code === 'Escape') {
|
|
30
|
-
close();
|
|
31
|
-
}
|
|
32
|
-
});
|
|
33
|
-
});
|
|
34
|
-
</script>
|
|
35
|
-
|
|
36
|
-
{#if isOpen}
|
|
37
|
-
<dialog aria-modal="true" in:scale|global={{
|
|
38
|
-
start: 0.95,
|
|
39
|
-
duration: 750,
|
|
40
|
-
easing: elasticOut,
|
|
41
|
-
opacity: 0.9
|
|
42
|
-
}}>
|
|
43
|
-
<div class="interactable" bind:this={container}>
|
|
44
|
-
<PinyaCard
|
|
45
|
-
widthClass="max-w-xl2"
|
|
46
|
-
paddingClass="pl-8 pr-8 pt-4 pb-8"
|
|
47
|
-
>
|
|
48
|
-
{@render children?.()}
|
|
49
|
-
</PinyaCard>
|
|
50
|
-
</div>
|
|
51
|
-
</dialog>
|
|
52
|
-
{/if}
|
|
53
|
-
|
|
54
|
-
<style>
|
|
55
|
-
dialog {
|
|
56
|
-
padding: 0;
|
|
57
|
-
background-color: transparent;
|
|
58
|
-
border-color: transparent;
|
|
59
|
-
z-index: 20;
|
|
60
|
-
position: fixed;
|
|
61
|
-
top: 0;
|
|
62
|
-
width: 100%;
|
|
63
|
-
height: 100%;
|
|
64
|
-
display: flex;
|
|
65
|
-
justify-content: center;
|
|
66
|
-
align-items: center;
|
|
67
|
-
|
|
68
|
-
/* allow click-through to backdrop */
|
|
69
|
-
pointer-events: none;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
.interactable {
|
|
73
|
-
pointer-events: auto;
|
|
74
|
-
}
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { scale } from 'svelte/transition';
|
|
3
|
+
import { elasticOut } from 'svelte/easing';
|
|
4
|
+
|
|
5
|
+
import type { ModalProps } from 'svelte-modals';
|
|
6
|
+
|
|
7
|
+
import { onMount, type Snippet } from 'svelte';
|
|
8
|
+
import { PinyaCard } from '../elements';
|
|
9
|
+
|
|
10
|
+
// https://svelte-modals.mattjennin.gs/modal-components/props/#typescript
|
|
11
|
+
interface ModalBaseProps extends ModalProps {
|
|
12
|
+
children: Snippet,
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
let {
|
|
16
|
+
children,
|
|
17
|
+
isOpen,
|
|
18
|
+
close
|
|
19
|
+
}: ModalBaseProps = $props();
|
|
20
|
+
|
|
21
|
+
let container: HTMLDivElement;
|
|
22
|
+
onMount(() => {
|
|
23
|
+
const focusableElement = container.querySelector('input, select, textarea, button, object, a, area[href], [tabindex]');
|
|
24
|
+
if (focusableElement) {
|
|
25
|
+
(focusableElement as HTMLElement).focus();
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
document.addEventListener('keydown', (e) => {
|
|
29
|
+
if (e.code === 'Escape') {
|
|
30
|
+
close();
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
});
|
|
34
|
+
</script>
|
|
35
|
+
|
|
36
|
+
{#if isOpen}
|
|
37
|
+
<dialog aria-modal="true" in:scale|global={{
|
|
38
|
+
start: 0.95,
|
|
39
|
+
duration: 750,
|
|
40
|
+
easing: elasticOut,
|
|
41
|
+
opacity: 0.9
|
|
42
|
+
}}>
|
|
43
|
+
<div class="interactable" bind:this={container}>
|
|
44
|
+
<PinyaCard
|
|
45
|
+
widthClass="max-w-xl2"
|
|
46
|
+
paddingClass="pl-8 pr-8 pt-4 pb-8"
|
|
47
|
+
>
|
|
48
|
+
{@render children?.()}
|
|
49
|
+
</PinyaCard>
|
|
50
|
+
</div>
|
|
51
|
+
</dialog>
|
|
52
|
+
{/if}
|
|
53
|
+
|
|
54
|
+
<style>
|
|
55
|
+
dialog {
|
|
56
|
+
padding: 0;
|
|
57
|
+
background-color: transparent;
|
|
58
|
+
border-color: transparent;
|
|
59
|
+
z-index: 20;
|
|
60
|
+
position: fixed;
|
|
61
|
+
top: 0;
|
|
62
|
+
width: 100%;
|
|
63
|
+
height: 100%;
|
|
64
|
+
display: flex;
|
|
65
|
+
justify-content: center;
|
|
66
|
+
align-items: center;
|
|
67
|
+
|
|
68
|
+
/* allow click-through to backdrop */
|
|
69
|
+
pointer-events: none;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.interactable {
|
|
73
|
+
pointer-events: auto;
|
|
74
|
+
}
|
|
75
75
|
</style>
|