@turnipxenon/pineapple 2.4.11 → 2.4.13

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 (77) hide show
  1. package/.idea/workspace.xml +87 -86
  2. package/.svelte-kit/__package__/components/Card.svelte +27 -27
  3. package/.svelte-kit/__package__/components/CarouselElement.svelte +16 -16
  4. package/.svelte-kit/__package__/components/Chip.svelte +12 -12
  5. package/.svelte-kit/__package__/components/ElementVisbilityDetector.svelte +5 -5
  6. package/.svelte-kit/__package__/components/SocialSection.svelte +162 -159
  7. package/.svelte-kit/__package__/components/StickyElement.svelte +20 -20
  8. package/.svelte-kit/__package__/components/ToggleableContent.svelte +8 -8
  9. package/.svelte-kit/__package__/components/layouts/PineappleBaseLayout.svelte +21 -0
  10. package/.svelte-kit/__package__/components/layouts/SeaweedBaseLayout.svelte +1 -8
  11. package/.svelte-kit/__package__/components/layouts/SeaweedBaseLayout.svelte.d.ts +1 -0
  12. package/.svelte-kit/__package__/postcss.d.ts +3 -3
  13. package/.svelte-kit/__package__/styles/global.css +1 -1
  14. package/.svelte-kit/__package__/template/SeaweedTemplate.svelte +1 -1
  15. package/.svelte-kit/__package__/theme.postcss +2 -1
  16. package/.svelte-kit/ambient.d.ts +4 -0
  17. package/.svelte-kit/generated/client/app.js +6 -5
  18. package/.svelte-kit/generated/client/nodes/2.js +1 -1
  19. package/.svelte-kit/generated/client/nodes/3.js +1 -1
  20. package/.svelte-kit/generated/client/nodes/4.js +1 -1
  21. package/.svelte-kit/generated/client/nodes/5.js +1 -1
  22. package/.svelte-kit/generated/client/nodes/6.js +1 -1
  23. package/.svelte-kit/generated/client/nodes/7.js +1 -0
  24. package/.svelte-kit/generated/server/internal.js +1 -1
  25. package/.svelte-kit/types/route_meta_data.json +6 -4
  26. package/.svelte-kit/types/src/routes/$types.d.ts +1 -4
  27. package/.svelte-kit/types/src/routes/{personal → (pineapple)}/$types.d.ts +2 -2
  28. package/.svelte-kit/types/src/routes/{portfolio/actual → (pineapple)/personal}/$types.d.ts +2 -2
  29. package/.svelte-kit/types/src/routes/(seaweed)/$types.d.ts +19 -0
  30. package/.svelte-kit/types/src/routes/{portfolio → (seaweed)/portfolio}/$types.d.ts +3 -3
  31. package/.svelte-kit/types/src/routes/(seaweed)/portfolio/actual/$types.d.ts +17 -0
  32. package/.svelte-kit/types/src/routes/{portfolio → (seaweed)/portfolio}/proxy+page.server.ts +1 -1
  33. package/README.md +8 -18
  34. package/dist/components/Card.svelte +27 -27
  35. package/dist/components/CarouselElement.svelte +16 -16
  36. package/dist/components/Chip.svelte +12 -12
  37. package/dist/components/ElementVisbilityDetector.svelte +5 -5
  38. package/dist/components/SocialSection.svelte +162 -159
  39. package/dist/components/StickyElement.svelte +20 -20
  40. package/dist/components/ToggleableContent.svelte +8 -8
  41. package/dist/components/layouts/PineappleBaseLayout.svelte +21 -0
  42. package/dist/components/layouts/SeaweedBaseLayout.svelte +1 -8
  43. package/dist/components/layouts/SeaweedBaseLayout.svelte.d.ts +1 -0
  44. package/dist/postcss.d.ts +3 -3
  45. package/dist/styles/global.css +1 -1
  46. package/dist/template/SeaweedTemplate.svelte +1 -1
  47. package/dist/theme.postcss +2 -1
  48. package/package.json +1 -1
  49. package/src/lib/components/Card.svelte +32 -32
  50. package/src/lib/components/CarouselElement.svelte +22 -22
  51. package/src/lib/components/Chip.svelte +12 -12
  52. package/src/lib/components/ElementVisbilityDetector.svelte +22 -22
  53. package/src/lib/components/OnElementVisbilityChanged.ts +1 -1
  54. package/src/lib/components/SocialSection.svelte +95 -92
  55. package/src/lib/components/StickyElement.svelte +39 -39
  56. package/src/lib/components/ToggleableContent.svelte +85 -85
  57. package/src/lib/components/ToggleableContentType.ts +4 -4
  58. package/src/lib/components/layouts/LayoutConstants.ts +1 -1
  59. package/src/lib/components/layouts/PineappleBaseLayout.svelte +21 -0
  60. package/src/lib/components/layouts/SeaweedBaseLayout.svelte +1 -8
  61. package/src/lib/consts.ts +2 -2
  62. package/src/lib/postcss.d.ts +3 -3
  63. package/src/lib/styles/global.css +1 -1
  64. package/src/lib/template/SeaweedTemplate.svelte +1 -1
  65. package/src/lib/theme.postcss +2 -1
  66. package/src/lib/util/create_go_to_function.ts +5 -5
  67. package/src/routes/{personal → (pineapple)}/+layout.svelte +1 -1
  68. package/src/routes/(pineapple)/+page.svelte +36 -0
  69. package/src/routes/(seaweed)/+layout.svelte +10 -0
  70. package/src/routes/{portfolio → (seaweed)/portfolio}/+page.server.ts +1 -1
  71. package/src/routes/{portfolio → (seaweed)/portfolio}/+page.svelte +2 -2
  72. package/src/routes/{portfolio → (seaweed)/portfolio}/.gitignore +1 -1
  73. package/src/routes/{portfolio → (seaweed)/portfolio}/actual/+page.svelte +1 -1
  74. package/src/routes/+layout.svelte +0 -7
  75. package/static/robots.txt +5 -5
  76. package/src/routes/+page.svelte +0 -38
  77. /package/src/routes/{personal → (pineapple)/personal}/+page.svelte +0 -0
