@turnipxenon/pineapple 2.10.0 → 3.0.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/icons/icon-contrast.svg +1 -0
- package/dist/assets/icons/icon-dark-mode.svg +1 -0
- package/dist/assets/icons/icon-light-mode.svg +1 -0
- package/dist/assets/icons/icon-settings.svg +1 -0
- package/dist/components/Card.svelte +43 -41
- package/dist/components/Card.svelte.d.ts +11 -24
- package/dist/components/CarouselElement.svelte +15 -8
- package/dist/components/CarouselElement.svelte.d.ts +7 -18
- package/dist/components/ElementVisbilityDetector.svelte +23 -14
- package/dist/components/ElementVisbilityDetector.svelte.d.ts +6 -17
- package/dist/components/LazyAsset.svelte +93 -65
- package/dist/components/LazyAsset.svelte.d.ts +9 -19
- package/dist/components/PineappleSlideToggle.svelte +19 -7
- package/dist/components/PineappleSlideToggle.svelte.d.ts +8 -19
- package/dist/components/RandomizedBackground.svelte +46 -27
- package/dist/components/RandomizedBackground.svelte.d.ts +5 -15
- package/dist/components/RandomizedImage.svelte +15 -8
- package/dist/components/RandomizedImage.svelte.d.ts +6 -16
- package/dist/components/StickyElement.svelte +25 -16
- package/dist/components/StickyElement.svelte.d.ts +6 -17
- package/dist/components/ToggleableContent.svelte +88 -59
- package/dist/components/ToggleableContent.svelte.d.ts +6 -17
- package/dist/components/blog_template/BlogTemplate.svelte +45 -25
- package/dist/components/blog_template/BlogTemplate.svelte.d.ts +9 -20
- package/dist/components/blog_template/BlogTemplateInner.svelte +11 -3
- package/dist/components/blog_template/BlogTemplateInner.svelte.d.ts +6 -17
- package/dist/components/chip/Chip.svelte +33 -57
- package/dist/components/chip/Chip.svelte.d.ts +7 -18
- package/dist/components/combo_box/ComboBox.svelte +10 -4
- package/dist/components/combo_box/ComboBox.svelte.d.ts +6 -16
- package/dist/components/combo_box/ComboBoxWithButton.svelte +16 -9
- package/dist/components/combo_box/ComboBoxWithButton.svelte.d.ts +7 -17
- package/dist/components/combo_box/combo-box.postcss +2 -2
- package/dist/components/dialog_manager/DialogManager.d.ts +0 -1
- package/dist/components/dialog_manager/DialogManagerStore.d.ts +0 -1
- package/dist/components/dialog_manager/DialogManagerStore.js +1 -1
- package/dist/components/dialog_overlay/DialogOverlay.svelte +42 -34
- package/dist/components/dialog_overlay/DialogOverlay.svelte.d.ts +3 -14
- package/dist/components/index.d.ts +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/layouts/SeaweedBaseLayout.svelte +80 -43
- package/dist/components/layouts/SeaweedBaseLayout.svelte.d.ts +8 -21
- package/dist/components/navigation_component/NavigationComponent.svelte +52 -141
- package/dist/components/navigation_component/NavigationComponent.svelte.d.ts +17 -26
- package/dist/components/navigation_component/NavigationControl.svelte +52 -103
- package/dist/components/navigation_component/NavigationControl.svelte.d.ts +7 -17
- package/dist/components/overrideable_meta/OverridableMeta.svelte +37 -22
- package/dist/components/overrideable_meta/OverridableMeta.svelte.d.ts +9 -19
- package/dist/components/pineapple/PineappleBaseLayout.svelte +132 -188
- package/dist/components/pineapple/PineappleBaseLayout.svelte.d.ts +6 -17
- package/dist/components/pineapple/toast/DefaultToastBody.svelte +14 -16
- package/dist/components/pineapple/toast/DefaultToastBody.svelte.d.ts +7 -17
- package/dist/components/pineapple/toast/Toast.d.ts +0 -1
- package/dist/components/pineapple/toast/Toast.svelte +92 -64
- package/dist/components/pineapple/toast/Toast.svelte.d.ts +3 -14
- package/dist/components/pineapple/toast/custom-toast/TestCustomToast.svelte.d.ts +22 -19
- package/dist/paraglide/messages/_index.d.ts +2 -0
- package/dist/paraglide/messages/_index.js +3 -0
- package/dist/paraglide/messages/example_message.d.ts +5 -0
- package/dist/paraglide/messages/example_message.js +39 -0
- package/dist/paraglide/messages/settings.d.ts +3 -0
- package/dist/paraglide/messages/settings.js +38 -0
- package/dist/paraglide/messages.d.ts +2 -0
- package/dist/paraglide/messages.js +4 -0
- package/dist/paraglide/registry.d.ts +21 -0
- package/dist/paraglide/registry.js +31 -0
- package/dist/paraglide/runtime.d.ts +400 -0
- package/dist/paraglide/runtime.js +1060 -0
- package/dist/paraglide/server.d.ts +64 -0
- package/dist/paraglide/server.js +161 -0
- package/dist/scripts/util/FileManagement.d.ts +1 -1
- package/dist/store.d.ts +0 -1
- package/dist/styles/app.css +53 -0
- package/dist/styles/turnip-theme.css +323 -0
- package/dist/template/seaweed/CreateUrlForm.svelte +50 -38
- package/dist/template/seaweed/CreateUrlForm.svelte.d.ts +5 -15
- package/dist/template/seaweed/SeaweedTemplate.svelte +244 -195
- package/dist/template/seaweed/SeaweedTemplate.svelte.d.ts +28 -25
- package/dist/template/seaweed/entries/ChefWings.svelte +37 -39
- package/dist/template/seaweed/entries/ChefWings.svelte.d.ts +5 -15
- package/dist/template/seaweed/entries/CustomizedYarnspinner.svelte +32 -24
- package/dist/template/seaweed/entries/CustomizedYarnspinner.svelte.d.ts +5 -15
- package/dist/template/seaweed/entries/Hepcat.svelte +58 -49
- package/dist/template/seaweed/entries/Hepcat.svelte.d.ts +5 -15
- package/dist/template/seaweed/entries/Pengi.svelte +51 -43
- package/dist/template/seaweed/entries/Pengi.svelte.d.ts +5 -15
- package/dist/template/seaweed/entries/Soulwork.svelte +44 -36
- package/dist/template/seaweed/entries/Soulwork.svelte.d.ts +5 -15
- package/dist/template/seaweed/entries/ThisWebpage.svelte +47 -38
- package/dist/template/seaweed/entries/ThisWebpage.svelte.d.ts +5 -15
- package/dist/template/seaweed/entries/WorkExperience.svelte +109 -92
- package/dist/template/seaweed/entries/WorkExperience.svelte.d.ts +6 -16
- package/dist/template/seaweed/entries/Workset.svelte +51 -42
- package/dist/template/seaweed/entries/Workset.svelte.d.ts +5 -15
- package/dist/template/seaweed/entry_order_config/EntryOrderConfig.svelte +136 -259
- package/dist/template/seaweed/entry_order_config/EntryOrderConfig.svelte.d.ts +10 -20
- package/dist/template/seaweed/seaweed.postcss +1 -9
- package/dist/{theme.postcss → theme.css} +1 -4
- package/dist/ui/components/FourPartCard.svelte +47 -0
- package/dist/ui/components/FourPartCard.svelte.d.ts +10 -0
- package/dist/ui/components/ModalBase.svelte +75 -0
- package/dist/ui/components/ModalBase.svelte.d.ts +8 -0
- package/dist/ui/components/SocialSection.svelte +87 -0
- package/dist/ui/components/SocialSection.svelte.d.ts +9 -0
- package/dist/ui/components/index.d.ts +3 -0
- package/dist/ui/components/index.js +3 -0
- package/dist/ui/components/randomized-background/RandomizedBackground.svelte +87 -0
- package/dist/ui/components/randomized-background/RandomizedBackground.svelte.d.ts +6 -0
- package/dist/ui/components/randomized-background/RandomizedImage.svelte +42 -0
- package/dist/ui/components/randomized-background/RandomizedImage.svelte.d.ts +7 -0
- package/dist/ui/elements/ColorScheme.d.ts +10 -0
- package/dist/ui/elements/ColorScheme.js +11 -0
- package/dist/ui/elements/GeneralUIProps.d.ts +12 -0
- package/dist/ui/elements/GeneralUIProps.js +1 -0
- package/dist/ui/elements/ImageIcon.svelte +54 -0
- package/dist/ui/elements/ImageIcon.svelte.d.ts +6 -0
- package/dist/ui/elements/OnBackground.d.ts +3 -0
- package/dist/ui/elements/OnBackground.js +4 -0
- package/dist/ui/elements/TextLink.svelte +17 -0
- package/dist/ui/elements/TextLink.svelte.d.ts +8 -0
- package/dist/ui/elements/WrapperProps.d.ts +4 -0
- package/dist/ui/elements/WrapperProps.js +1 -0
- package/dist/ui/elements/index.d.ts +8 -0
- package/dist/ui/elements/index.js +8 -0
- package/dist/ui/elements/pinya-button/component.svelte +47 -0
- package/dist/ui/elements/pinya-button/component.svelte.d.ts +4 -0
- package/dist/ui/elements/pinya-button/index.d.ts +2 -0
- package/dist/ui/elements/pinya-button/index.js +2 -0
- package/dist/ui/elements/pinya-button/props.d.ts +13 -0
- package/dist/ui/elements/pinya-button/props.js +6 -0
- package/dist/ui/elements/pinya-card/component.svelte +19 -0
- package/dist/ui/elements/pinya-card/component.svelte.d.ts +7 -0
- package/dist/ui/elements/pinya-card/index.d.ts +2 -0
- package/dist/ui/elements/pinya-card/index.js +2 -0
- package/dist/ui/elements/pinya-card/props.d.ts +7 -0
- package/dist/ui/elements/pinya-card/props.js +1 -0
- package/dist/ui/modules/index.d.ts +1 -0
- package/dist/ui/modules/index.js +1 -0
- package/dist/ui/modules/modals/general-settings/GeneralSettingsModal.svelte +110 -0
- package/dist/ui/modules/modals/general-settings/GeneralSettingsModal.svelte.d.ts +4 -0
- package/dist/ui/modules/modals/general-settings/LanguagePicker.svelte +48 -0
- package/dist/ui/modules/modals/general-settings/LanguagePicker.svelte.d.ts +3 -0
- package/dist/{template → ui/modules}/seaweed/ChumBucket.svelte +28 -28
- package/dist/ui/modules/seaweed/ChumBucket.svelte.d.ts +3 -0
- package/dist/ui/modules/seaweed/index.d.ts +3 -0
- package/dist/ui/modules/seaweed/index.js +4 -0
- package/dist/ui/templates/PinyaBase.svelte +45 -0
- package/dist/ui/templates/PinyaBase.svelte.d.ts +7 -0
- package/dist/ui/templates/confirmation-modal/component.svelte +47 -0
- package/dist/ui/templates/confirmation-modal/component.svelte.d.ts +4 -0
- package/dist/ui/templates/confirmation-modal/index.d.ts +2 -0
- package/dist/ui/templates/confirmation-modal/index.js +2 -0
- package/dist/ui/templates/confirmation-modal/props.d.ts +10 -0
- package/dist/ui/templates/confirmation-modal/props.js +1 -0
- package/dist/ui/templates/index.d.ts +3 -0
- package/dist/ui/templates/index.js +3 -0
- package/dist/ui/templates/pinya-page-layout/component.svelte +113 -0
- package/dist/ui/templates/pinya-page-layout/component.svelte.d.ts +8 -0
- package/dist/ui/templates/pinya-page-layout/index.d.ts +2 -0
- package/dist/ui/templates/pinya-page-layout/index.js +2 -0
- package/dist/ui/templates/pinya-page-layout/runes.svelte.d.ts +7 -0
- package/dist/ui/templates/pinya-page-layout/runes.svelte.js +3 -0
- package/package.json +36 -18
- package/src/lib/styles/app.css +53 -0
- package/src/lib/theme.css +114 -0
- package/dist/app.postcss +0 -212
- package/dist/components/SocialSection.svelte +0 -166
- package/dist/components/SocialSection.svelte.d.ts +0 -31
- package/dist/postcss.d.ts +0 -3
- package/dist/styles/DefaultGridContainer.css +0 -61
- package/dist/template/seaweed/ChumBucket.svelte.d.ts +0 -14
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { onMount } from "svelte";
|
|
3
|
+
import { scale } from "svelte/transition";
|
|
4
|
+
|
|
5
|
+
import MailIcon from "../../assets/icons/mail.svg";
|
|
6
|
+
import GithubIcon from "../../assets/icons/github-mark.svg";
|
|
7
|
+
import LinkedinIcon from "../../assets/icons/linkedin.svg";
|
|
8
|
+
import { ButtonVariant, ImageIcon, PinyaButton } from "../elements/index";
|
|
9
|
+
import { ItchLogoHotLink } from "../../consts";
|
|
10
|
+
|
|
11
|
+
/** @type {{isSmallVersion?: boolean, email?: string, linkedinSlug?: string, isSlot?: boolean, allowLinkedIn?: boolean}} */
|
|
12
|
+
let {
|
|
13
|
+
isSmallVersion = false,
|
|
14
|
+
email = "turnipxenon@gmail.com",
|
|
15
|
+
linkedinSlug = "turnip-xenon",
|
|
16
|
+
isSlot = false,
|
|
17
|
+
allowLinkedIn = true
|
|
18
|
+
} = $props();
|
|
19
|
+
|
|
20
|
+
let shouldShowExtra = $state(false);
|
|
21
|
+
const style = `
|
|
22
|
+
--preferred-justify-content: ${isSlot ? "flex-start" : "center"};
|
|
23
|
+
--preferred-overall-margin-bottom: ${isSlot ? "0" : "0.75lh"};
|
|
24
|
+
`;
|
|
25
|
+
|
|
26
|
+
onMount(() => {
|
|
27
|
+
shouldShowExtra = window.screen.availWidth >= 440;
|
|
28
|
+
});
|
|
29
|
+
</script>
|
|
30
|
+
|
|
31
|
+
<div class="socials" class:isSmall={isSmallVersion} style={style} data-nosnippet>
|
|
32
|
+
<PinyaButton
|
|
33
|
+
buttonVariant={ButtonVariant.SmallIcon}
|
|
34
|
+
title="https://github.com/TurnipXenon"
|
|
35
|
+
onclick={() => window.open("https://github.com/TurnipXenon")}>
|
|
36
|
+
<ImageIcon src={GithubIcon} alt="github icon" />
|
|
37
|
+
{#if (!isSmallVersion)}
|
|
38
|
+
<span>TurnipXenon</span>
|
|
39
|
+
{/if}
|
|
40
|
+
</PinyaButton>
|
|
41
|
+
{#if allowLinkedIn}
|
|
42
|
+
<PinyaButton
|
|
43
|
+
buttonVariant={ButtonVariant.SmallIcon}
|
|
44
|
+
title={`https://www.linkedin.com/in/${linkedinSlug}/`}
|
|
45
|
+
onclick={() => window.open(`https://www.linkedin.com/in/${linkedinSlug}/`)}>
|
|
46
|
+
<ImageIcon src={LinkedinIcon} alt="linkedin icon" />
|
|
47
|
+
{#if (!isSmallVersion)}
|
|
48
|
+
<span>{linkedinSlug}</span>
|
|
49
|
+
{/if}
|
|
50
|
+
</PinyaButton>
|
|
51
|
+
{/if}
|
|
52
|
+
<PinyaButton
|
|
53
|
+
buttonVariant={ButtonVariant.SmallIcon}
|
|
54
|
+
title={`mailto:${email}`}
|
|
55
|
+
onclick={() => window.open(`mailto:${email}`)}>
|
|
56
|
+
<ImageIcon src={MailIcon} alt="mail icon" />
|
|
57
|
+
{#if (!isSmallVersion)}
|
|
58
|
+
<span>{email}</span>
|
|
59
|
+
{/if}
|
|
60
|
+
</PinyaButton>
|
|
61
|
+
{#if (shouldShowExtra)}
|
|
62
|
+
<div transition:scale>
|
|
63
|
+
<PinyaButton
|
|
64
|
+
buttonVariant={ButtonVariant.SmallIcon}
|
|
65
|
+
title="https://turnipxenon.itch.io/"
|
|
66
|
+
onclick={() => window.open("https://turnipxenon.itch.io/")}>
|
|
67
|
+
<ImageIcon src={ItchLogoHotLink} alt="itch icon" />
|
|
68
|
+
{#if (!isSmallVersion)}
|
|
69
|
+
<span>TurnipXenon</span>
|
|
70
|
+
{/if}
|
|
71
|
+
</PinyaButton>
|
|
72
|
+
</div>
|
|
73
|
+
{/if}
|
|
74
|
+
</div>
|
|
75
|
+
|
|
76
|
+
<style>
|
|
77
|
+
span {
|
|
78
|
+
font-size: 0.8em;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.socials {
|
|
82
|
+
display: flex;
|
|
83
|
+
flex-wrap: wrap;
|
|
84
|
+
justify-content: var(--preferred-justify-content);
|
|
85
|
+
gap: 0.7rem;
|
|
86
|
+
}
|
|
87
|
+
</style>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
declare const SocialSection: import("svelte").Component<{
|
|
2
|
+
isSmallVersion?: boolean;
|
|
3
|
+
email?: string;
|
|
4
|
+
linkedinSlug?: string;
|
|
5
|
+
isSlot?: boolean;
|
|
6
|
+
allowLinkedIn?: boolean;
|
|
7
|
+
}, {}, "">;
|
|
8
|
+
type SocialSection = ReturnType<typeof SocialSection>;
|
|
9
|
+
export default SocialSection;
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { fade } from 'svelte/transition';
|
|
3
|
+
|
|
4
|
+
import BgTiledAres from '../../../assets/bg_tiled/bg_tiled_ares.png';
|
|
5
|
+
import BgTiledCorn from '../../../assets/bg_tiled/bg_tiled_corn.png';
|
|
6
|
+
import BgTiledPineapple from '../../../assets/bg_tiled/bg_tiled_pineapple.png';
|
|
7
|
+
import BgTiledReinhard from '../../../assets/bg_tiled/bg_tiled_reinhard.png';
|
|
8
|
+
import BgTiledTomato from '../../../assets/bg_tiled/bg_tiled_tomato.png';
|
|
9
|
+
import BgTiledTurnip from '../../../assets/bg_tiled/bg_tiled_turnip.png';
|
|
10
|
+
import RandomizedImage from './RandomizedImage.svelte';
|
|
11
|
+
import { generatedDailySeed, mulberry32Generator } from '../../../util/util';
|
|
12
|
+
|
|
13
|
+
let { enabled }: {
|
|
14
|
+
enabled: boolean
|
|
15
|
+
} = $props();
|
|
16
|
+
|
|
17
|
+
const imageList = [BgTiledAres, BgTiledCorn, BgTiledPineapple, BgTiledReinhard, BgTiledTomato, BgTiledTurnip];
|
|
18
|
+
|
|
19
|
+
const seed = generatedDailySeed();
|
|
20
|
+
const rng = mulberry32Generator(seed);
|
|
21
|
+
|
|
22
|
+
const shuffle = <T>(array: T[]): T[] => {
|
|
23
|
+
// from: community wiki @ https://stackoverflow.com/a/2450976/17836168
|
|
24
|
+
let currentIndex = array.length,
|
|
25
|
+
randomIndex;
|
|
26
|
+
|
|
27
|
+
// While there remain elements to shuffle.
|
|
28
|
+
while (currentIndex != 0) {
|
|
29
|
+
// Pick a remaining element.
|
|
30
|
+
randomIndex = Math.floor(rng() * currentIndex);
|
|
31
|
+
currentIndex--;
|
|
32
|
+
|
|
33
|
+
// And swap it with the current element.
|
|
34
|
+
[array[currentIndex], array[randomIndex]] = [array[randomIndex], array[currentIndex]];
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
return array;
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
let generatedImageList: string[] = $state([]);
|
|
41
|
+
|
|
42
|
+
$effect(() => {
|
|
43
|
+
let gi: string[] = [];
|
|
44
|
+
for (let i = 0; i < 20; i++) {
|
|
45
|
+
shuffle(imageList);
|
|
46
|
+
gi = gi.concat(imageList);
|
|
47
|
+
}
|
|
48
|
+
generatedImageList = gi;
|
|
49
|
+
});
|
|
50
|
+
</script>
|
|
51
|
+
|
|
52
|
+
<svelte:head>
|
|
53
|
+
<!-- from: https://dev.to/khromov/preloading-images-in-svelte-465h -->
|
|
54
|
+
{#each imageList as image, idx (idx)}
|
|
55
|
+
<link rel="preload" as="image" href={image} />
|
|
56
|
+
{/each}
|
|
57
|
+
<link
|
|
58
|
+
as="video"
|
|
59
|
+
href="https://video.twimg.com/ext_tw_video/1318728494256410624/pu/vid/640x360/TMklz6hiTkQu3xhn.mp4"
|
|
60
|
+
rel="preload"
|
|
61
|
+
/>
|
|
62
|
+
</svelte:head>
|
|
63
|
+
|
|
64
|
+
<!--todo: add a letterbox beyond 1960px + 16 rem-->
|
|
65
|
+
{#if enabled && generatedImageList.length > 0}
|
|
66
|
+
<div class="default-background" aria-hidden="true" transition:fade>
|
|
67
|
+
{#each generatedImageList as imageItem, idx (idx)}
|
|
68
|
+
<RandomizedImage src={imageItem} {rng} />
|
|
69
|
+
{/each}
|
|
70
|
+
</div>
|
|
71
|
+
{/if}
|
|
72
|
+
|
|
73
|
+
<style>
|
|
74
|
+
.default-background {
|
|
75
|
+
position: fixed;
|
|
76
|
+
display: flex;
|
|
77
|
+
top: -8rem;
|
|
78
|
+
left: 50%;
|
|
79
|
+
transform: translate(-50%, 0);
|
|
80
|
+
width: calc(100vw + 16rem);
|
|
81
|
+
max-width: 1960px;
|
|
82
|
+
height: calc(100vh + 16rem);
|
|
83
|
+
flex-wrap: wrap;
|
|
84
|
+
overflow: hidden;
|
|
85
|
+
z-index: -10;
|
|
86
|
+
}
|
|
87
|
+
</style>
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
let {
|
|
3
|
+
src,
|
|
4
|
+
rng
|
|
5
|
+
}: {
|
|
6
|
+
src: string,
|
|
7
|
+
rng: () => number
|
|
8
|
+
} = $props();
|
|
9
|
+
let rotateRandom = rng() * 90 - 45;
|
|
10
|
+
|
|
11
|
+
const paddingLeft = 1 + rng() * 5;
|
|
12
|
+
const paddingRight = 1 + rng() * 5;
|
|
13
|
+
const paddingTop = 1 + rng() * 7;
|
|
14
|
+
</script>
|
|
15
|
+
|
|
16
|
+
<div
|
|
17
|
+
style="--paddingTop: {paddingTop}rem;
|
|
18
|
+
--paddingLeft: {paddingLeft}rem;
|
|
19
|
+
--paddingRight: {paddingRight}rem;">
|
|
20
|
+
<img {src} class="randomized-image"
|
|
21
|
+
aria-hidden="true"
|
|
22
|
+
style="--rotateRandom:{rotateRandom}deg;"
|
|
23
|
+
alt="" />
|
|
24
|
+
</div>
|
|
25
|
+
|
|
26
|
+
<style>
|
|
27
|
+
div {
|
|
28
|
+
padding-top: var(--paddingTop);
|
|
29
|
+
padding-left: var(--paddingLeft);
|
|
30
|
+
padding-right: var(--paddingRight);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
img {
|
|
34
|
+
width: 8rem;
|
|
35
|
+
height: 8rem;
|
|
36
|
+
transform: rotate(var(--rotateRandom));
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.randomized-image {
|
|
40
|
+
filter: var(--filter-randomized-image);
|
|
41
|
+
}
|
|
42
|
+
</style>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export var ColorScheme;
|
|
2
|
+
(function (ColorScheme) {
|
|
3
|
+
ColorScheme[ColorScheme["Primary"] = 0] = "Primary";
|
|
4
|
+
ColorScheme[ColorScheme["Secondary"] = 1] = "Secondary";
|
|
5
|
+
ColorScheme[ColorScheme["Tertiary"] = 2] = "Tertiary";
|
|
6
|
+
ColorScheme[ColorScheme["Success"] = 3] = "Success";
|
|
7
|
+
ColorScheme[ColorScheme["Warning"] = 4] = "Warning";
|
|
8
|
+
ColorScheme[ColorScheme["Error"] = 5] = "Error";
|
|
9
|
+
ColorScheme[ColorScheme["Surface"] = 6] = "Surface";
|
|
10
|
+
ColorScheme[ColorScheme["Custom"] = 7] = "Custom";
|
|
11
|
+
})(ColorScheme || (ColorScheme = {}));
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ColorScheme } from './ColorScheme';
|
|
2
|
+
import type { OnBackground } from './OnBackground';
|
|
3
|
+
export interface GeneralUIProps {
|
|
4
|
+
/**
|
|
5
|
+
* Color scheme of the UI
|
|
6
|
+
*/
|
|
7
|
+
colorScheme?: ColorScheme;
|
|
8
|
+
/**
|
|
9
|
+
* Color scheme of the background the UI is on
|
|
10
|
+
*/
|
|
11
|
+
onBackground?: OnBackground;
|
|
12
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { HTMLImgAttributes } from 'svelte/elements';
|
|
3
|
+
import type { GeneralUIProps } from './GeneralUIProps';
|
|
4
|
+
import { ColorScheme } from './ColorScheme';
|
|
5
|
+
|
|
6
|
+
type PinyaButtonProps = HTMLImgAttributes & GeneralUIProps;
|
|
7
|
+
|
|
8
|
+
const {
|
|
9
|
+
colorScheme = ColorScheme.Primary,
|
|
10
|
+
...props
|
|
11
|
+
}: PinyaButtonProps = $props();
|
|
12
|
+
|
|
13
|
+
const chooseTailwindClass = () => {
|
|
14
|
+
switch (colorScheme) {
|
|
15
|
+
case ColorScheme.Warning:
|
|
16
|
+
return 'btn preset-filled-warning-600-400 text-surface-100 hover:brightness-110';
|
|
17
|
+
case ColorScheme.Surface:
|
|
18
|
+
return 'btn preset-filled-surface-800-200 text-surface-100-900 hover:brightness-110';
|
|
19
|
+
default:
|
|
20
|
+
console.error('Unimplemented color scheme');
|
|
21
|
+
// eslint-disable-next-line no-fallthrough
|
|
22
|
+
case ColorScheme.Primary:
|
|
23
|
+
return 'icon-filter-on-primary-button';
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
const tailwindClass = chooseTailwindClass();
|
|
28
|
+
</script>
|
|
29
|
+
|
|
30
|
+
<img
|
|
31
|
+
{...props}
|
|
32
|
+
class={`image-icon ${tailwindClass}`}>
|
|
33
|
+
|
|
34
|
+
<style>
|
|
35
|
+
:global(.image-icon) {
|
|
36
|
+
height: calc(var(--spacing) * 8);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
:global(.small-icon-button .image-icon) {
|
|
40
|
+
height: calc(var(--spacing) * 6);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
:global(.icon-filter-on-primary-button) {
|
|
44
|
+
/* based on secondary-950 */
|
|
45
|
+
filter: brightness(0) saturate(100%) invert(18%) sepia(10%) saturate(4620%) hue-rotate(331deg) brightness(90%) contrast(88%);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
@media (prefers-color-scheme: dark) {
|
|
49
|
+
:global(.icon-filter-on-primary-button) {
|
|
50
|
+
/* based on surface-0 */
|
|
51
|
+
filter: brightness(0) saturate(100%) invert(85%) sepia(3%) saturate(993%) hue-rotate(326deg) brightness(113%) contrast(105%);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
</style>
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { HTMLImgAttributes } from 'svelte/elements';
|
|
2
|
+
import type { GeneralUIProps } from './GeneralUIProps';
|
|
3
|
+
type PinyaButtonProps = HTMLImgAttributes & GeneralUIProps;
|
|
4
|
+
declare const ImageIcon: import("svelte").Component<PinyaButtonProps, {}, "">;
|
|
5
|
+
type ImageIcon = ReturnType<typeof ImageIcon>;
|
|
6
|
+
export default ImageIcon;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { type Snippet } from 'svelte';
|
|
3
|
+
|
|
4
|
+
let {
|
|
5
|
+
children,
|
|
6
|
+
href
|
|
7
|
+
}: { href: string, children: Snippet } = $props();
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
<a
|
|
11
|
+
{href}
|
|
12
|
+
class="visited:text-surface-950 dark:visited:text-surface-400">
|
|
13
|
+
{@render children?.()}
|
|
14
|
+
</a>
|
|
15
|
+
|
|
16
|
+
<style>
|
|
17
|
+
</style>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { default as ImageIcon } from './ImageIcon.svelte';
|
|
2
|
+
export { default as TextLink } from './TextLink.svelte';
|
|
3
|
+
export * from './ColorScheme';
|
|
4
|
+
export * from './GeneralUIProps';
|
|
5
|
+
export * from './OnBackground';
|
|
6
|
+
export * from './pinya-card/index';
|
|
7
|
+
export * from './WrapperProps';
|
|
8
|
+
export * from './pinya-button/index';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { default as ImageIcon } from './ImageIcon.svelte';
|
|
2
|
+
export { default as TextLink } from './TextLink.svelte';
|
|
3
|
+
export * from './ColorScheme';
|
|
4
|
+
export * from './GeneralUIProps';
|
|
5
|
+
export * from './OnBackground';
|
|
6
|
+
export * from './pinya-card/index';
|
|
7
|
+
export * from './WrapperProps';
|
|
8
|
+
export * from './pinya-button/index';
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { ColorScheme } from '..';
|
|
3
|
+
import { ButtonVariant, type PinyaButtonProps } from './props';
|
|
4
|
+
|
|
5
|
+
let {
|
|
6
|
+
children,
|
|
7
|
+
colorScheme = ColorScheme.Primary,
|
|
8
|
+
paddingClass = '',
|
|
9
|
+
buttonVariant = ButtonVariant.Default,
|
|
10
|
+
colorClass = '',
|
|
11
|
+
...props
|
|
12
|
+
}: PinyaButtonProps = $props();
|
|
13
|
+
|
|
14
|
+
paddingClass = paddingClass
|
|
15
|
+
? paddingClass
|
|
16
|
+
: (
|
|
17
|
+
buttonVariant === ButtonVariant.Image
|
|
18
|
+
? 'pl-3 pr-3 pt-2 pb-2'
|
|
19
|
+
: 'pl-3 pr-3'
|
|
20
|
+
);
|
|
21
|
+
|
|
22
|
+
const chooseTailwindClass = () => {
|
|
23
|
+
switch (colorScheme) {
|
|
24
|
+
case ColorScheme.Custom:
|
|
25
|
+
return colorClass;
|
|
26
|
+
case ColorScheme.Warning:
|
|
27
|
+
return 'bg-warning-700 dark:bg-warning-400 text-secondary-0 dark:text-secondary-950 hover:brightness-110';
|
|
28
|
+
case ColorScheme.Surface:
|
|
29
|
+
return 'bg-surface-700 dark:bg-surface-600 text-surface-50-950 hover:brightness-110';
|
|
30
|
+
default:
|
|
31
|
+
console.error(`Unimplemented color scheme: ${colorScheme.toString()}`);
|
|
32
|
+
// eslint-disable-next-line no-fallthrough
|
|
33
|
+
case ColorScheme.Primary:
|
|
34
|
+
return 'bg-primary-400-600 text-secondary-950 dark:text-secondary-0 hover:brightness-110';
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
const tailwindClass = chooseTailwindClass();
|
|
39
|
+
</script>
|
|
40
|
+
|
|
41
|
+
<button
|
|
42
|
+
{...props}
|
|
43
|
+
class:small-icon-button={buttonVariant === ButtonVariant.SmallIcon}
|
|
44
|
+
class={`btn rounded-2xl text-xl font-bold ${tailwindClass} ${paddingClass}`}
|
|
45
|
+
>
|
|
46
|
+
{@render children()}
|
|
47
|
+
</button>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { HTMLButtonAttributes } from 'svelte/elements';
|
|
2
|
+
import type { GeneralUIProps } from '../GeneralUIProps';
|
|
3
|
+
import type { WrapperProps } from '../WrapperProps';
|
|
4
|
+
export declare enum ButtonVariant {
|
|
5
|
+
Default = 0,
|
|
6
|
+
Image = 1,
|
|
7
|
+
SmallIcon = 2
|
|
8
|
+
}
|
|
9
|
+
export type PinyaButtonProps = WrapperProps & HTMLButtonAttributes & GeneralUIProps & {
|
|
10
|
+
paddingClass?: string;
|
|
11
|
+
buttonVariant?: ButtonVariant;
|
|
12
|
+
colorClass?: string;
|
|
13
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export var ButtonVariant;
|
|
2
|
+
(function (ButtonVariant) {
|
|
3
|
+
ButtonVariant[ButtonVariant["Default"] = 0] = "Default";
|
|
4
|
+
ButtonVariant[ButtonVariant["Image"] = 1] = "Image";
|
|
5
|
+
ButtonVariant[ButtonVariant["SmallIcon"] = 2] = "SmallIcon";
|
|
6
|
+
})(ButtonVariant || (ButtonVariant = {}));
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<script lang="ts">/**
|
|
2
|
+
* When with texts, wrap the text content inside a div so flex wont apply
|
|
3
|
+
*/
|
|
4
|
+
import type { PinyaCardProps } from './props';
|
|
5
|
+
|
|
6
|
+
let {
|
|
7
|
+
paddingClass = 'pt-[1lh] pb-[1lh] pl-16 pr-16',
|
|
8
|
+
flexClass = 'flex flex-col',
|
|
9
|
+
widthClass = 'max-w-md',
|
|
10
|
+
className,
|
|
11
|
+
children
|
|
12
|
+
}: PinyaCardProps = $props();
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
<div
|
|
16
|
+
class={`card bg-surface-200 dark:bg-surface-900 border-[2px] border-primary-500 dark:border-0 w-full text-start rounded-xl ${paddingClass} ${flexClass} ${className} ${widthClass}`}
|
|
17
|
+
>
|
|
18
|
+
{@render children?.()}
|
|
19
|
+
</div>
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* When with texts, wrap the text content inside a div so flex wont apply
|
|
3
|
+
*/
|
|
4
|
+
import type { PinyaCardProps } from './props';
|
|
5
|
+
declare const Component: import("svelte").Component<PinyaCardProps, {}, "">;
|
|
6
|
+
type Component = ReturnType<typeof Component>;
|
|
7
|
+
export default Component;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./seaweed/index";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./seaweed/index";
|