@@ -4,14 +4,14 @@ type Expand<T> = T extends infer O ? { [K in keyof O]: O[K] } : never;
4
4
  // @ts-ignore
5
5
  type MatcherParam<M> = M extends (param : string) => param is infer U ? U extends string ? U : string : string;
6
6
  type RouteParams = { };
7
- type RouteId = '/portfolio/actual';
7
+ type RouteId = '/(pineapple)/personal';
8
8
  type MaybeWithVoid<T> = {} extends T ? T | void : T;
9
9
  export type RequiredKeys<T> = { [K in keyof T]-?: {} extends { [P in K]: T[K] } ? never : K; }[keyof T];
10
10
  type OutputDataShape<T> = MaybeWithVoid<Omit<App.PageData, RequiredKeys<T>> & Partial<Pick<App.PageData, keyof T & keyof App.PageData>> & Record<string, any>>
11
11
  type EnsureDefined<T> = T extends null | undefined ? {} : T;
12
12
  type OptionalUnion<U extends Record<string, any>, A extends keyof U = U extends U ? keyof U : never> = U extends unknown ? { [P in Exclude<A, keyof U>]?: never } & U : never;
13
13
  export type Snapshot<T = any> = Kit.Snapshot<T>;
14
- type PageParentData = EnsureDefined<import('../../$types.js').LayoutData>;
14
+ type PageParentData = Omit<EnsureDefined<import('../../$types.js').LayoutData>, keyof import('../$types.js').LayoutData> & EnsureDefined<import('../$types.js').LayoutData>;
15
15
 
16
16
  export type PageServerData = null;
17
17
  export type PageData = Expand<PageParentData>;
@@ -0,0 +1,19 @@
1
+ import type * as Kit from '@sveltejs/kit';
2
+
3
+ type Expand<T> = T extends infer O ? { [K in keyof O]: O[K] } : never;
4
+ // @ts-ignore
5
+ type MatcherParam<M> = M extends (param : string) => param is infer U ? U extends string ? U : string : string;
6
+ type RouteParams = { };
7
+ type RouteId = '/(seaweed)';
8
+ type MaybeWithVoid<T> = {} extends T ? T | void : T;
9
+ export type RequiredKeys<T> = { [K in keyof T]-?: {} extends { [P in K]: T[K] } ? never : K; }[keyof T];
10
+ type OutputDataShape<T> = MaybeWithVoid<Omit<App.PageData, RequiredKeys<T>> & Partial<Pick<App.PageData, keyof T & keyof App.PageData>> & Record<string, any>>
11
+ type EnsureDefined<T> = T extends null | undefined ? {} : T;
12
+ type OptionalUnion<U extends Record<string, any>, A extends keyof U = U extends U ? keyof U : never> = U extends unknown ? { [P in Exclude<A, keyof U>]?: never } & U : never;
13
+ export type Snapshot<T = any> = Kit.Snapshot<T>;
14
+ type LayoutRouteId = RouteId | "/(seaweed)/portfolio" | "/(seaweed)/portfolio/actual"
15
+ type LayoutParams = RouteParams & { }
16
+ type LayoutParentData = EnsureDefined<import('../$types.js').LayoutData>;
17
+
18
+ export type LayoutServerData = null;
19
+ export type LayoutData = Expand<LayoutParentData>;
@@ -4,15 +4,15 @@ type Expand<T> = T extends infer O ? { [K in keyof O]: O[K] } : never;
4
4
  // @ts-ignore
5
5
  type MatcherParam<M> = M extends (param : string) => param is infer U ? U extends string ? U : string : string;
6
6
  type RouteParams = { };
7
- type RouteId = '/portfolio';
7
+ type RouteId = '/(seaweed)/portfolio';
8
8
  type MaybeWithVoid<T> = {} extends T ? T | void : T;
9
9
  export type RequiredKeys<T> = { [K in keyof T]-?: {} extends { [P in K]: T[K] } ? never : K; }[keyof T];
10
10
  type OutputDataShape<T> = MaybeWithVoid<Omit<App.PageData, RequiredKeys<T>> & Partial<Pick<App.PageData, keyof T & keyof App.PageData>> & Record<string, any>>
11
11
  type EnsureDefined<T> = T extends null | undefined ? {} : T;
12
12
  type OptionalUnion<U extends Record<string, any>, A extends keyof U = U extends U ? keyof U : never> = U extends unknown ? { [P in Exclude<A, keyof U>]?: never } & U : never;
13
13
  export type Snapshot<T = any> = Kit.Snapshot<T>;
14
- type PageServerParentData = EnsureDefined<import('../$types.js').LayoutServerData>;
15
- type PageParentData = EnsureDefined<import('../$types.js').LayoutData>;
14
+ type PageServerParentData = Omit<EnsureDefined<import('../../$types.js').LayoutServerData>, keyof import('../$types.js').LayoutServerData> & EnsureDefined<import('../$types.js').LayoutServerData>;
15
+ type PageParentData = Omit<EnsureDefined<import('../../$types.js').LayoutData>, keyof import('../$types.js').LayoutData> & EnsureDefined<import('../$types.js').LayoutData>;
16
16
 
17
17
  export type PageServerLoad<OutputData extends OutputDataShape<PageServerParentData> = OutputDataShape<PageServerParentData>> = Kit.ServerLoad<RouteParams, PageServerParentData, OutputData, RouteId>;
18
18
  export type PageServerLoadEvent = Parameters<PageServerLoad>[0];
@@ -0,0 +1,17 @@
1
+ import type * as Kit from '@sveltejs/kit';
2
+
3
+ type Expand<T> = T extends infer O ? { [K in keyof O]: O[K] } : never;
4
+ // @ts-ignore
5
+ type MatcherParam<M> = M extends (param : string) => param is infer U ? U extends string ? U : string : string;
6
+ type RouteParams = { };
7
+ type RouteId = '/(seaweed)/portfolio/actual';
8
+ type MaybeWithVoid<T> = {} extends T ? T | void : T;
9
+ export type RequiredKeys<T> = { [K in keyof T]-?: {} extends { [P in K]: T[K] } ? never : K; }[keyof T];
10
+ type OutputDataShape<T> = MaybeWithVoid<Omit<App.PageData, RequiredKeys<T>> & Partial<Pick<App.PageData, keyof T & keyof App.PageData>> & Record<string, any>>
11
+ type EnsureDefined<T> = T extends null | undefined ? {} : T;
12
+ type OptionalUnion<U extends Record<string, any>, A extends keyof U = U extends U ? keyof U : never> = U extends unknown ? { [P in Exclude<A, keyof U>]?: never } & U : never;
13
+ export type Snapshot<T = any> = Kit.Snapshot<T>;
14
+ type PageParentData = Omit<EnsureDefined<import('../../../$types.js').LayoutData>, keyof import('../../$types.js').LayoutData> & EnsureDefined<import('../../$types.js').LayoutData>;
15
+
16
+ export type PageServerData = null;
17
+ export type PageData = Expand<PageParentData>;
@@ -1,5 +1,5 @@
1
1
  // @ts-nocheck
2
- import type {PageLoad} from './$types';
2
+ import type {PageLoad} from '../../../../.svelte-kit/types/src/routes';
3
3
  import * as htmlparser2 from "htmlparser2";
4
4
  import {DomUtils} from "htmlparser2";
5
5
 
package/README.md CHANGED
@@ -1,28 +1,18 @@
1
- # create-svelte
1
+ # Pineapple
2
2
 
3
- Everything you need to build a Svelte project, powered by [`create-svelte`](https://github.com/sveltejs/kit/tree/master/packages/create-svelte).
3
+ This is the base package for styling my projects in Svelte.
4
4
 
5
- ## Creating a project
6
-
7
- If you're seeing this, you've probably already done this step. Congrats!
8
-
9
- ```bash
10
- # create a new project in the current directory
11
- npm create svelte@latest
12
-
13
- # create a new project in my-app
14
- npm create svelte@latest my-app
15
- ```
5
+ NPM package: https://www.npmjs.com/package/@turnipxenon/pineapple
16
6
 
17
7
  ## Developing
18
8
 
19
- Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server:
9
+ Once you've created a project and installed dependencies with `yarn`, start a development server:
20
10
 
21
11
  ```bash
22
- npm run dev
12
+ yarn dev
23
13
 
24
14
  # or start the server and open the app in a new browser tab
25
- npm run dev -- --open
15
+ yarn dev -- --open
26
16
  ```
27
17
 
28
18
  ## Building
@@ -30,9 +20,9 @@ npm run dev -- --open
30
20
  To create a production version of your app:
31
21
 
32
22
  ```bash
33
- npm run build
23
+ yarn build
34
24
  ```
35
25
 
36
- You can preview the production build with `npm run preview`.
26
+ You can preview the production build with `yarn preview`.
37
27
 
38
28
  > To deploy your app, you may need to install an [adapter](https://kit.svelte.dev/docs/adapters) for your target environment.
@@ -7,30 +7,30 @@ const style = `
7
7
  --turnip-card-margin-bottom: ${marginBottom};
8
8
  ${overrideStyle};
9
9
  `;
10
- </script>
11
-
12
- {#if (includeDataNoSnippet)}
13
- <div class="card turnip-card" style={style} data-no-snippet>
14
- <slot name="content" class="card" />
15
- </div>
16
- {:else }
17
- <div class="card turnip-card" style={style}>
18
- <slot name="content" class="card" />
19
- </div>
20
- {/if}
21
-
22
- <style>
23
- .turnip-card {
24
- --tw-bg-opacity: 1;
25
- background-color: rgb(var(--color-surface-100) / var(--tw-bg-opacity));
26
- }
27
- :is(.dark .turnip-card) {
28
- --tw-bg-opacity: 1;
29
- background-color: rgb(var(--color-surface-900) / var(--tw-bg-opacity));
30
- }
31
- .turnip-card {
32
- margin: var(--turnip-card-margin);
33
- margin-bottom: var(--turnip-card-margin-bottom);
34
- border-radius: var(--theme-rounded-container);
35
- }
36
- </style>
10
+ </script>
11
+
12
+ {#if (includeDataNoSnippet)}
13
+ <div class="card turnip-card" style={style} data-no-snippet>
14
+ <slot name="content" class="card" />
15
+ </div>
16
+ {:else }
17
+ <div class="card turnip-card" style={style}>
18
+ <slot name="content" class="card" />
19
+ </div>
20
+ {/if}
21
+
22
+ <style>
23
+ .turnip-card {
24
+ --tw-bg-opacity: 1;
25
+ background-color: rgb(var(--color-surface-100) / var(--tw-bg-opacity));
26
+ }
27
+ :is(.dark .turnip-card) {
28
+ --tw-bg-opacity: 1;
29
+ background-color: rgb(var(--color-surface-900) / var(--tw-bg-opacity));
30
+ }
31
+ .turnip-card {
32
+ margin: var(--turnip-card-margin);
33
+ margin-bottom: var(--turnip-card-margin-bottom);
34
+ border-radius: var(--theme-rounded-container);
35
+ }
36
+ </style>
@@ -1,21 +1,21 @@
1
1
  <script>export let activeGameIndex;
2
2
  export let selfIndex;
3
3
  import { fly, slide, scale } from "svelte/transition";
4
- </script>
5
-
6
- {#if (activeGameIndex === selfIndex)}
7
- <!--todo: make section consistent size for all-->
8
- <section class="game-showcase"
9
- in:fly={{x: '100%'}} out:fly={{x: '-100%'}}>
10
- <slot/>
11
- </section>
12
- {/if}
13
-
14
- <style>
15
- .game-showcase {
16
- scroll-snap-align: center;
17
- border-radius: var(--theme-rounded-container);
18
- margin: auto;
4
+ </script>
5
+
6
+ {#if (activeGameIndex === selfIndex)}
7
+ <!--todo: make section consistent size for all-->
8
+ <section class="game-showcase"
9
+ in:fly={{x: '100%'}} out:fly={{x: '-100%'}}>
10
+ <slot/>
11
+ </section>
12
+ {/if}
13
+
14
+ <style>
15
+ .game-showcase {
16
+ scroll-snap-align: center;
17
+ border-radius: var(--theme-rounded-container);
18
+ margin: auto;
19
19
  width: 100%
20
- }
20
+ }
21
21
  </style>
@@ -1,12 +1,12 @@
1
- <span class="chip variant-filled-tertiary">
2
- <slot />
3
- </span>
4
-
5
- <style>
6
- .chip {
7
- border-radius: 1em;
8
- margin: 0.25em;
9
- font-weight: bold;
10
- pointer-events: none;
11
- }
12
- </style>
1
+ <span class="chip variant-filled-tertiary">
2
+ <slot />
3
+ </span>
4
+
5
+ <style>
6
+ .chip {
7
+ border-radius: 1em;
8
+ margin: 0.25em;
9
+ font-weight: bold;
10
+ pointer-events: none;
11
+ }
12
+ </style>
@@ -11,8 +11,8 @@ onMount(() => {
11
11
  );
12
12
  observer.observe(stickyElem);
13
13
  });
14
- </script>
15
-
16
- <span bind:this={stickyElem}>
17
- <slot/>
18
- </span>
14
+ </script>
15
+
16
+ <span bind:this={stickyElem}>
17
+ <slot/>
18
+ </span>
@@ -1,160 +1,163 @@
1
- <script>
2
- import MailIcon from "../assets/icons/mail.svg";
3
- import GithubIcon from "../assets/icons/github-mark.svg";
4
- import { ItchLogoHotLink } from "../consts";
5
- import LinkedinIcon from "../assets/icons/linkedin.svg";
6
- import { onMount } from "svelte";
7
-
8
- export let isSmallVersion = false;
9
- export let email = "turnipxenon@gmail.com";
10
- export let linkedinSlug = "turnip-xenon";
11
- export let isSlot = false;
12
-
13
- let shouldShowExtra = false;
14
- const style = `
15
- --preferred-justify-content: ${isSlot ? "flex-start" : "center"};
16
- --preferred-overall-margin-bottom: ${isSlot ? "0" : "0.75lh"};
17
- `;
18
-
19
- onMount(() => {
20
- shouldShowExtra = window.screen.availWidth >= 440;
21
- });
22
- </script>
23
-
24
- <div class="socials" class:isSmall={isSmallVersion} style={style} data-nosnippet>
25
- <button type="button" class="social-button turnip-button"
26
- role="link"
27
- title="https://github.com/TurnipXenon"
28
- on:click={() => window.open("https://github.com/TurnipXenon")}>
29
- <img src={GithubIcon} alt="github icon">
30
- {#if (!isSmallVersion)}
31
- <span>TurnipXenon</span>
32
- {/if}
33
- </button>
34
- <button type="button" class="social-button turnip-button"
35
- role="link"
36
- title={`https://www.linkedin.com/in/${linkedinSlug}/`}
37
- on:click={() => window.open(`https://www.linkedin.com/in/${linkedinSlug}/`)}>
38
- <img src={LinkedinIcon} alt="linkedikn icon">
39
- {#if (!isSmallVersion)}
40
- <span>{linkedinSlug}</span>
41
- {/if}
42
- </button>
43
- <button type="button" class="social-button turnip-button"
44
- role="link"
45
- title={`mailto:${email}`}
46
- on:click={() => window.open(`mailto:${email}`)}>
47
- <img src={MailIcon} alt="mail icon" />
48
- {#if (!isSmallVersion)}
49
- <span>{email}</span>
50
- {/if}
51
- </button>
52
- {#if (shouldShowExtra)}
53
- <button type="button" class="social-button turnip-button"
54
- role="link"
55
- title="https://turnipxenon.itch.io/"
56
- on:click={() => window.open("https://turnipxenon.itch.io/")}>
57
- <img src={ItchLogoHotLink} alt="itch icon">
58
- {#if (!isSmallVersion)}
59
- <span>TurnipXenon</span>
60
- {/if}
61
- </button>
62
- {/if}
63
- </div>
64
-
65
- <style>
66
- :is(.dark .social-button) {
67
- --tw-bg-opacity: 1;
68
- background-color: rgb(var(--color-primary-500) / var(--tw-bg-opacity));
69
- color: rgb(var(--on-primary));
70
- }
71
-
72
- .social-button:disabled {
73
- cursor: not-allowed;
74
- opacity: 0.5;
75
- }
76
-
77
- .social-button:disabled:hover {
78
- --tw-brightness: brightness(1);
79
- 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);
80
- }
81
-
82
- .social-button:disabled:active {
83
- --tw-scale-x: 1;
84
- --tw-scale-y: 1;
85
- 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));
86
- }
87
-
88
- .social-button {
89
- font-size: 1rem;
90
- line-height: 1.5rem;
91
- padding-left: 1.25rem;
92
- padding-right: 1.25rem;
93
- padding-top: 9px;
94
- padding-bottom: 9px;
95
- white-space: nowrap;
96
- text-align: center;
97
- display: inline-flex;
98
- align-items: center;
99
- justify-content: center;
100
- transition-property: all;
101
- transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
102
- transition-duration: 150ms;
103
- border-radius: var(--theme-rounded-base);
104
- }
105
-
106
- .social-button > :not([hidden]) ~ :not([hidden]) {
107
- --tw-space-x-reverse: 0;
108
- margin-right: calc(0.5rem * var(--tw-space-x-reverse));
109
- margin-left: calc(0.5rem * calc(1 - var(--tw-space-x-reverse)));
110
- }
111
-
112
- .social-button:hover {
113
- --tw-brightness: brightness(1.15);
114
- 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);
115
- }
116
-
117
- .social-button:active {
118
- --tw-scale-x: 95%;
119
- --tw-scale-y: 95%;
120
- 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));
121
- --tw-brightness: brightness(.9);
122
- 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);
123
- }
124
-
125
- .social-button {
126
- --tw-bg-opacity: 1;
127
- background-color: rgb(var(--color-primary-500) / var(--tw-bg-opacity));
128
- color: rgb(var(--on-primary));
129
- }
130
-
131
- :is(.dark .social-button) {
132
- --tw-bg-opacity: 1;
133
- background-color: rgb(var(--color-primary-500) / var(--tw-bg-opacity));
134
- color: rgb(var(--on-primary));
135
- }
136
-
137
- button > img {
138
- max-height: 1lh;
139
- }
140
-
141
- button {
142
- min-width: 0;
143
- min-height: 0;
144
- }
145
-
146
- .socials {
147
- display: flex;
148
- flex-wrap: wrap;
149
- justify-content: var(--preferred-justify-content);
150
- }
151
-
152
- .socials > button {
153
- margin: 0 0.5em var(--preferred-overall-margin-bottom);
154
- }
155
-
156
- .socials.isSmall > button {
157
- margin-left: 0.25em;
158
- margin-right: 0.25em;
159
- }
1
+ <script>
2
+ export let isSmallVersion = false;
3
+ export let email = "turnipxenon@gmail.com";
4
+ export let linkedinSlug = "turnip-xenon";
5
+ export let isSlot = false;
6
+
7
+ import { ItchLogoHotLink } from "../consts";
8
+ import { onMount } from "svelte";
9
+ import { scale } from "svelte/transition";
10
+
11
+ import MailIcon from "../assets/icons/mail.svg";
12
+ import GithubIcon from "../assets/icons/github-mark.svg";
13
+ import LinkedinIcon from "../assets/icons/linkedin.svg";
14
+
15
+ let shouldShowExtra = false;
16
+ const style = `
17
+ --preferred-justify-content: ${isSlot ? "flex-start" : "center"};
18
+ --preferred-overall-margin-bottom: ${isSlot ? "0" : "0.75lh"};
19
+ `;
20
+
21
+ onMount(() => {
22
+ shouldShowExtra = window.screen.availWidth >= 440;
23
+ });
24
+ </script>
25
+
26
+ <div class="socials" class:isSmall={isSmallVersion} style={style} data-nosnippet>
27
+ <button type="button" class="social-button turnip-button"
28
+ role="link"
29
+ title="https://github.com/TurnipXenon"
30
+ on:click={() => window.open("https://github.com/TurnipXenon")}>
31
+ <img src={GithubIcon} alt="github icon">
32
+ {#if (!isSmallVersion)}
33
+ <span>TurnipXenon</span>
34
+ {/if}
35
+ </button>
36
+ <button type="button" class="social-button turnip-button"
37
+ role="link"
38
+ title={`https://www.linkedin.com/in/${linkedinSlug}/`}
39
+ on:click={() => window.open(`https://www.linkedin.com/in/${linkedinSlug}/`)}>
40
+ <img src={LinkedinIcon} alt="linkedikn icon">
41
+ {#if (!isSmallVersion)}
42
+ <span>{linkedinSlug}</span>
43
+ {/if}
44
+ </button>
45
+ <button type="button" class="social-button turnip-button"
46
+ role="link"
47
+ title={`mailto:${email}`}
48
+ on:click={() => window.open(`mailto:${email}`)}>
49
+ <img src={MailIcon} alt="mail icon" />
50
+ {#if (!isSmallVersion)}
51
+ <span>{email}</span>
52
+ {/if}
53
+ </button>
54
+ {#if (shouldShowExtra)}
55
+ <button type="button" class="social-button turnip-button"
56
+ role="link"
57
+ title="https://turnipxenon.itch.io/"
58
+ transition:scale
59
+ on:click={() => window.open("https://turnipxenon.itch.io/")}>
60
+ <img src={ItchLogoHotLink} alt="itch icon">
61
+ {#if (!isSmallVersion)}
62
+ <span>TurnipXenon</span>
63
+ {/if}
64
+ </button>
65
+ {/if}
66
+ </div>
67
+
68
+ <style>
69
+ :is(.dark .social-button) {
70
+ --tw-bg-opacity: 1;
71
+ background-color: rgb(var(--color-primary-500) / var(--tw-bg-opacity));
72
+ color: rgb(var(--on-primary));
73
+ }
74
+
75
+ .social-button:disabled {
76
+ cursor: not-allowed;
77
+ opacity: 0.5;
78
+ }
79
+
80
+ .social-button:disabled:hover {
81
+ --tw-brightness: brightness(1);
82
+ 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);
83
+ }
84
+
85
+ .social-button:disabled:active {
86
+ --tw-scale-x: 1;
87
+ --tw-scale-y: 1;
88
+ 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));
89
+ }
90
+
91
+ .social-button {
92
+ font-size: 1rem;
93
+ line-height: 1.5rem;
94
+ padding-left: 1.25rem;
95
+ padding-right: 1.25rem;
96
+ padding-top: 9px;
97
+ padding-bottom: 9px;
98
+ white-space: nowrap;
99
+ text-align: center;
100
+ display: inline-flex;
101
+ align-items: center;
102
+ justify-content: center;
103
+ transition-property: all;
104
+ transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
105
+ transition-duration: 150ms;
106
+ border-radius: var(--theme-rounded-base);
107
+ }
108
+
109
+ .social-button > :not([hidden]) ~ :not([hidden]) {
110
+ --tw-space-x-reverse: 0;
111
+ margin-right: calc(0.5rem * var(--tw-space-x-reverse));
112
+ margin-left: calc(0.5rem * calc(1 - var(--tw-space-x-reverse)));
113
+ }
114
+
115
+ .social-button:hover {
116
+ --tw-brightness: brightness(1.15);
117
+ 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);
118
+ }
119
+
120
+ .social-button:active {
121
+ --tw-scale-x: 95%;
122
+ --tw-scale-y: 95%;
123
+ 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));
124
+ --tw-brightness: brightness(.9);
125
+ 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);
126
+ }
127
+
128
+ .social-button {
129
+ --tw-bg-opacity: 1;
130
+ background-color: rgb(var(--color-primary-500) / var(--tw-bg-opacity));
131
+ color: rgb(var(--on-primary));
132
+ }
133
+
134
+ :is(.dark .social-button) {
135
+ --tw-bg-opacity: 1;
136
+ background-color: rgb(var(--color-primary-500) / var(--tw-bg-opacity));
137
+ color: rgb(var(--on-primary));
138
+ }
139
+
140
+ button > img {
141
+ max-height: 1lh;
142
+ }
143
+
144
+ button {
145
+ min-width: 0;
146
+ min-height: 0;
147
+ }
148
+
149
+ .socials {
150
+ display: flex;
151
+ flex-wrap: wrap;
152
+ justify-content: var(--preferred-justify-content);
153
+ }
154
+
155
+ .socials > button {
156
+ margin: 0 0.5em var(--preferred-overall-margin-bottom);
157
+ }
158
+
159
+ .socials.isSmall > button {
160
+ margin-left: 0.25em;
161
+ margin-right: 0.25em;
162
+ }
160
163
  </style>
@@ -13,24 +13,24 @@ onMount(() => {
13
13
  );
14
14
  observer.observe(stickyElem);
15
15
  });
16
- </script>
17
-
18
- <span transition:fly={{y: -100}}>
19
- {#if (isFirst && !isSticky)}
20
- <!-- intentionally empty -->
21
- {:else if (isSticky)}
22
- {" | "}
23
- {:else }
24
- <br>
25
- {/if}
26
- <span class="sticky-div" bind:this={stickyElem}>
27
- <slot/>
28
- </span>
29
- </span>
30
-
31
- <style>
32
- .sticky-div {
33
- position: sticky;
34
- top: -1px;
35
- }
16
+ </script>
17
+
18
+ <span transition:fly={{y: -100}}>
19
+ {#if (isFirst && !isSticky)}
20
+ <!-- intentionally empty -->
21
+ {:else if (isSticky)}
22
+ {" | "}
23
+ {:else }
24
+ <br>
25
+ {/if}
26
+ <span class="sticky-div" bind:this={stickyElem}>
27
+ <slot/>
28
+ </span>
29
+ </span>
30
+
31
+ <style>
32
+ .sticky-div {
33
+ position: sticky;
34
+ top: -1px;
35
+ }
36
36
  </style>